Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: set default schema version to 2024_11_05 #64

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
hashemix merged 2 commits into main from feature/set-default-schema-version
Apr 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug-report.yml
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ body:
id: version
attributes:
label: Version
description: Specify which version of rust-mcp-schema you're using (e.g., latest, draft, or a specific version number).
description: Specify which version of rust-mcp-schema you're using.
render: text
validations:
required: false
- type: textarea
id: version
attributes:
label: MCP Schema Version
description: Specify which version of mcp schema specification you're using (e.g., latest, draft, 2024_11_05).
description: Specify which version of mcp schema specification you're using.
render: text
validations:
required: false
Expand Down
12 changes: 6 additions & 6 deletions Cargo.lock
View file Open in desktop

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions Cargo.toml
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ edition = "2021"
path = "src/rust-mcp-schema.rs"

[dependencies]
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0" }
serde = { version = "1.0.219", features = ["derive"] }
serde_json = { version = "1.0.140" }


[dev-dependencies]
Expand All @@ -24,25 +24,25 @@ json5 = { version = "0.4" }


[package.metadata.docs.rs]
features = ["latest", "schema_utils"]
features = ["2024_11_05", "schema_utils"]
rustdoc-args = ["--generate-link-to-definition"]

[package.metadata.playground]
features = ["latest", "schema_utils"]
features = ["2024_11_05", "schema_utils"]

### FEATURES #################################################################

# Features to enable different schema versions and associated schema_utils
[features]

# defalt features
default = ["latest", "schema_utils"] # Default features
default = ["2024_11_05", "schema_utils"] # Default features

# activates the latest MCP schema version, this will be updated once a new version of schema is published
latest = ["2024_11_05"]
latest = ["2025_03_26"]

