← Back to Leaderboard
Rmodelcontextprotocol

modelcontextprotocol/rust-sdk

Tokio-based Rust SDK for building typed MCP clients and servers

AI FrameworkQuickstart ↓
Engineering Health (Methodology)
A · 83/100
Maintenance Activity
● Updated today
Latest Release
rmcp-v3.12.0
Commercial License Check
Custom / Check Repo

Automated SPDX check for reference only — not legal advice. Disclaimer

Maintenance35/35
Fork Adoption22/25
Release Cadence20/20
License Clarity6/20
MCP
Total Stars
★ 4,188
24h Growth
+3
7d Growth
+38
Forks
743

GitHub Star History

Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.

modelcontextprotocol/rust-sdk Star History (2025-02-19 - 2026-12-03) ALL-TIME STAR HISTORY (2025-02 – 2026-12) +4.2k in 652d · avg +6/day 4.4k 2.2k 0 2025-02-19: ★ 12025-04-05: ★ 4892025-05-17: ★ 1,0392025-06-28: ★ 1,5332025-08-09: ★ 1,8932025-09-20: ★ 2,2032025-11-01: ★ 2,4412025-12-13: ★ 2,6512026-01-24: ★ 2,8192026-03-07: ★ 3,0672026-04-18: ★ 3,2782026-05-30: ★ 3,4392026-07-11: ★ 3,5972026-08-22: ★ 3,8062026-10-03: ★ 3,9582026-12-03: ★ 4,188 ★ 4.2k 2025-02 2026-01 2026-12

Evidence-Backed Technical Brief

AI Deep Review

Architecture & Core Mechanics

RMCP splits the protocol and async service implementation (crates/rmcp) from procedural macros for tool wiring (crates/rmcp-macros). Tokio runs the async services, Serde handles serialization, and schemars generates JSON Schema 2020-12. Applications implement ServerHandler or ClientHandler and bind the handler to a transport; crates/rmcp/src/handler/server.rs and crates/rmcp/src/handler/client.rs are the corresponding extension points.

On the server, ServiceExt::serve() waits for peer input that establishes the protocol lifecycle before returning a handle to the background service. The application can then issue requests or notifications through that handle and await shutdown with waiting() or initiate it with cancel(). The same handler-and-transport model supports a local server over Tokio stdio and a client that launches a subprocess with TokioChildProcess.

Key Capabilities & Differentiators

RMCP implements MCP 2026-07-28 while retaining the legacy 2025-11-25 lifecycle and compatibility with earlier versions. The new revision covers server discovery and negotiation, transport-neutral subscriptions, long-running tasks, response caching, multi-round-trip requests, and standard HTTP routing headers. Client serve() still sends initialize followed by notifications/initialized; in Discover mode, server/discover replaces that handshake and subsequent requests carry the protocol version, client information, and capabilities in _meta.

The #[tool], #[tool_router], and #[tool_handler] macros connect Rust methods to tool discovery and invocation. Generated schemas use field names, types, and field documentation, not docs on the enclosing type. Tool responses can carry mixed text, image, audio, and embedded resource blocks; structured results can be any JSON value under 2026-07-28. Resources are read by URI, with templates for parameterized URIs and notifications for list changes or individual updates.

Trade-offs & Limitations

Compared with hand-writing a narrow JSON-RPC adapter, RMCP takes on message typing, lifecycle handling, and tool schema generation, at the cost of adopting Tokio and the SDK's handler model. The tools-only macro shortcut minimizes wiring, but custom metadata or additional capabilities call for an explicit handler. Tool failures that callers should see belong in CallToolResult::error; Err(McpError) is for requests the server cannot route or process.

For mixed peer versions, choose the lifecycle deliberately: Auto can fall back when server/discover is unsupported, but a silent peer can add a 10-second wait before fallback. For stdio deployments, a server started without a client can wait at startup; serve_with_ct() supports startup cancellation, but Tokio's blocking stdin read can still delay runtime shutdown until input or EOF. Test both startup and shutdown with the actual client or process supervisor.

Hardware & Deployment Guide

The workspace uses Rust edition 2024 and declares Rust 1.88 as its minimum. Add the published crate with cargo add rmcp --features server for a server integration. For a local smoke test, build the counter with cargo build -p mcp-server-examples --example servers_counter_stdio, then run npx @modelcontextprotocol/inspector --cli ./target/debug/examples/servers_counter_stdio --method tools/list so Inspector launches the process and sends protocol messages.

