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 `mentisdb` 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::{
25    BearerAuthContext, BearerTokenAuthorizer, HttpServerAdapter, HttpServerConfig,
26    HttpServerInstance,
27};
28pub use protocol::{
29    Tool, ToolDefinition, ToolError, ToolMetadata, ToolParameter, ToolParameterType, ToolProtocol,
30    ToolRegistry, ToolResult,
31};
32pub use resources::{ResourceError, ResourceMetadata, ResourceProtocol};
33pub use server::UnifiedMcpServer;
34#[cfg(feature = "server")]
35pub use streamable_http::{
36    streamable_http_router, streamable_http_router_with_sse, SseBroadcaster, SseEventHandler,
37    SseMessage, StreamableHttpConfig, CURRENT_MCP_PROTOCOL_VERSION,
38    SUPPORTED_MCP_PROTOCOL_VERSIONS,
39};