Skip to main content

solidmcp/
lib.rs

1//! MCP (Model Context Protocol) Server Library
2//!
3//! A standalone implementation of the Model Context Protocol server
4//! supporting both WebSocket and HTTP transports.
5
6// Re-export the main modules
7pub mod content_types;
8pub mod core;
9pub mod framework;
10pub mod handler;
11pub mod handlers;
12pub mod http;
13pub mod logging;
14pub mod protocol;
15pub mod protocol_impl;
16// Legacy trait removed - internal use only
17// pub mod protocol_testable;
18// Legacy server module removed - use framework module instead
19pub mod shared;
20pub mod tools;
21pub mod transport;
22pub mod validation;
23pub mod websocket;
24
25// Test modules
26#[cfg(test)]
27pub mod tests;
28
29// Re-export key types
30pub use core::McpServer;
31pub use protocol::McpProtocol;
32pub use protocol_impl::McpProtocolHandlerImpl;
33// Legacy trait removed - McpProtocolHandler is now internal
34pub use tools::McpTools;
35
36// Re-export core handler trait and types
37pub use handler::{
38    LogLevel, McpContext, McpHandler, McpNotification, PromptArgument, PromptContent, PromptInfo,
39    PromptMessage, ResourceContent, ResourceInfo, ToolDefinition, TypedToolDefinition,
40};
41
42// Re-export schemars for convenience
43pub use schemars::JsonSchema;
44
45// Re-export new framework API
46pub use framework::{FrameworkHandler, McpServerBuilder, PromptProvider, ResourceProvider};
47
48// Re-export content types for type-safe MCP responses
49pub use content_types::{McpContent, McpResponse, ToMcpResponse};
50
51// Re-export WebSocket handler for convenience
52pub use websocket::handle_mcp_ws_main as handle_mcp_ws;