Model Context Protocol (MCP) Schema for Rust
@rust-mcp-stack
About Model Context Protocol (MCP) Schema for Rust
A type-safe implementation of the official Model Context Protocol (MCP) schema in Rust.
Basic information
Config
No standard config provided
This server doesn't expose a parseable MCP config block in its README. See the repository for install instructions.
RepositoryTools
No tools detected
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
What is Model Context Protocol (MCP) Schema for Rust?
A type-safe Rust implementation of the official Model Context Protocol (MCP) schema, supporting all official MCP protocol versions (2025-11-25, 2025-06-18, 2025-03-26, 2024-11-05, and draft). The schemas are automatically generated from the official MCP specification, ensuring alignment with the latest standards. This crate is intended for developers building MCP servers or clients in Rust who need strongly typed message structures.
How to use Model Context Protocol (MCP) Schema for Rust?
Add the crate to your Cargo.toml with a specific schema version feature (e.g., features = ["2025_06_18"]). The default feature selects the latest version. Use the provided structs and enums with serde for serialization/deserialization. Optionally enable schema_utils (default) to access ClientMessage and ServerMessage types for stronger type safety.
Key features of Model Context Protocol (MCP) Schema for Rust
- Type-safe implementation of the MCP protocol specification
- Auto-generated schemas synced with official specifications
- Supports all released versions plus a draft version
- Complementary
schema_utilsmodule for improved developer productivity - Simple feature flags to switch between schema versions
Use cases of Model Context Protocol (MCP) Schema for Rust
- Build an MCP server in Rust with strongly typed request/response handling
- Develop an MCP client that correctly parses and constructs protocol messages
- Integrate MCP message formatting into AI-powered IDEs or chat interfaces
- Experiment with upcoming protocol changes using the draft schema version
FAQ from Model Context Protocol (MCP) Schema for Rust
How do I switch between different schema versions?
Enable the corresponding Cargo feature in your Cargo.toml. For example, features = ["2025_06_18"] uses the 2025-06-18 schema. Multiple versions can be enabled simultaneously; non-default versions are available under explicitly named modules (e.g., rust_mcp_schema::mcp_2025_06_18).
Does this crate provide a full MCP server or client implementation?
No. This crate only implements the MCP schema (types, serialization, deserialization). For a high‑performance asynchronous toolkit to build servers and clients, see rust-mcp-sdk, which is built on top of this schema.
What are the runtime requirements?
The crate relies on serde and serde_json for JSON serialization. No external runtime (e.g., Tokio) is required unless you add a transport layer. The schema itself is pure data structures.
How are the schemas generated?
They are generated from the official schema.ts and schema.json files in the MCP specification repository, using a customized version of typify plus pre‑ and post‑processing steps. The generation tool is not public but may be released as a CLI later.
What is schema_utils and do I have to use it?
schema_utils provides utility types (ClientMessage, ServerMessage) that split the unified JsonrpcMessage into client‑ and server‑specific messages for stronger type checking. It is enabled by default and optional. You can work directly with the raw schemas without it.
More Other MCP servers
XcodeBuildMCP
cameroncookeA Model Context Protocol (MCP) server and CLI that provides tools for agent use when working on iOS and macOS projects.
Awesome-MCP-ZH
yzflyMCP 资源精选, MCP指南,Claude MCP,MCP Servers, MCP Clients
Reactive Resume
amruthpillaiA one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!
ghidraMCP
LaurieWiredMCP Server for Ghidra
Awesome Mcp Servers
punkpeyeA collection of MCP servers.
Comments