← all repositories
modelcontextprotocol/rust-sdk

Bridge Rust code to LLMs without boilerplate wiring

The official Rust SDK for the Model Context Protocol, giving your async functions a direct line to MCP clients.

3.9k stars Rust Coding AssistantsAgents
rust-sdk
Not currently ranked — collecting fresh signals.
star history

What it does RMCP implements the Model Context Protocol in Rust, letting you build servers that expose functions, files, and prompts to MCP-compatible clients, or write clients that consume them. The core crate manages protocol framing and tokio-based transport, while a companion macro crate generates routing and JSON Schema from your structs.

The interesting bit The #[tool], #[prompt], and #[tool_router] macros handle the drudgery of schema derivation and capability negotiation. For a simple tools-only server, #[tool_router(server_handler)] generates a complete ServerHandler implementation from an impl block, so you never touch the wire protocol directly.

Key highlights

  • Dual client/server support over stdio or child-process transports
  • Automatic JSON Schema 2020-12 generation from serde/schemars structs
  • #[tool_router(server_handler)] eliminates manual ServerHandler boilerplate for tool-only servers
  • Client-side helpers automatically paginate through list_all_tools and list_all_resources
  • Supports notifications, resource templates, and long-running tasks

Caveats

  • Macro-generated schemas ignore struct-level documentation, deriving descriptions solely from field names, types, and field docs
  • A 1.x release with breaking changes is in progress; the repository links to a migration guide
  • Hard-wired to the tokio runtime; there is no abstraction for other async executors

Verdict Pick this up if you want to serve Rust logic to MCP-compatible clients without writing protocol glue. Skip it if you are on a non-tokio runtime or need a generic RPC framework rather than MCP specifically.

Frequently asked

What is modelcontextprotocol/rust-sdk?
The official Rust SDK for the Model Context Protocol, giving your async functions a direct line to MCP clients.
Is rust-sdk open source?
Yes — modelcontextprotocol/rust-sdk is an open-source project tracked on heatdrop.
What language is rust-sdk written in?
modelcontextprotocol/rust-sdk is primarily written in Rust.
How popular is rust-sdk?
modelcontextprotocol/rust-sdk has 3.9k stars on GitHub.
Where can I find rust-sdk?
modelcontextprotocol/rust-sdk is on GitHub at https://github.com/modelcontextprotocol/rust-sdk.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.