# enables the draft version of the mcp schema
draft = []
# enabled mcp schema version 2025_03_26
2025_03_26 = []
# enabled mcp schema version 2024_11_05
2024_11_05 = []
# Enables `schema_utils`, which provides utility types that simplify communication with MCP messages, improving ease of use while reducing potential mistakes ane errors when constructing messages.
Expand Down
16 changes: 7 additions & 9 deletions README.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ A type-safe implementation of the official Model Context Protocol (MCP) schema i
The MCP schemas in this repository are [automatically generated](#how-are-schemas-generated) from the official Model Context Protocol, ensuring they are always up-to-date and aligned with the latest official specifications.

---

**Note:** This crate **only** provides an implementation of the MCP schema.

<img align="top" src="assets/rust-mcp-stack-icon.png" width="24" style="border-radius:0.2rem;"> If you are looking for a high-performance, asynchronous toolkit for building MCP servers and clients, checkout [rust-mcp-sdk](https://crates.io/crates/rust-mcp-sdk).
Expand All @@ -27,7 +28,6 @@ Focus on your app's logic while [rust-mcp-sdk](https://crates.io/crates/rust-mcp
- [How can this crate be used?](#how-can-this-crate-be-used)

- [Schema Versions](#schema-versions)
- [Currently available versions](#currently-available-versions)
- [How to switch between different schema versions?](#how-to-switch-between-different-schema-versions)
- [How are Schemas generated?](#how-are-schemas-generated)
- [What is `schema_utils`?](#what-is-schema_utils)
Expand All @@ -46,7 +46,7 @@ Focus on your app's logic while [rust-mcp-sdk](https://crates.io/crates/rust-mcp

- 🧩 Type-safe implementation of the MCP protocol specification.
- 💎 Auto-generated schemas are always synchronized with the official schema specifications.
- 📜 Includes all schema versions, including draft versions for early adoption.
- 📜 Includes both schema versions : `2024_11_05` and `2025_03_26`.
- 🛠 Complimentary schema utility module (schema_utils) to boost productivity and ensure development integrity.

## How can this crate be used?
Expand All @@ -68,25 +68,23 @@ For more information on the MCP architecture, refer to the [official documentati

## Schema Versions

This repository provides all versions of the schema, including draft versions, enabling you to prepare and adapt your applications ahead of upcoming official schema releases.

### Currently available versions
This repository provides all versions of the schema, which can be selected using Cargo features:

- [2024_11_05](src/generated_schema/2024_11_05)
- [Draft](src/generated_schema/draft)
- [2025_03_26](src/generated_schema/2025_03_26)

### How to switch between different schema versions?

Each schema version has a corresponding Cargo feature that can be enabled in your project's Cargo.toml.
By default, the latest version of the schema is active.
By default, the version `2024_11_05` of the schema is active.

Example: enable `draft` version of the shema:
Example: enable `2025_03_26` version of the shema:

<!-- x-release-please-start-version -->

```toml
# Cargo.toml
rust-mcp-schema = { version: 0.2.2 , features=["draft"] }
rust-mcp-schema = { version: 0.2.2 , features=["2025_03_26"] }
```

Example: enable `latest` version of the shema:
Expand Down
2 changes: 1 addition & 1 deletion scripts/run_clippy.sh
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
COMMON_FEATURES=("schema_utils")

# schema versions features (passed to clippy one at a time)
SCHEMA_VERSION_FEATURES=("2024_11_05" "draft")
SCHEMA_VERSION_FEATURES=("2025_03_26", "2024_11_05")

# space-separated string
COMMON_FEATURES_STR="${COMMON_FEATURES[*]}"
Expand Down
2 changes: 1 addition & 1 deletion scripts/run_test.sh
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
COMMON_FEATURES=("schema_utils")

# schema versions features (tested one at a time)
SCHEMA_VERSION_FEATURES=("2024_11_05" "draft")
SCHEMA_VERSION_FEATURES=("2025_03_26", "2024_11_05")

# space-separated string
COMMON_FEATURES_STR="${COMMON_FEATURES[*]}"
Expand Down
30 changes: 15 additions & 15 deletions src/generated_schema.rs
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
/// Schema Version : Draft
#[cfg(feature = "draft")]
#[path = "generated_schema/draft/mcp_schema.rs"]
mod schema_draft;
#[cfg(feature = "draft")]
pub use schema_draft::*;

#[cfg(all(feature = "schema_utils", feature = "draft"))]
#[path = "generated_schema/draft/schema_utils.rs"]
pub mod schema_utils;

/// Schema Version : 2024_11_05
#[cfg(feature = "2024_11_05")]
#[cfg(not(feature = "draft"))]
#[path = "generated_schema/2024_11_05/mcp_schema.rs"]
mod schema_2024_11_05;

#[cfg(feature = "2024_11_05")]
#[cfg(not(feature = "draft"))]
pub use schema_2024_11_05::*;

#[cfg(all(feature = "schema_utils", feature = "2024_11_05"))]
#[cfg(not(feature = "draft"))]
#[path = "generated_schema/2024_11_05/schema_utils.rs"]
pub mod schema_utils;

/// Schema Version : 2025_03_26
#[cfg(feature = "2025_03_26")]
#[cfg(not(feature = "2024_11_05"))]
#[path = "generated_schema/2025_03_26/mcp_schema.rs"]
mod schema_2025_03_26;

#[cfg(feature = "2025_03_26")]
#[cfg(not(feature = "2024_11_05"))]
pub use schema_2025_03_26::*;

#[cfg(all(feature = "schema_utils", feature = "2025_03_26"))]
#[cfg(not(feature = "2024_11_05"))]
#[path = "generated_schema/2025_03_26/schema_utils.rs"]
pub mod schema_utils;
6 changes: 3 additions & 3 deletions src/generated_schema/2024_11_05/mcp_schema.rs
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/// ----------------------------------------------------------------------------
/// This file is auto-generated by mcp-schema-gen v0.1.15.
/// This file is auto-generated by mcp-schema-gen v0.1.16.
/// WARNING:
/// It is not recommended to modify this file directly. You are free to
/// modify or extend the implementations as needed, but please do so at your own risk.
///
/// Generated from : <https://github.com/modelcontextprotocol/specification.git>
/// Hash : eb4abdf2bb91e0d5afd94510741eadd416982350
/// Generated at : 2025-03-23 16:07:00
/// Hash : 72516795d9a7aacdcf9b87624feb05229e10c950
/// Generated at : 2025-04-03 19:11:35
/// ----------------------------------------------------------------------------
///
/// MCP Protocol Version
Expand Down
Loading

AltStyle によって変換されたページ (->オリジナル) /