rust -schema
A type-safe implementation of the official Model Context Protocol (MCP) schema in Rust.
claude mcp add rust-mcp-stack-rust-mcp-schema
How to use
This Rust crate provides a type-safe implementation of the MCP (Model Context Protocol) schema. It includes generated schema modules for multiple MCP versions (including draft) and a utility module (schema_utils) to help with common tasks like serializing and deserializing MCP messages. You can use this crate as the core schema layer when building an MCP Server or MCP Client in Rust; the actual server/client logic, network handling, and application-specific behavior should be implemented in your project while relying on rust-mcp-schema for the MCP message types and serialization support. If you need higher-level functionality, pair this crate with rust-mcp-sdk, which offers a high-performance toolkit for building MCP servers and clients on top of the schema.
How to install
Prerequisites:
- Rust toolchain (rustc, cargo) installed. Preferably via rustup.
- Basic knowledge of Cargo and adding dependencies to a Rust project.
Step 1: Create a new Rust project (if you don’t have one yet)
- cargo new my_mcp_project --bin
- cd my_mcp_project
Step 2: Add rust-mcp-schema as a dependency
- Open Cargo.toml and add: [dependencies] rust-mcp-schema = "0.9" # or the latest version from crates.io
Step 3: Build your project to fetch the dependency
- cargo build
Step 4: (Optional) Enable a specific feature set if you know you need a particular schema version.
- In Cargo.toml, under [dependencies], you can specify features, for example: rust-mcp-schema = { version = "0.9", default-features = false, features = ["2025_11_25"] }
Step 5: Start implementing your MCP Server/Client logic using the types from rust-mcp-schema (and optionally rust-mcp-sdk for server/client scaffolding).
Additional notes
Notes and tips:
- This crate focuses on providing the MCP schema (types, serialization/deserialization) rather than full server logic. For building servers/clients, consider using rust-mcp-sdk on top of rust-mcp-schema for high-performance, asynchronous capabilities.
- Schema versions are available as Cargo features (e.g., 2025_11_25, 2025_06_18, draft). Enable the features you need in Cargo.toml.
- Serialization is supported via serde_json; ensure serde and serde_json are in scope where needed.
- If you are new to MCP, review the official MCP specification to understand message types like InitializeRequest, InitializeResult, and other protocol messages.
- The repository contains generated_schema modules under src/generated_schema with multiple versions; you can target a non-default version by enabling its Cargo feature.
- If you want to generate or adapt schemas manually, you can reference the schema_utils module for helper types and functions, but note that using schema_utils is optional.
Related MCP Servers
ida -rs
Headless IDA Pro MCP Server
rust -sdk
A high-performance, asynchronous toolkit for building MCP servers and clients in Rust.
mcp-probe
A Model Context Protocol (MCP) client library and debugging toolkit in Rust. This foundation provides both a production-ready SDK for building MCP integrations and the core architecture for an interactive debugger.
pluggedin-app
The Crossroads for AI Data Exchanges. A unified, self-hostable web interface for discovering, configuring, and managing Model Context Protocol (MCP) servers—bringing together AI tools, workspaces, prompts, and logs from multiple MCP sources (Claude, Cursor, etc.) under one roof.
furi
CLI & API for MCP management
mcp-discovery
A command-line tool written in Rust for discovering and documenting MCP Server capabilities.