rust-mcp-stack/rust-mcp-schema
Versioned Rust types for parsing and building MCP JSON-RPC messages
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
rust-mcp-schema is a Rust library for the MCP wire schema, not an MCP runtime. Its entry point is src/rust-mcp-schema.rs, and release-specific code sits under src/generated_schema/. The generated mcp_schema.rs files contain Serde-compatible structs and enums derived from upstream schema.ts and schema.json through a customized typify pipeline. The runtime dependencies are serde with derive support and serde_json.
The optional schema_utils layer leaves those generated types intact. It splits the general JsonrpcMessage model into direction-specific ClientMessage and ServerMessage types, with wrappers for standard and custom messages. The host passes in a JSON-RPC payload, matches the decoded message, invokes its own handler, and serializes the response. The crate does not receive messages from the transport or execute the handler.
Key Capabilities & Differentiators
Version 2.0.0 provides schemas for 2026-07-28 (the default), 2025-11-25, 2025-06-18, 2025-03-26, 2024-11-05, and draft. The types cover requests, responses, notifications, and errors. For tool calls, a server can match ClientJsonrpcRequest::Known and then ClientRequest::CallToolRequest, or deserialize straight into ClientRequest and let its Serde implementation dispatch on the method field.
On the response path, the 2026-07-28 CallToolResult::text_content helper sets resultType to "complete". ServerJsonrpcResponse wraps the result with the original request ID, and the client can match ServerResult::CallToolResult to recover the typed result. These types make the message shape and dispatch explicit; they do not negotiate a protocol revision or implement the tool handler.
Trade-offs & Limitations
Compared with handling raw serde_json values, the generated types give application code concrete fields and matchable variants instead of string-key lookups. Compared with the companion rust-mcp-sdk, an async toolkit for building clients and servers, this crate is the narrower choice: you retain control over transport and dispatch, but must supply both. The generator itself is not shipped in the repository, so teams cannot reproduce schema updates end to end from this checkout alone.
Version selection is a build-time concern. The 2026_07_28, 2025_11_25, and draft features compete for crate-root re-exports and are mutually exclusive. Older revisions are module-only and can coexist with one of those three. Because Cargo can unify dependency features, check the full dependency graph before assuming that two independently configured components can use different root revisions together.
Hardware & Deployment Guide
Add the crate as a Cargo dependency in the host application. Version 2.0.0 uses Rust edition 2021 and declares Rust 1.80 as its minimum supported version. The schema layer runs in-process and needs no container, database, GPU, or external API of its own. To target only 2025-06-18, disable defaults and enable the 2025_06_18 feature; also enable schema_utils explicitly if the integration uses its helpers.
The upgrade history is worth checking before a dependency bump: v0.10.3 added embedded-resource helpers for ContentBlock and corrected NumberSchema field types; v1.0.0 removed deprecated items; and v2.0.0 made 2026-07-28 the new default. Make the intended wire revision explicit, check the resolved Cargo feature set, and rerun representative message fixtures against the peers you support.
Rust teams that own their MCP transport and execution layer and want typed JSON-RPC messages or explicit protocol-version fixtures.
You need a runnable MCP server or an async client/server toolkit rather than a schema library, or need to reproduce schema generation from the repository alone.
Quick Start & Installation
# Cargo.toml rust-mcp-schema = { version: 2.0.0 , default-features = false, features=["2025_06_18"] }
Comparison vs. Top Coding, Skills & MCP Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| rust-mcp-schema ★ | 79 | — | Rust | MIT | Versioned Rust types for parsing and building MCP JSON-RPC messages |
| headroom | 81.5k | +455 | Python | Apache-2.0 | Local context compression for LLMs via a Python library, proxy, and MCP server |
| gemini-cli | 109.6k | +376 | TypeScript | Apache-2.0 | A Node.js terminal agent for enterprise Gemini coding workflows and MCP tools |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/rust-mcp-stack/rust-mcp-schema.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about rust-mcp-schema
Where does the crate fit in an MCP client or server?
Does it need a GPU, and what determines runtime overhead?
Can we ship it in a commercial product or run it internally?
When should we choose this crate over rust-mcp-sdk or raw JSON?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy