1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
//! # MCP - Model Context Protocol SDK for Rust
//!
//! A Rust SDK for the Model Context Protocol that simplifies server development
//! through a unified `#[mcp_server]` macro.
//!
//! ## Features
//!
//! - **Reduced boilerplate** via unified `#[mcp_server]` macro
//! - **Type-safe state machines** via typestate pattern for connection lifecycle
//! - **Rich error handling** with context chains and miette diagnostics
//! - **Full MCP 2025-11-25 protocol coverage** including Tasks
//! - **Runtime-agnostic** async support
//!
//! ## Quick Start
//!
//! ```ignore
//! use mcpkit::prelude::*;
//! use mcpkit::transport::stdio::StdioTransport;
//!
//! struct Calculator;
//!
//! #[mcp_server(name = "calculator", version = "1.0.0")]
//! impl Calculator {
//! #[tool(description = "Add two numbers")]
//! async fn add(&self, a: f64, b: f64) -> ToolOutput {
//! ToolOutput::text((a + b).to_string())
//! }
//!
//! #[tool(description = "Multiply two numbers")]
//! async fn multiply(&self, a: f64, b: f64) -> ToolOutput {
//! ToolOutput::text((a * b).to_string())
//! }
//! }
//!
//! #[tokio::main]
//! async fn main() -> Result<(), McpError> {
//! let transport = StdioTransport::new();
//! let server = ServerBuilder::new(Calculator)
//! .with_tools(Calculator)
//! .build();
//! server.serve(transport).await
//! }
//! ```
//!
//! ## Comparison with rmcp
//!
//! | Aspect | rmcp | This SDK |
//! |---------------|----------------------|------------------------|
//! | Macros | 4 interdependent | 1 unified `#[mcp_server]` |
//! | Boilerplate | Manual router wiring | Zero initialization |
//! | Parameters | `Parameters<T>` wrapper | Direct from signature |
//! | Error types | 3 nested layers | 1 unified `McpError` |
//! | Tasks | Not implemented | Full support |
//!
//! ## Crate Organization
//!
//! - [`mcpkit_core`] - Protocol types and traits (no async runtime)
//! - [`mcpkit_transport`] - Transport abstractions (stdio, HTTP, WebSocket)
//! - [`mod@mcpkit_server`] - Server implementation with composable handlers
//! - [`mcpkit_client`] - Client implementation
//! - [`mcpkit_macros`] - Procedural macros for `#[mcp_server]` etc.
// Re-export all public items from core
pub use *;
// Re-export core modules explicitly for macro hygiene
// The macro generates paths like ::mcpkit::capability::ServerInfo
// Re-export server types
pub use ;
// Re-export transport types
pub use ;
// Re-export macros
pub use ;
/// Server module re-exports.
///
/// Re-exports all types from [`mcpkit_server`].
/// Transport module re-exports.
///
/// Re-exports all types from [`mcpkit_transport`].
/// Client module re-exports.
///
/// Re-exports all types from [`mcpkit_client`].