Production-ready Rust SDK for building zero-boilerplate Model Context Protocol (MCP) servers and clients. Supports STDIO/HTTP/WebSocket/TCP/Unix Socket transports with built-in OAuth 2.1 + DPoP authentication, SIMD acceleration, and OpenTelemetry observability. Full implementation of MCP 2025-11-25 specification.
TurboMCP is a production-ready Rust SDK for the Model Context Protocol (MCP) developed by Epistates, Inc. The project uses Rust 2024 Edition (requires Rust 1.89.0+), currently at version 3.0.0-beta.5, with full implementation of the MCP 2025-11-25 specification.
Core Features#
Zero-Boilerplate Development#
Process macros (#[server], #[tool], #[resource], #[prompt], #[completion], #[ping], #[elicitation]) automatically generate JSON Schema from function signatures without manual schema construction or parameter parsing. Type-safe compile-time to runtime validation.
Multi-Transport Support#
| Transport | Performance | Use Case | Security |
|---|---|---|---|
| STDIO | Fast | Claude Desktop, CLI tools | Process isolation |
| HTTP/SSE | Good | Web apps, REST API | TLS 1.3, session management |
| WebSocket | Real-time | Interactive apps | Secure WebSocket |
| TCP | High throughput | Cluster deployment | Optional TLS |
| Unix Socket | Fast | Container communication | File permissions |
Enterprise-Grade Security#
- OAuth 2.1 with PKCE, multiple providers: Google, GitHub, Microsoft, Apple, Okta, Auth0, Keycloak, generic OIDC
- DPoP (RFC 9449) proof-of-possession tokens
- CORS protection with production-safe defaults
- Session management and timeout execution
- TLS 1.3 support with certificate validation
Performance Optimization#
- SIMD-accelerated JSON processing (simd-json / sonic-rs optional)
- Zero-copy message handling
- Circuit breakers, connection pooling, graceful degradation
- Built-in benchmarking suite (5% regression detection)
Complete MCP Protocol Coverage#
- ✅ Tools (full lifecycle + schema generation)
- ✅ Resources (URI templates + subscriptions)
- ✅ Prompts (dynamic templates + parameters)
- ✅ Sampling (server-initiated LLM requests)
- ✅ Completion (intelligent autocomplete)
- ✅ Elicitation (forms + URL patterns)
- ✅ Logging (structured bidirectional logging)
- ✅ Roots (filesystem boundary configuration)
Modular Architecture (10+ specialized crates)#
| Crate | Responsibility |
|---|---|
turbomcp | Main SDK, ergonomic API, process macros, prelude |
turbomcp-types | Unified types (single source of truth) |
turbomcp-core | no_std core types (base layer) |
turbomcp-protocol | Protocol implementation |
turbomcp-transport | Multi-protocol transport layer |
turbomcp-server | Server framework, Handler registry, middleware |
turbomcp-client | MCP client, connection management |
turbomcp-macros | Process macro definitions |
turbomcp-cli | Dev tools, testing, schema export |
turbomcp-auth | OAuth 2.1 authentication |
turbomcp-dpop | RFC 9449 DPoP tokens |
turbomcp-telemetry | OpenTelemetry integration |
turbomcp-wasm | WebAssembly bindings |
turbomcp-grpc | gRPC transport (tonic) |
turbomcp-openapi | OpenAPI to MCP conversion |
Quick Start#
[dependencies]
turbomcp = "3.0.0-beta.5"
tokio = { version = "1", features = ["full"] }
use turbomcp::prelude::*;
#[derive(Clone)]
struct Calculator;
#[server(name = "calculator", version = "1.0.0", transports = ["stdio"])]
impl Calculator {
#[tool("Add two numbers")]
async fn add(&self, a: f64, b: f64) -> McpResult<f64> {
Ok(a + b)
}
}
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
Calculator.run_stdio().await?;
Ok(())
}
Feature Presets#
| Preset | Use Case | Included Features |
|---|---|---|
| default | Basic tool server | STDIO only |
| full | Production server | All transports + context injection |
| full-stack | Server + client | full + client integration |
| network | Network services | STDIO + TCP |
Claude Desktop Integration#
{
"mcpServers": {
"hello-server": {
"command": "/path/to/your/server",
"args": []
}
}
}
License#
MIT License (Copyright 2025 Epistates, Inc.)