rmcp

The official async Rust SDK for building Model Context Protocol clients and servers

SDK
Cargo
v3.2.0
3,891stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
88/100Excellent
Development Activity100
Maintenance100
Community72
Maturity40
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
81/100Excellent
Architecture85
Code Quality84
Innovation83
Learning Curve70

rmcp is the official Rust implementation of the Model Context Protocol (MCP), built on the tokio async runtime. It provides both client and server building blocks — tools, resources, prompts, sampling, roots, logging, completions, notifications, and subscriptions — plus a rmcp-macros procedural-macro crate for generating tool implementations from plain Rust functions with schemars-based JSON Schema generation for tool arguments.

The SDK supports multiple transports (stdio/child-process, streamable HTTP with standard headers and protocol-version negotiation) and both the legacy and newer MCP client lifecycle modes, along with OAuth support for authenticated servers and a task-manager abstraction for long-running tool invocations. As the reference Rust SDK for MCP, it is the crate most Rust-based MCP servers and clients build directly on top of.

What You Get

  • Client and server implementations of the full MCP primitive set: tools, resources, prompts, sampling, roots, logging, completions, notifications, and subscriptions
  • The rmcp-macros crate for generating tool implementations and their JSON Schema argument definitions from plain Rust functions via schemars
  • Multiple transports: stdio/child-process (e.g. spawning npx-based MCP servers) and streamable HTTP with protocol-version negotiation
  • Support for both legacy and current MCP client lifecycle modes
  • A task-manager abstraction for long-running tool invocations, plus built-in OAuth support for authenticated MCP servers

Common Use Cases

  • Building an MCP server in Rust that exposes tools, resources, or prompts to an MCP-compatible client (e.g. Claude Desktop or an agent framework)
  • Building an MCP client in Rust that connects to existing MCP servers over stdio or streamable HTTP
  • Spawning and communicating with an external MCP server process (e.g. an npm-distributed server) from a Rust application via TokioChildProcess
  • Implementing an OAuth-protected MCP server that needs authenticated client connections
  • Exposing long-running operations as MCP tools using the task-manager abstraction for progress reporting

Under The Hood

Architecture - The workspace splits into crates/rmcp (the core protocol implementation — handler, service, transport, and model modules) and crates/rmcp-macros (the procedural macro crate for tool generation), with examples/* and a conformance crate rounding out the workspace. service.rs and the service/ module implement the client/server session lifecycle; transport.rs abstracts over stdio and streamable-HTTP transports.

Tech Stack - Pure Rust (99%) on the tokio async runtime, using serde for message serialization and schemars to generate JSON Schema (2020-12) for tool argument definitions; Rust 2024 edition per the workspace Cargo.toml, with a pinned rust-toolchain.toml.

Code Quality - The crates/rmcp/tests directory has focused integration tests per behavior (client initialization, lifecycle modes, streamable-HTTP headers and protocol versioning, tool builder methods, progress subscribers), and a separate conformance crate checks the SDK against the MCP specification directly rather than relying on unit tests alone.

API Design - The client/server split is exposed through a small ServiceExt/serve() surface, and rmcp-macros lets server authors declare a tool as an annotated Rust function instead of hand-writing JSON Schema and dispatch code, keeping the common case (adding one tool) low-boilerplate while the lower-level handler/service/transport modules remain available for advanced use.

Used by 8 apps in this directory

Rust
65%
Apache 2.0

agentgateway

AI Development · Developer Tools

4,739

An open source AI-native proxy that secures, observes, and governs agent-to-LLM, agent-to-tool, and agent-to-agent communication through MCP, A2A, and unified LLM routing.

View details
88
Repo Health
82
Technical
70
Dependency
Built with
Rust65%
Go23%
Updated yesterday
Rust
37%
Other

Hook0

Devops

1,484

Open-source Webhooks-as-a-Service: deliver events to your users with auto-retry, signed payloads, and a real-time subscriber dashboard — all without building the infrastructure yourself.

View details
82
Repo Health
82
Technical
69
Dependency
Built with
Rust37%
TypeScript12%
Updated 4 days ago
TypeScript
51%
Other

Jan

AI Assistants

44,366

Run LLMs 100% locally with full privacy, or connect to cloud AI — your machine, your data, your control.

View details
89
Repo Health
81
Technical
65
Dependency
Built with
TypeScript51%
Rust46%
Updated 3 days ago
TypeScript
65%
Apache 2.0

Laminar

AI Development · Monitoring

3,230

Open-source observability platform purpose-built for AI agents — trace, evaluate, debug, and monitor at scale with SQL access and real-time replay.

View details
85
Repo Health
76
Technical
69
Dependency
Built with
TypeScript65%
Rust33%
Updated yesterday
Rust
70%
Apache 2.0

mesh-llm

AI Development · AI Agents

3,358

Mesh LLM pools GPUs and memory across every machine you own into one OpenAI-compatible API, so agents tap distributed compute instead of a single GPU box or a metered cloud bill.

View details
84
Repo Health
91
Technical
70
Dependency
Built with
Rust70%
TypeScript15%
Updated today
Rust
54%
GPL 3.0

openfootmanager

Game Development

1,109

A free and open source football management simulation game built with Rust and Tauri, inspired by Football Manager.

View details
93
Repo Health
79
Technical
75
Dependency
Built with
Rust54%
TypeScript46%
Updated 3 days ago
TypeScript
70%
AGPL 3.0

Silex

No Code Platforms · Design Tools

2,950

Free, open-source visual website builder that exports clean HTML/CSS — no lock-in, no subscription, host anywhere

View details
87
Repo Health
68
Technical
68
Dependency
Built with
TypeScript70%
JavaScript13%
Updated 1 weeks ago
Rust
50%
Apache 2.0

Vibe Kanban

AI Agents · AI Code Assistants · Project Management

28,027

A kanban board for planning work and dispatching Claude Code, Codex, Gemini CLI, and eight other coding agents into isolated git worktrees, then reviewing and merging their diffs from one UI.

View details
52
Repo Health
75
Technical
64
Dependency
Built with
Rust50%
TypeScript46%
Updated 4 months ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search