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`.
This commit is contained in:
parent
baeb75c8d8
commit
67e03d7b3d
4 changed files with 14 additions and 12 deletions
14
README.md
14
README.md
|
|
@ -173,7 +173,7 @@ class ApplicationController < ActionController::Base
|
|||
def index
|
||||
server = MCP::Server.new(
|
||||
name: "my_server",
|
||||
title: "Example Server Display Name", # WARNING: This is a `Draft` and is not supported in the `Version 2025-06-18 (latest)` specification.
|
||||
title: "Example Server Display Name",
|
||||
version: "1.0.0",
|
||||
instructions: "Use the tools of this server as a last resort",
|
||||
tools: [SomeTool, AnotherTool],
|
||||
|
|
@ -392,7 +392,7 @@ This gem provides a `MCP::Tool` class that can be used to create tools in three
|
|||
|
||||
```ruby
|
||||
class MyTool < MCP::Tool
|
||||
title "My Tool" # WARNING: This is a `Draft` and is not supported in the `Version 2025-06-18 (latest)` specification.
|
||||
title "My Tool"
|
||||
description "This tool performs specific functionality..."
|
||||
input_schema(
|
||||
properties: {
|
||||
|
|
@ -429,7 +429,7 @@ tool = MyTool
|
|||
```ruby
|
||||
tool = MCP::Tool.define(
|
||||
name: "my_tool",
|
||||
title: "My Tool", # WARNING: This is a `Draft` and is not supported in the `Version 2025-06-18 (latest)` specification.
|
||||
title: "My Tool",
|
||||
description: "This tool performs specific functionality...",
|
||||
annotations: {
|
||||
read_only_hint: true,
|
||||
|
|
@ -660,7 +660,7 @@ The `MCP::Prompt` class provides three ways to create prompts:
|
|||
```ruby
|
||||
class MyPrompt < MCP::Prompt
|
||||
prompt_name "my_prompt" # Optional - defaults to underscored class name
|
||||
title "My Prompt" # WARNING: This is a `Draft` and is not supported in the `Version 2025-06-18 (latest)` specification.
|
||||
title "My Prompt"
|
||||
description "This prompt performs specific functionality..."
|
||||
arguments [
|
||||
MCP::Prompt::Argument.new(
|
||||
|
|
@ -699,7 +699,7 @@ prompt = MyPrompt
|
|||
```ruby
|
||||
prompt = MCP::Prompt.define(
|
||||
name: "my_prompt",
|
||||
title: "My Prompt", # WARNING: This is a `Draft` and is not supported in the `Version 2025-06-18 (latest)` specification.
|
||||
title: "My Prompt",
|
||||
description: "This prompt performs specific functionality...",
|
||||
arguments: [
|
||||
MCP::Prompt::Argument.new(
|
||||
|
|
@ -824,7 +824,7 @@ The `MCP::Resource` class provides a way to register resources with the server.
|
|||
resource = MCP::Resource.new(
|
||||
uri: "https://example.com/my_resource",
|
||||
name: "my-resource",
|
||||
title: "My Resource", # WARNING: This is a `Draft` and is not supported in the `Version 2025-06-18 (latest)` specification.
|
||||
title: "My Resource",
|
||||
description: "Lorem ipsum dolor sit amet",
|
||||
mime_type: "text/html",
|
||||
)
|
||||
|
|
@ -857,7 +857,7 @@ The `MCP::ResourceTemplate` class provides a way to register resource templates
|
|||
resource_template = MCP::ResourceTemplate.new(
|
||||
uri_template: "https://example.com/my_resource_template",
|
||||
name: "my-resource-template",
|
||||
title: "My Resource Template", # WARNING: This is a `Draft` and is not supported in the `Version 2025-06-18 (latest)` specification.
|
||||
title: "My Resource Template",
|
||||
description: "Lorem ipsum dolor sit amet",
|
||||
mime_type: "text/html",
|
||||
)
|
||||
|
|
|
|||
|
|
@ -2,8 +2,10 @@
|
|||
|
||||
module MCP
|
||||
class Configuration
|
||||
LATEST_STABLE_PROTOCOL_VERSION = "2025-06-18"
|
||||
SUPPORTED_STABLE_PROTOCOL_VERSIONS = [LATEST_STABLE_PROTOCOL_VERSION, "2025-03-26", "2024-11-05"]
|
||||
LATEST_STABLE_PROTOCOL_VERSION = "2025-11-25"
|
||||
SUPPORTED_STABLE_PROTOCOL_VERSIONS = [
|
||||
LATEST_STABLE_PROTOCOL_VERSION, "2025-06-18", "2025-03-26", "2024-11-05",
|
||||
]
|
||||
|
||||
attr_writer :exception_reporter, :instrumentation_callback
|
||||
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ module MCP
|
|||
private
|
||||
|
||||
def validate!
|
||||
# NOTE: The draft protocol version is the next version after 2025-03-26.
|
||||
# NOTE: The draft protocol version is the next version after 2025-11-25.
|
||||
if @configuration.protocol_version <= "2025-03-26"
|
||||
if server_info.key?(:title)
|
||||
message = "Error occurred in server_info. `title` is not supported in protocol version 2025-03-26 or earlier"
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ module MCP
|
|||
Configuration.new(protocol_version: "DRAFT-2025-v3")
|
||||
end
|
||||
|
||||
assert_equal("protocol_version must be 2025-06-18, 2025-03-26, or 2024-11-05", exception.message)
|
||||
assert_equal("protocol_version must be 2025-11-25, 2025-06-18, 2025-03-26, or 2024-11-05", exception.message)
|
||||
end
|
||||
|
||||
test "raises ArgumentError when protocol_version is not a supported protocol version" do
|
||||
|
|
@ -62,7 +62,7 @@ module MCP
|
|||
custom_version = "2025-03-27"
|
||||
config.protocol_version = custom_version
|
||||
end
|
||||
assert_equal("protocol_version must be 2025-06-18, 2025-03-26, or 2024-11-05", exception.message)
|
||||
assert_equal("protocol_version must be 2025-11-25, 2025-06-18, 2025-03-26, or 2024-11-05", exception.message)
|
||||
end
|
||||
|
||||
test "raises ArgumentError when protocol_version is not a boolean value" do
|
||||
|
|
|
|||
Loading…
Reference in a new issue