Skip to content

Commit 934c4f1

Browse files
committed
Allow stable protocol specification version "2025-11-25"
The MCP specification dated 2025-11-25 has been released: - https://modelcontextprotocol.io/specification/2025-11-25 - https://blog.modelcontextprotocol.io/posts/2025-11-25-first-mcp-anniversary This PR allows `'2025-11-25'` to be specified for the `:protocol_version` keyword argument in `MCP::Configuration.new`.
1 parent d31c3da commit 934c4f1

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ transport = MCP::Server::Transports::StreamableHTTPTransport.new(server, statele
163163
#### Rails Controller
164164

165165
When added to a Rails controller on a route that handles POST requests, your server will be compliant with non-streaming
166-
[Streamable HTTP](https://modelcontextprotocol.io/specification/2025-06-18/basic/transports#streamable-http) transport
166+
[Streamable HTTP](https://modelcontextprotocol.io/specification/2025-11-25/basic/transports#streamable-http) transport
167167
requests.
168168

169169
You can use the `Server#handle_json` method to handle requests.
@@ -173,7 +173,7 @@ class ApplicationController < ActionController::Base
173173
def index
174174
server = MCP::Server.new(
175175
name: "my_server",
176-
title: "Example Server Display Name", # WARNING: This is a `Draft` and is not supported in the `Version 2025-06-18 (latest)` specification.
176+
title: "Example Server Display Name",
177177
version: "1.0.0",
178178
instructions: "Use the tools of this server as a last resort",
179179
tools: [SomeTool, AnotherTool],
@@ -383,15 +383,15 @@ If no exception reporter is configured, a default no-op reporter is used that si
383383

384384
### Tools
385385

386-
MCP spec includes [Tools](https://modelcontextprotocol.io/specification/2025-06-18/server/tools) which provide functionality to LLM apps.
386+
MCP spec includes [Tools](https://modelcontextprotocol.io/specification/2025-11-25/server/tools) which provide functionality to LLM apps.
387387

388388
This gem provides a `MCP::Tool` class that can be used to create tools in three ways:
389389

390390
1. As a class definition:
391391

392392
```ruby
393393
class MyTool < MCP::Tool
394-
title "My Tool" # WARNING: This is a `Draft` and is not supported in the `Version 2025-06-18 (latest)` specification.
394+
title "My Tool"
395395
description "This tool performs specific functionality..."
396396
input_schema(
397397
properties: {
@@ -428,7 +428,7 @@ tool = MyTool
428428
```ruby
429429
tool = MCP::Tool.define(
430430
name: "my_tool",
431-
title: "My Tool", # WARNING: This is a `Draft` and is not supported in the `Version 2025-06-18 (latest)` specification.
431+
title: "My Tool",
432432
description: "This tool performs specific functionality...",
433433
annotations: {
434434
read_only_hint: true,
@@ -581,7 +581,7 @@ end
581581
Please note: in this case, you must provide `type: "array"`. The default type
582582
for output schemas is `object`.
583583

584-
MCP spec for the [Output Schema](https://modelcontextprotocol.io/specification/2025-06-18/server/tools#output-schema) specifies that:
584+
MCP spec for the [Output Schema](https://modelcontextprotocol.io/specification/2025-11-25/server/tools#output-schema) specifies that:
585585

586586
- **Server Validation**: Servers MUST provide structured results that conform to the output schema
587587
- **Client Validation**: Clients SHOULD validate structured results against the output schema
@@ -624,7 +624,7 @@ end
624624

625625
### Prompts
626626

627-
MCP spec includes [Prompts](https://modelcontextprotocol.io/specification/2025-06-18/server/prompts), which enable servers to define reusable prompt templates and workflows that clients can easily surface to users and LLMs.
627+
MCP spec includes [Prompts](https://modelcontextprotocol.io/specification/2025-11-25/server/prompts), which enable servers to define reusable prompt templates and workflows that clients can easily surface to users and LLMs.
628628

629629
The `MCP::Prompt` class provides three ways to create prompts:
630630

@@ -633,7 +633,7 @@ The `MCP::Prompt` class provides three ways to create prompts:
633633
```ruby
634634
class MyPrompt < MCP::Prompt
635635
prompt_name "my_prompt" # Optional - defaults to underscored class name
636-
title "My Prompt" # WARNING: This is a `Draft` and is not supported in the `Version 2025-06-18 (latest)` specification.
636+
title "My Prompt"
637637
description "This prompt performs specific functionality..."
638638
arguments [
639639
MCP::Prompt::Argument.new(
@@ -672,7 +672,7 @@ prompt = MyPrompt
672672
```ruby
673673
prompt = MCP::Prompt.define(
674674
name: "my_prompt",
675-
title: "My Prompt", # WARNING: This is a `Draft` and is not supported in the `Version 2025-06-18 (latest)` specification.
675+
title: "My Prompt",
676676
description: "This prompt performs specific functionality...",
677677
arguments: [
678678
MCP::Prompt::Argument.new(
@@ -787,7 +787,7 @@ This is to avoid potential issues with metric cardinality
787787

788788
### Resources
789789

790-
MCP spec includes [Resources](https://modelcontextprotocol.io/specification/2025-06-18/server/resources).
790+
MCP spec includes [Resources](https://modelcontextprotocol.io/specification/2025-11-25/server/resources).
791791

792792
### Reading Resources
793793

@@ -797,7 +797,7 @@ The `MCP::Resource` class provides a way to register resources with the server.
797797
resource = MCP::Resource.new(
798798
uri: "https://example.com/my_resource",
799799
name: "my-resource",
800-
title: "My Resource", # WARNING: This is a `Draft` and is not supported in the `Version 2025-06-18 (latest)` specification.
800+
title: "My Resource",
801801
description: "Lorem ipsum dolor sit amet",
802802
mime_type: "text/html",
803803
)
@@ -830,7 +830,7 @@ The `MCP::ResourceTemplate` class provides a way to register resource templates
830830
resource_template = MCP::ResourceTemplate.new(
831831
uri_template: "https://example.com/my_resource_template",
832832
name: "my-resource-template",
833-
title: "My Resource Template", # WARNING: This is a `Draft` and is not supported in the `Version 2025-06-18 (latest)` specification.
833+
title: "My Resource Template",
834834
description: "Lorem ipsum dolor sit amet",
835835
mime_type: "text/html",
836836
)

lib/mcp/configuration.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class Configuration
55
# DRAFT-2025-v3 is the latest draft protocol version:
66
# https://github.com/modelcontextprotocol/modelcontextprotocol/blob/14ec41c/schema/draft/schema.ts#L15
77
DRAFT_PROTOCOL_VERSION = "DRAFT-2025-v3"
8-
SUPPORTED_STABLE_PROTOCOL_VERSIONS = ["2025-06-18", "2025-03-26", "2024-11-05"]
8+
SUPPORTED_STABLE_PROTOCOL_VERSIONS = ["2025-11-25", "2025-06-18", "2025-03-26", "2024-11-05"]
99

1010
attr_writer :exception_reporter, :instrumentation_callback
1111

test/mcp/configuration_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class ConfigurationTest < ActiveSupport::TestCase
5252
Configuration.new(protocol_version: Configuration::DRAFT_PROTOCOL_VERSION)
5353
end
5454

55-
assert_equal("protocol_version must be 2025-06-18, 2025-03-26, or 2024-11-05", exception.message)
55+
assert_equal("protocol_version must be 2025-11-25, 2025-06-18, 2025-03-26, or 2024-11-05", exception.message)
5656
end
5757

5858
test "raises ArgumentError when protocol_version is not a supported protocol version" do
@@ -61,7 +61,7 @@ class ConfigurationTest < ActiveSupport::TestCase
6161
custom_version = "2025-03-27"
6262
config.protocol_version = custom_version
6363
end
64-
assert_equal("protocol_version must be 2025-06-18, 2025-03-26, or 2024-11-05", exception.message)
64+
assert_equal("protocol_version must be 2025-11-25, 2025-06-18, 2025-03-26, or 2024-11-05", exception.message)
6565
end
6666

6767
test "raises ArgumentError when protocol_version is not a boolean value" do

test/mcp/server_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class ServerTest < ActiveSupport::TestCase
8080
)
8181
end
8282

83-
# https://modelcontextprotocol.io/specification/2025-06-18/basic/utilities/ping#behavior-requirements
83+
# https://modelcontextprotocol.io/specification/2025-11-25/basic/utilities/ping#behavior-requirements
8484
test "#handle ping request returns empty response" do
8585
request = {
8686
jsonrpc: "2.0",

0 commit comments

Comments
 (0)