dravr_tronc/lib.rs
1// ABOUTME: Root library for dravr-tronc shared MCP server infrastructure
2// ABOUTME: Re-exports protocol types, server, transports, auth, health, CLI, and tracing modules
3//
4// SPDX-License-Identifier: MIT OR Apache-2.0
5// Copyright (c) 2026 dravr.ai
6
7//! # dravr-tronc
8//!
9//! Shared MCP server infrastructure for dravr-xxx microservices.
10//! Provides JSON-RPC 2.0 protocol types, a generic `McpServer<S>`,
11//! stdio/HTTP transports, bearer auth middleware, health check traits,
12//! CLI argument parsing, and tracing initialization.
13//!
14//! ## Quick Start
15//!
16//! ```rust,ignore
17//! use dravr_tronc::mcp::{McpServer, ToolRegistry};
18//! use dravr_tronc::server::cli::ServerArgs;
19//!
20//! let registry = ToolRegistry::<MyState>::new();
21//! let state = Arc::new(RwLock::new(MyState::default()));
22//! let server = Arc::new(McpServer::new("my-server", "0.1.0", registry, state));
23//! ```
24
25#![cfg_attr(
26 test,
27 allow(
28 clippy::unwrap_used,
29 clippy::expect_used,
30 clippy::panic,
31 clippy::str_to_string
32 )
33)]
34
35pub mod error;
36pub mod mcp;
37#[cfg(feature = "notifications")]
38pub mod notifications;
39#[cfg(feature = "notifications")]
40pub mod notify;
41pub mod server;
42
43// Convenience re-exports
44pub use mcp::auth::{AuthError, AuthHook};
45pub use mcp::server::McpServer;
46pub use mcp::tool::{McpTool, ToolCapabilities, ToolContext, ToolRegistry};
47pub use mcp::{auth, modern, protocol, schema, transport};