The stdio path does not require a network listener or a GPU for protocol handling; size the process and any child services around representative handler workloads, payloads, and concurrency. Use the migration guide when moving to 3.x. In rmcp-v3.12.0, chrono became optional behind a default-enabled feature, typed results were preserved for numeric cache TTLs, and list_all_* pagination gained a cap. The matching macro release fixed description extraction when other attributes follow doc comments.

Crate split: rmcp implements the protocol and services; rmcp-macros generates tool routing and handler wiring.
Lifecycle negotiation: serve() uses legacy initialization; serve_with_lifecycle adds explicit Discover and Auto modes.
Tool contracts: schemars derives JSON Schema 2020-12 from Rust fields; MCP 2026-07-28 allows non-object output schemas and arbitrary JSON structured content.
Resource access: Clients can list URI templates, read concrete URIs, and handle list-change and resource-update notifications.
Local integration: Tokio stdio connects a server launched as a child process to an MCP client; TokioChildProcess supports this pattern on the client side.
Release behavior: rmcp-v3.12.0 bounds list_all_* pagination and gates chrono behind a default-enabled feature.
Best For

Rust teams exposing existing business logic as MCP tools or URI-addressable resources, or embedding a client that must handle both legacy initialization and newer discovery.

Skip If

You need a ready-to-run server rather than a library, or your application already uses another runtime and has no reason to add a Rust component.

Reviewed on 2026-11-29 · Grounded in GitHub README, root file tree & releasesMethodology

Quick Start & Installation

MCP
cargo add rmcp --features server

Comparison vs. Top Coding, Skills & MCP Alternatives

Full comparison →
RepositoryStars7d TrendStackLicenseCore Positioning
rust-sdk ★4.2k+38Rust—Tokio-based Rust SDK for building typed MCP clients and servers
headroom81.5k+455PythonApache-2.0Local context compression for LLMs via a Python library, proxy, and MCP server
chrome-devtools-mcp60.4k+760TypeScriptApache-2.0Chrome DevTools via MCP and CLI for live browser debugging and performance analy
gemini-cli109.6k+376TypeScriptApache-2.0A Node.js terminal agent for enterprise Gemini coding workflows and MCP tools

AI Context Briefing (for Claude / Cursor / Windsurf)

Standardized architecture summary & quickstart commands ready to paste into coding agents.

Raw .md ↗
curl -sL https://repoforai.com/repo/modelcontextprotocol/rust-sdk.md

Embed Star History Chart & Badges in README.md

Full-history Star History SVGs and velocity cards on GitHub Camo: drop-in replacement for OSSInsight and Star History widgets.

modelcontextprotocol/rust-sdk Star History on RepoForAI

Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).

Frequently Asked Questions about rust-sdk

How do I expose an existing Rust service over MCP?

Use #[tool] and #[tool_router(server_handler)] for a tools-only service. Use an explicit ServerHandler with #[tool_handler] when you need custom server metadata or additional capabilities. For resources, advertise the capability in get_info() and implement list_resources() and read_resource().

What hardware does an RMCP service need?

The SDK runs MCP protocol handling on Tokio; it does not require a GPU or VRAM for that work. Size the host for concurrent requests, handler workloads, and payload sizes. Include any child server in the budget and load-test representative calls before setting resource limits.

Can we use it commercially and self-host it?

The Cargo workspace declares Apache-2.0, which permits commercial use and self-hosting. For redistribution, check the license and notice obligations for the exact crates, dependencies, and artifacts you ship. Processes launched by the SDK may have separate license terms.

When should we choose RMCP over a handwritten adapter or another language's SDK?

RMCP is the more direct fit when the application and handlers already live in Rust: it supplies typed messages, lifecycle handling, and schema-backed routing. A handwritten adapter can make sense for a deliberately narrow endpoint if the team is willing to own protocol compatibility. If the host application already lives in another language, evaluate its native MCP SDK before adding a Rust process boundary.

Upstream README & Documentation

This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.

Maintaining modelcontextprotocol/rust-sdk? Pin to Homepage + competitor /alternatives pages with a custom Cloud/Demo CTA.Feature modelcontextprotocol/rust-sdk on Homepage & Alternatives ($19)
WEEKLY BREAKOUT DIGEST

Top 10 Breakout Open-Source AI Repos, Every Thursday

Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.

Zero spam · 1-click unsubscribe · Privacy Policy

Saved in your browser · Export Markdown RFC tables or jump into /vs compare