Skip to main content
toolsSource-backedReview first Safety Privacy

Official MCP Rust SDK

Official Rust SDK for Model Context Protocol clients and servers, published as the `rmcp` crate with tokio async runtime support, server and client features, tool macros, resources, prompts, sampling, roots, logging, completions, notifications, Streamable HTTP, child-process transports, and OAuth support.

by Model Context Protocol·added 2026-06-18·
HarnessCLI
Review first review before installing

Open the source and read safety notes before installing.

Safety notes

  • The official Rust SDK is a protocol library; risk comes from the tools, resources, prompts, transports, auth flows, and long-running task behavior you implement with it.
  • Validate tool parameters, enforce caller permissions, bound file and network access, and sanitize errors before returning MCP responses.
  • Streamable HTTP servers, child-process transports, and OAuth flows need normal production controls: auth, TLS, request limits, lifecycle handling, logging policy, and abuse protection.
  • Feature flags can pull in transport, HTTP, OAuth, schema, and process dependencies; review the enabled feature set before shipping.

Privacy notes

  • Rust MCP services may expose tool arguments, tool results, resource contents, prompt templates, task state, authentication metadata, logs, traces, and subprocess output.
  • Avoid returning secrets, private files, customer data, internal identifiers, privileged paths, or raw dependency/runtime errors to MCP clients.
  • Document which MCP client, server process, transport, subprocess, model provider, and observability system can observe each request.

Prerequisites

  • Rust toolchain and Cargo project compatible with the SDK crate version and edition requirements.
  • Tokio async-runtime familiarity for client, server, transport, and handler integration.
  • A selected feature set for server, client, macros, Streamable HTTP, child-process, OAuth, or schema generation support.
  • Reviewed authorization, side-effect, and data-exposure boundaries for production MCP tools and resources.

Schema details

Install type
cli
Troubleshooting
No
Source repository stats
Scope
Source repo
Collection metadata
Estimated setup
20 minutes
Difficulty
advanced
Tool listing metadata
Pricing
free
Disclosure
editorial
Application category
DeveloperApplication
Operating system
Cross-platform
Full copyable content
cargo add rmcp

About this resource

Overview

The official MCP Rust SDK is the Model Context Protocol project's Rust implementation for building MCP clients and servers. The repository is published around the rmcp crate and an rmcp-macros procedural macro crate, with tokio async runtime support and docs.rs API documentation.

Rust developers are a high-intent segment for MCP infrastructure because they often care about typed protocol surfaces, async transport behavior, low-overhead services, and strict production boundaries.

Package Layout

Crate Best Fit
rmcp Core MCP protocol implementation for clients, servers, handlers, transports, and models
rmcp-macros Procedural macros for generating MCP tool implementations

Quick Start

Install the core crate:

cargo add rmcp

Then enable the SDK features that match your deployment, such as server, client, macros, Streamable HTTP, child-process transport, schema generation, or OAuth support. The upstream crates/rmcp/Cargo.toml documents the feature list.

MCP Fit

Choose the official Rust SDK when an MCP integration needs Rust's type system, async execution, transport control, service embedding, or tight resource bounds. It is a strong fit for developer tools, local services, infrastructure agents, gateway processes, and systems that already use tokio-based Rust components.

The SDK provides protocol and transport primitives. It does not make unsafe tools safe by itself, so production use still requires clear authorization and data-exposure boundaries.

Core Capabilities

Area Rust SDK Coverage
Server APIs Server handlers, tool registration, resources, prompts, notifications, and tasks
Client APIs MCP client support and child-process transport examples
Tool macros #[tool], #[tool_router], and related macro support through rmcp-macros
Transports stdio/async I/O, child process, Streamable HTTP client and server features
Protocol features Sampling, roots, logging, completions, notifications, subscriptions, and schema support
Auth Optional OAuth and JWT-related feature support

Use Cases

  • Build a typed Rust MCP server around local services or infrastructure APIs.
  • Implement a Rust MCP client or conformance test harness.
  • Expose tools with procedural macro routing.
  • Connect to child-process MCP servers from a Rust application.
  • Run Streamable HTTP MCP client or server transports.
  • Build low-overhead MCP services where resource bounds matter.

Source Review

