The official Rust SDK for the Model Context Protocol
open sourceApache-2.0 AND MITself-hostablefree
rmcp is the official Rust implementation of the Model Context Protocol, built on tokio, for writing both MCP servers and MCP clients. Procedural macros in rmcp-macros turn annotated Rust methods into tools and prompts, with JSON Schema 2020-12 generated through schemars. It ships stdio, child-process, in-process and Streamable HTTP transports (the HTTP server is a Tower service you mount on axum or hyper) and has OAuth support. It implements the 2026-07-28 MCP specification while staying compatible with 2025-11-25 and earlier.
Problems it solves
- build an MCP server in Rust
- expose my Rust service's functions as tools that Claude or other AI agents can call
- serve MCP over HTTP from an existing axum app
- write an MCP client in Rust that launches a local server over stdio
- generate JSON Schemas for tool arguments from Rust structs instead of writing them by hand
- add OAuth to a remote MCP server I'm writing in Rust
- support long-running tool calls and progress notifications in my agent integration
- ship a single static binary MCP server instead of a Node or Python one
- implement resources, prompts and sampling for an AI agent integration in Rust
- keep up with MCP spec changes without hand-rolling JSON-RPC
Features
- server and client
- #[tool], #[prompt] and router macros
- tools, resources, prompts, sampling, elicitation, roots, logging, completions
- subscriptions, tasks and multi-round-trip requests (2026-07-28 spec)
- stdio, child-process, in-process and Streamable HTTP transports
- stateless Streamable HTTP
- Tower service for axum/hyper
- OAuth support
- JSON Schema 2020-12 via schemars
Capabilities
| Has official SDKs | plan not known |
|---|
