MCP.so
ログイン

MCP Schema for Rust

@rust-mcp-stack

基本情報

カテゴリ

その他

ライセンス

MIT

トランスポート

stdio

作者

rust-mcp-stack

MCP Schema for Rust について

A type-safe implementation of the official Model Context Protocol (MCP) schema in Rust.

MCP Schema for Rust の設定

標準の設定はありません

このサーバーの README には解析可能な MCP 設定ブロックが含まれていません。インストール手順はリポジトリをご確認ください。

リポジトリ

MCP Schema for Rust のツール

ツール一覧はまだありません

この掲載には表示できるツール一覧がまだありません。サーバーにツールがないという意味ではありません。対応機能はプロジェクトのドキュメントをご確認ください。

ツールは README から自動的に抽出されます。メンテナーは ## Tools という見出しの下に記載することで、このタブに反映できます。

概要

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_utils module 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

よくある質問

1

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`).

2

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.

3

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.

4

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.

5

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.

コメント

「その他」の他のコンテンツ