Skip to main content

mcp/
lib.rs

1//! Reusable MCP runtime primitives for tool discovery, execution, and HTTP serving.
2//!
3//! This crate contains the protocol-facing pieces that can be shared by multiple
4//! higher-level projects. It intentionally avoids any dependency on `cloudllm`
5//! so crates such as `thoughtchain` and `cloudllm` can both build on the same
6//! MCP foundation without introducing circular dependencies.
7#![warn(missing_docs)]
8
9pub mod builder;
10pub mod builder_utils;
11pub mod client;
12pub mod events;
13pub mod http;
14pub mod protocol;
15pub mod resources;
16pub mod server;
17#[cfg(feature = "server")]
18pub mod streamable_http;
19
20pub use builder::MCPServerBuilder;
21pub use builder_utils::{AuthConfig, IpFilter};
22pub use client::McpClientProtocol;
23pub use events::{McpEvent, McpEventHandler};
24pub use http::{HttpServerAdapter, HttpServerConfig, HttpServerInstance};
25pub use protocol::{
26    Tool, ToolDefinition, ToolError, ToolMetadata, ToolParameter, ToolParameterType, ToolProtocol,
27    ToolRegistry, ToolResult,
28};
29pub use resources::{ResourceError, ResourceMetadata, ResourceProtocol};
30pub use server::UnifiedMcpServer;
31#[cfg(feature = "server")]
32pub use streamable_http::{
33    streamable_http_router, StreamableHttpConfig, CURRENT_MCP_PROTOCOL_VERSION,
34    SUPPORTED_MCP_PROTOCOL_VERSIONS,
35};