Verified on 2026-06-18:

  • The upstream README identifies RMCP as an official Rust Model Context Protocol SDK implementation with tokio async runtime support.
  • The README lists rmcp as the core protocol crate and rmcp-macros as the procedural macro crate for tool implementations.
  • The workspace Cargo.toml declares versioned rmcp and rmcp-macros members, Apache-2.0 licensing, Rust 2024 edition, repository metadata, and MCP keywords.
  • crates/rmcp/Cargo.toml documents the package name, docs.rs documentation URL, dependencies, default features, server/client features, Streamable HTTP features, OAuth-related features, schema support, and child-process transport support.
  • docs.rs resolves current API documentation for rmcp.

Safety and Privacy

Rust helps with type safety and resource control, but MCP safety still depends on your handler design. Keep tool surfaces narrow, validate parameters, check permissions, and avoid returning raw internal errors or private data to clients.

For hosted or process-spawning deployments, review transport lifecycle, subprocess boundaries, authentication, logging, backpressure, cancellation, and task cleanup before production use.

Duplicate Check

Checked current content/mcp/, content/tools/, content/skills/, open pull requests, and repository-wide content for modelcontextprotocol/rust-sdk, official MCP Rust SDK, Model Context Protocol Rust SDK, rmcp crate, Rust MCP server SDK, Rust MCP client SDK, tokio MCP Rust, and MCP tool macros Rust. Some unrelated entries contain mcp inside product names, but no dedicated official Rust SDK entry, exact source URL duplicate, target file, or open duplicate PR was found.

Source citations

Add this badge to your README

Show that Official MCP Rust SDK is listed on HeyClaude. Paste this Markdown into your README — it renders the badge and links back to this page.

