← Back to Leaderboard
Rrust-mcp-stack

rust-mcp-stack/rust-mcp-schema

Versioned Rust types for parsing and building MCP JSON-RPC messages

View on GitHub ↗
AI FrameworkQuickstart ↓
Engineering Health (Methodology)
B · 58/100
Maintenance Activity
● Updated 3mo ago
Latest Release
v2.0.0
Commercial License Check
MIT · Commercial Friendly

Automated SPDX check for reference only — not legal advice. Disclaimer

Maintenance12/35
Fork Adoption9/25
Release Cadence17/20
License Clarity20/20
MCP
Total Stars
★ 79
24h Growth
+0
7d Growth
+0
Forks
5

GitHub Star History

Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.

rust-mcp-stack/rust-mcp-schema Star History (2025-02-08 - 2026-12-04) ALL-TIME STAR HISTORY (2025-02 – 2026-12) +78 in 664d · avg +0/day 83 42 0 2025-02-08: ★ 12025-03-22: ★ 212025-05-03: ★ 432025-06-14: ★ 552025-07-26: ★ 592025-09-06: ★ 642025-10-18: ★ 662025-11-29: ★ 702026-01-10: ★ 712026-02-21: ★ 742026-04-04: ★ 742026-05-16: ★ 742026-06-27: ★ 742026-08-08: ★ 752026-09-19: ★ 762026-10-31: ★ 792026-12-04: ★ 79 ★ 79 2025-02 2026-01 2026-12

Evidence-Backed Technical Brief

AI Deep Review

Architecture & 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.

Schema generation: Rust structs and enums are derived from upstream schema.ts and schema.json using a customized typify pipeline.
Dependencies: The Rust 2021 library uses serde with derive support and serde_json at runtime; json5 is a development dependency.
Message direction: Optional schema_utils separates client and server messages and provides wrappers for standard and custom traffic.
Wire handling: ClientRequest deserializes by method; the 2026-07-28 tool-result builder emits resultType: "complete" for a completed call.
Version selection: Cargo features select schema revisions; only one of 2026_07_28, 2025_11_25, and draft may occupy the crate root.
Runtime boundary: The crate builds and parses JSON-RPC payloads; transport and handler execution stay with the host.
Best For

Rust teams that own their MCP transport and execution layer and want typed JSON-RPC messages or explicit protocol-version fixtures.

Skip If

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.

Reviewed on 2026-12-03 · Grounded in GitHub README, root file tree & releasesMethodology

Quick Start & Installation

MCP
# 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 →
RepositoryStars7d TrendStackLicenseCore Positioning
rust-mcp-schema ★79—RustMITVersioned Rust types for parsing and building MCP JSON-RPC messages
headroom81.5k+455PythonApache-2.0Local context compression for LLMs via a Python library, proxy, and MCP server
gemini-cli109.6k+376TypeScriptApache-2.0A 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.

Raw .md ↗
curl -sL https://repoforai.com/repo/rust-mcp-stack/rust-mcp-schema.md

Embed Star History Chart & Badges in README.md

Full-history Star History SVGs and velocity cards on GitHub Camo: drop-in replacement for OSSInsight and Star History widgets.

rust-mcp-stack/rust-mcp-schema Star History on RepoForAI

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?

Once your transport has delivered a complete JSON-RPC payload, parse it as ClientMessage on the server or ServerMessage on the client. If you only need to decode known request types, you can deserialize directly into the generated ClientRequest enum, which dispatches on method. Your application still owns transport, routing, and handler execution.

Does it need a GPU, and what determines runtime overhead?

The crate has no GPU or VRAM requirement of its own: it performs Rust-side message handling and JSON serialization, not model inference. Size CPU and memory for representative payloads and concurrent messages, then measure inside the host application. The manifest declares Rust 1.80 as the minimum toolchain.

Can we ship it in a commercial product or run it internally?

Yes. The MIT license permits commercial use and redistribution, subject to retaining the copyright and permission notices in copies or substantial portions of the software. The schema crate can run locally without a hosted service. Review the licenses of the other components you ship separately.

When should we choose this crate over rust-mcp-sdk or raw JSON?

Choose rust-mcp-schema if you already own transport and execution, or only need typed message parsing and construction. Choose rust-mcp-sdk if you want an async toolkit for building MCP clients and servers. Using raw serde_json values instead gives you direct control over the wire representation but leaves dispatch and field checks to your code.

Upstream README & Documentation

This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.

Maintaining rust-mcp-stack/rust-mcp-schema? Pin to Homepage + competitor /alternatives pages with a custom Cloud/Demo CTA.Feature rust-mcp-stack/rust-mcp-schema on Homepage & Alternatives ($19)
WEEKLY BREAKOUT DIGEST

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

Saved in your browser · Export Markdown RFC tables or jump into /vs compare