rust-sdk/crates/rmcp
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Teddy Tennant 3075dc9152
fix(model): deprecate ServerInfo and ClientInfo aliases (#1156)
* fix(model): deprecate ServerInfo and ClientInfo aliases

Those names collide with the protocol's serverInfo/clientInfo fields,
which are only Implementation identity. Prefer InitializeResult and
InitializeRequestParams. Handler trait signatures, the tool_handler
macro output, tests, examples and docs now use the canonical types; the
aliases remain as deprecated shims for the rest of 3.x.

Fixes #1082

* fix(model): keep public signatures on the deprecated aliases

The public API check compares rendered signatures, and rustdoc records a
type alias by the name it was written with. Respelling
`ServerHandler::get_info`, `ClientHandler::get_info`,
`DiscoverResult::from_server_info` and `impl ClientHandler for ClientInfo`
onto `InitializeResult`/`InitializeRequestParams` therefore reads as
changed public items even though the aliases resolve to those exact types
and nothing downstream breaks.

Put those four signatures back on the aliases so the published API is
byte-identical, and note why at the alias definitions. The deprecation
still steers new code, and the macro output, tests, examples and docs
keep using the canonical names.

* fix(model): migrate leftover ClientInfo test sites

Two tests landed on main after the alias deprecation and still named
ClientInfo. Clippy -D warnings and the no-local feature test job both
failed on them.
2026-09-12 12:11:30 -04:00
..
src fix(model): deprecate ServerInfo and ClientInfo aliases (#1156) 2026-09-12 12:11:30 -04:00
tests fix(model): deprecate ServerInfo and ClientInfo aliases (#1156) 2026-09-12 12:11:30 -04:00
build.rs chore: add pre-commit hook for conventional commit verification (#619) 2026-01-14 16:01:28 -05:00
Cargo.toml fix: do not treat malformed JSON 200 as Accepted for requests (#1208) 2026-09-12 10:42:12 -04:00
CHANGELOG.md chore: release v3.3.0 (#1252) 2026-09-10 11:23:32 -04:00
README.md feat(auth): add enterprise refresh-token and ID-JAG exchanges (#1234) 2026-09-04 15:04:08 -04:00

rmcp

Crates.io Documentation

The official Rust SDK for the Model Context Protocol. Build MCP servers that expose tools, resources, and prompts to AI assistants — or build clients that connect to them.

For getting started, usage guides, and full MCP feature documentation (resources, prompts, sampling, roots, logging, completions, subscriptions, etc.), see the main README.

Feature Flags

Feature Description Default
server Server functionality and the tool system ✅
client Client functionality
macros #[tool] / #[prompt] macros (re-exports rmcp-macros) ✅
schemars JSON Schema generation for tool definitions
auth OAuth 2.0 authentication support
auth-enterprise-managed EMA/XAA refresh-token and ID-JAG exchanges for registered public and confidential clients (includes auth)
elicitation Elicitation support

Transport features

Feature Description
transport-io Server-side stdio transport
transport-child-process Client-side stdio transport (spawns a child process)
transport-async-rw Generic async read/write transport
transport-streamable-http-client Streamable HTTP client (transport-agnostic)
transport-streamable-http-client-reqwest Streamable HTTP client with default reqwest backend
transport-streamable-http-server Streamable HTTP server transport

TLS backend options (for HTTP transports)

Feature Description
reqwest Uses rustls — pure Rust TLS (recommended default)
reqwest-native-tls Uses platform-native TLS (OpenSSL / Secure Transport / SChannel)
reqwest-tls-no-provider Uses rustls without a default crypto provider (bring your own)

For enterprise-managed authorization, enable auth-enterprise-managed and a TLS backend such as reqwest. See the EMA/XAA guide for client authentication and an MCP connection example.

Transports

The transport layer is pluggable. Two built-in pairs cover the most common cases:

Client Server
stdio TokioChildProcess stdio
Streamable HTTP StreamableHttpClientTransport StreamableHttpService

Any type that implements the Transport trait can be used. The IntoTransport helper trait provides automatic conversions from:

  1. (Sink, Stream) or a combined Sink + Stream
  2. (AsyncRead, AsyncWrite) or a combined AsyncRead + AsyncWrite
  3. A Worker implementation
  4. A Transport implementation directly

License

This project is licensed under the terms specified in the repository's LICENSE file.