Listed on HeyClaude
[![Listed on HeyClaude](https://heyclau.de/badge/tools/official-mcp-rust-sdk.svg)](https://heyclau.de/entry/tools/official-mcp-rust-sdk)

How it compares

Official MCP Rust SDK side by side with 3 alternatives on trust, install, platform support, and disclosed safety notes — all from reviewed registry metadata.

FieldOfficial MCP Rust SDK

Official Rust SDK for Model Context Protocol clients and servers, published as the `rmcp` crate with tokio async runtime support, server and client features, tool macros, resources, prompts, sampling, roots, logging, completions, notifications, Streamable HTTP, child-process transports, and OAuth support.

Open dossier
Official MCP Java SDK

Official Java SDK for Model Context Protocol clients and servers, maintained in collaboration with Spring AI, with Java 17+ support, Maven artifacts, synchronous and asynchronous APIs, Reactive Streams, Project Reactor, JDK HttpClient, Servlet transport, JSON binding modules, and conformance tests.

Open dossier
Official MCP Python SDK

Official Python SDK for Model Context Protocol clients and servers, published as the `mcp` package on PyPI, with FastMCP server helpers, client support, tools, resources, prompts, stdio, SSE, Streamable HTTP, authentication, elicitation, sampling, logging, and standalone development tools.

Open dossier
Official MCP Ruby SDK

Official Ruby SDK for Model Context Protocol clients and servers, published as the `mcp` gem with JSON-RPC handling, tool, prompt, and resource registration, stdio and Streamable HTTP transports, Rack/Rails integration, roots, sampling, elicitation, logging, cancellation, pagination, and RubyGems metadata.

Open dossier
Trust
Install riskReview firstReview firstReview firstReview first
Notes Safety Privacy Safety Privacy Safety Privacy Safety Privacy
Categorytoolstoolstoolstools
Sourcesource-backedsource-backedsource-backedsource-backed
AuthorModel Context ProtocolModel Context ProtocolModel Context ProtocolModel Context Protocol
Added2026-06-182026-06-182026-06-182026-06-18
Platforms
CLI
CLI
CLI
CLI
Source repo
Safety notesThe official Rust SDK is a protocol library; risk comes from the tools, resources, prompts, transports, auth flows, and long-running task behavior you implement with it. Validate tool parameters, enforce caller permissions, bound file and network access, and sanitize errors before returning MCP responses. Streamable HTTP servers, child-process transports, and OAuth flows need normal production controls: auth, TLS, request limits, lifecycle handling, logging policy, and abuse protection. Feature flags can pull in transport, HTTP, OAuth, schema, and process dependencies; review the enabled feature set before shipping.The official Java SDK is a protocol library; production risk comes from your MCP tools, resources, prompts, transports, authorization hooks, and framework integration. Validate tool inputs, enforce caller permissions, bound side effects, and avoid returning raw Java exceptions or internal stack details to MCP clients. Servlet, Spring, and remote transport deployments need authentication, TLS, request limits, observability policy, cancellation behavior, and abuse protection. Spring AI MCP security and annotation support may simplify integration, but application owners still need to review authorization, tenant boundaries, and data retention.The official Python SDK is a protocol library; risk comes from the tools, resources, prompts, transports, auth flows, and server process you build with it. Validate all tool inputs, enforce caller permissions, bound file and network access, and sanitize errors before returning them to an MCP client. HTTP, SSE, and ASGI deployments need authentication, TLS, CORS review, host/path routing controls, request limits, logging policy, and abuse protection. The upstream README says v2 is alpha; production projects should stay on the stable v1 line unless they intentionally pin and test a pre-release.The official Ruby SDK is a protocol library; risk comes from your registered tools, resources, prompts, transports, session handling, and framework integration. Validate tool arguments, enforce caller permissions, bound file and network access, and sanitize exceptions before returning MCP responses. The upstream README warns that Streamable HTTP session and SSE state are in memory by default; multi-process Rack/Rails deployments need stateless mode or sticky sessions. Rails controller integrations that create servers per request should review user context, tool selection, and request-specific authorization carefully.
Privacy notesRust MCP services may expose tool arguments, tool results, resource contents, prompt templates, task state, authentication metadata, logs, traces, and subprocess output. Avoid returning secrets, private files, customer data, internal identifiers, privileged paths, or raw dependency/runtime errors to MCP clients. Document which MCP client, server process, transport, subprocess, model provider, and observability system can observe each request.Java MCP clients and servers may expose tool arguments, tool results, resource contents, prompt templates, request metadata, correlation IDs, logs, traces, and authorization context. Avoid leaking secrets, customer data, private resources, internal identifiers, stack traces, privileged paths, or token values through schemas, responses, errors, or logs. Document which MCP client, server process, Java framework, model provider, transport, and observability system can observe each request.MCP Python servers may expose local files, application data, tool arguments, tool results, resource contents, prompt templates, authentication state, logs, traces, and errors. Do not leak secrets, customer data, private paths, internal identifiers, token values, or privileged resource contents through schemas, examples, responses, or logs. Document which MCP client, model provider, server process, transport, ASGI layer, and observability system can observe each request.Ruby MCP clients and servers may expose tool arguments, tool results, resource contents, prompt templates, request context, session IDs, logs, progress events, exceptions, and filesystem roots. Avoid leaking secrets, customer data, private files, internal identifiers, stack traces, privileged paths, or session contents through schemas, responses, errors, or logs. Document which MCP client, Ruby process, Rack/Rails layer, session store, model provider, transport, and logging system can observe each request.
Prerequisites
  • Rust toolchain and Cargo project compatible with the SDK crate version and edition requirements.
  • Tokio async-runtime familiarity for client, server, transport, and handler integration.
  • A selected feature set for server, client, macros, Streamable HTTP, child-process, OAuth, or schema generation support.
  • Reviewed authorization, side-effect, and data-exposure boundaries for production MCP tools and resources.
  • Java 17 or newer and a Maven or Gradle build configured for the selected SDK artifact version.
  • A choice of core Java SDK usage, Spring AI MCP integration, or both.
  • A target transport, such as stdio, JDK HttpClient, Servlet, WebFlux, WebMVC, or another framework path.
  • Authentication, authorization, and data-exposure requirements for production clients and servers.
  • Python 3.10 or newer and a project managed with uv, pip, or another Python package manager.
  • A decision between stable v1 usage and explicit v2 alpha testing with a pinned pre-release.
  • A target transport, such as stdio for local tools or Streamable HTTP for hosted MCP servers.
  • Clear authorization, side-effect, and data-exposure boundaries for production tools and resources.
  • Ruby project compatible with the gem's required Ruby version and runtime dependencies.
  • A decision between local stdio integration, Rack/Rails Streamable HTTP, or client-side MCP usage.
  • A session strategy for Streamable HTTP when using Rack-compatible frameworks.
  • Authorization, side-effect, and data-exposure requirements for production tools and resources.
Install
cargo add rmcp
mvn dependency:get -Dartifact=io.modelcontextprotocol.sdk:mcp:2.0.0
uv add "mcp[cli]"
gem install mcp
Config
Citations
ClaimUnclaimedUnclaimedUnclaimedUnclaimed

Signals

Loading live community signals…

More like this, weekly

A short, calm digest of reviewed Claude resources. Unsubscribe any time.