# Repository Briefing: rust-mcp-stack/rust-mcp-schema
> Source: https://repoforai.com/repo/rust-mcp-stack/rust-mcp-schema (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/rust-mcp-stack/rust-mcp-schema
- **Category**: Coding, Skills & MCP (AI 编程 / Skills / MCP)
- **Primary Language**: Rust
- **License**: MIT
- **Engineering Health**: B (58/100 · Maintenance 12/35 · Adoption 9/25 · Releases 17/20 · License 20/20)
- **Latest Release**: v2.0.0 (2026-08-22) — https://github.com/rust-mcp-stack/rust-mcp-schema/releases
- **Review Snapshot**: 2026-12-03
- **Deployment / Stack Signals**: MCP
- **Momentum**: 79 ★ total (+0 24h / +0 7d) · 5 forks
- **Topics**: `mcp-client`, `mcp-server`, `crates-io`, `mcp-host`, `model-context-protocol`, `rust`, `rust-lang`
- **When to Use**: 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.

## Overview
```text
### 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.
```

## Key Capabilities
```text
- 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.
```

## Quick Start / Clone
```bash
# Cargo.toml
rust-mcp-schema = { version: 2.0.0 , default-features = false, features=["2025_06_18"] }
```
