
Write HTML. Render video. Built for agents.
TurboMCP is a Rust workspace for the Model Context Protocol. It includes macros, protocol types, a typed client, server runtime, and multiple transports so you can build MCP apps without wiring everything by hand. The repository also ships auth, telemetry, conformance, interop, and extension crates, so the SDK covers both basic protocol work and production setup.
Builders who want reusable Rust pieces for MCP clients, MCP servers, and agent integrations.
You can build MCP-connected tools and agents with typed Rust code instead of hand-wiring protocol details.
`#[server]` turns an `impl` block into a working MCP server, and `#[tool]`, `#[resource]`, and `#[prompt]` mark the exposed methods.
`turbomcp-client` handles handshake and protocol version negotiation while keeping the API neutral across revisions.
The SDK supports stdio, Streamable HTTP, and WebSocket through dedicated transport crates and server helpers.
Optional crates add OAuth 2.1 bearer validation, client PKCE flow, tracing, metrics, and `_meta` propagation.
Workspace crates test the SDK against the official MCP conformance suite and the official Rust SDK in both directions.
The workspace includes extension crates such as `turbomcp-ext-tasks` for MCP task APIs.
A ground-up Rust SDK for the Model Context Protocol — both halves of the protocol, server and client — with a macro-driven, zero-boilerplate surface and strict spec compliance as a feature.
Status:
4.0.0-alpha.4— a prerelease for community testing. v4 is a from-scratch rewrite of TurboMCP; the stable line is3.x. Edition 2024, MSRV 1.88. It interoperates with the official Rust SDK in both directions, on both revisions, and both halves are scored against the official MCP conformance suite: 231 successful server assertions and 488 distinct successful client scenario/check pairs using pinned client fixture corrections, with zero failures, skips, or warnings. All three advertised revisions (2025-06-18,2025-11-25,2026-07-28) are dated and frozen;2026-07-28is generated from the releasedschema/2026-07-28/, not the RC. Found something broken or unergonomic? Please open an issue.
#[server] over an impl block turns
#[tool] / #[resource] / #[prompt] methods into a fully-wired MCP server.
The macro generates schema derivation code; schema values are initialized once at runtime and cloned for callers, and
the advertised capabilities are derived from which markers are present — they
can't drift from the implementation.2025-06-18, 2025-11-25, and 2026-07-28. Your handlers speak
version-neutral types; the version-specific wire shapes are conversions, not
signature changes — including dropping, per session, the fields a revision
predates. Pin the set with #[server(protocols("2025-11-25", …))].MyServer.run_stdio(), .run_http(addr, cfg), or
turbomcp::ws::serve_websocket(listener, factory).Client runs the handshake, negotiates the
version, and speaks the same neutral API — interoperating with the official
Rust SDK (rmcp) in both directions.rmcp, the official Rust SDKrmcp is the official SDK,
maintained in the modelcontextprotocol organization. It is the reasonable
default, and this project is tested against it — cross-SDK interop tests run in
both directions, a TurboMCP client against an rmcp server and the reverse, on
every change.
TurboMCP's interoperability tests pin rmcp 3.2. TurboMCP serves three
revisions (2025-06-18, 2025-11-25, 2026-07-28) using separate generated
wire types and exhaustive conversions to a neutral handler API. It does not
serve 2024-11-05 or 2025-03-26.
The distinguishing APIs are macro-derived capabilities, typed per-RPC contexts, composition, caller-specific visibility, and Tower middleware. Conformance and interoperability are compatibility evidence; they do not establish performance superiority over another SDK. See deployment and migration for the limits and security contracts.
use turbomcp::prelude::*;
#[derive(Clone)]
struct Hello;
#[server(name = "hello", version = "1.0.0")]
impl Hello {
/// Say hello to someone.
#[tool(description = "Say hello to someone")]
async fn hello(&self, name: String) -> McpResult<String> {
Ok(format!("Hello, {name}!"))
}
}
#[tokio::main]
async fn main() -> Result<(), turbomcp::ProtocolError> {
// Logs MUST go to stderr — stdout carries the MCP protocol framing.
Hello.run_stdio().await
}
See the turbomcp crate README for the full API
tour (tools/resources/prompts, structured output, HTTP, feature flags) and the
examples/.
The SDK is a Cargo workspace; the turbomcp facade re-exports the pieces most
users need, so a typical dependency is just turbomcp.
| Crate | Role |
|---|---|
turbomcp | Main SDK facade — re-exports, prelude, examples |
turbomcp-macros | #[server] / #[tool] / #[resource] / #[prompt] |
turbomcp-core | no_std foundation: McpError, ProtocolVersion, JSON-RPC, _meta |
turbomcp-codec | Wire codec: bytes ↔ JsonRpcMessage (serde_json baseline, opt-in SIMD via sonic-rs) |
turbomcp-protocol | MCP protocol: neutral types, date-versioned wire shapes, version dispatch |
turbomcp-service | The tower-shaped protocol seam, transport trait, shared RPC middleware |
turbomcp-server | Handler registry, dispatcher, ServerBuilder, graceful shutdown |
turbomcp-client | Typed client: handshake, version negotiation, neutral API |
turbomcp-transport-stdio / -http / -ws | Transport implementations |
turbomcp-auth | OAuth 2.1 resource-server auth (bearer validation, RFC 9728) |
turbomcp-telemetry | OpenTelemetry tracing (W3C _meta propagation, PII-safe spans) |
turbomcp-ext-tasks | Draft Tasks extension (io.modelcontextprotocol/tasks, SEP-2663) |
Compliance is tested, not asserted:
@modelcontextprotocol/conformance harness runs in both directions on both
scored revisions. As the server, it drives a full-featured TurboMCP server
over Streamable HTTP: 236 checks, 231 pass, 0 fail, 5 informational. As the
client, it stands up a deliberately awkward mock server per scenario and
referees what our client did on the wire: 488 distinct successful scenario/check pairs, 0 failures, including the
OAuth scenarios through the public OAuthSession coordinator. The client gate
uses hash-pinned fixture corrections
and reports zero failures, skips, or warnings. The unmodified upstream mode
remains available with its original fixture limitations. Neither side has
failure waivers (crates/turbomcp-conformance).2025-11-25 and the
stateless 2026-07-28 (crates/turbomcp-interop).no_std foundation configs) — dual-version dispatch, transport hardening
(Origin/auth/size caps/idle reaping), handler-panic containment, MRTR
elicitation, tasks (including in-execution input), subscriptions, pagination,
response caching, auth negative paths, client failure semantics against
misbehaving servers, and byte-level codec interchangeability
(serde_json ↔ sonic-rs).Mcp-Param header sentinel, URI templates, and a
sonic-vs-serde differential), run out of band via just fuzz; cargo-deny
(advisories/bans/licenses/sources) runs in CI on every push.turbomcp-core/-codec/-protocol build
no_std for wasm32-unknown-unknown on every gate run.The macro surface is intentionally source-compatible for the common case; see
crates/turbomcp/MIGRATION.md for the v3 → v4
deltas.
MIT
Sign in to join the discussion.
No comments yet. Be the first to say what this is good for.

Write HTML. Render video. Built for agents.
Ultra-lightweight, open-source, self-hosted personal AI agent framework in Python with WebUI, tools, memory, MCP, multi-agent workflows, automation, and chat apps
SkillOpt is a text-space optimizer that trains reusable natural-language skills for frozen LLM agents through trajectory-driven edits, validation-gated updates, and deployable best_skill.md artifacts.

Omnigent is an open-source AI agent framework and meta-harness: orchestrate Claude Code, Codex, Cursor, Pi, and custom agents — swap harnesses without rewriting, enforce policies and sandboxing, and collaborate in real time from any device.
A theoretical reconstruction of the Claude Mythos architecture, built from first principles using the available research literature.
🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl!