Skip to content

Server uses wrong protocol version to send response #186

@thisismydesign

Description

@thisismydesign

Describe the bug

I'm trying to use protocol version 2025-03-26, setting up the server as follows:

class ApplicationController < ActionController::API
  def mcp2
    configuration = MCP::Configuration.new(protocol_version: "2025-03-26")

    server = MCP::Server.new(
      name: "rails-mcp",
      version: "1.0.0",
      tools: [VerySecretNumberTool],
      configuration: configuration
    )
    render(json: server.handle_json(request.body.read))
  end
end

Server then receives a request with the same protocol version but responds with protocol version 2025-06-18.

Logs:

2025-11-28T00:22:43.100066+00:00 app[web.1]: [1544763c-772d-6581-7f79-26f5756e168e] Started POST "/mcp2" for 34.59.11.47 at 2025-11-28 00:22:43 +0000
2025-11-28T00:22:43.101155+00:00 app[web.1]: [1544763c-772d-6581-7f79-26f5756e168e] Processing by ApplicationController#mcp2 as JSON
2025-11-28T00:22:43.101175+00:00 app[web.1]: [1544763c-772d-6581-7f79-26f5756e168e]   Parameters: {"method"=>"initialize", "params"=>{"protocolVersion"=>"2025-03-26", "capabilities"=>{}, "clientInfo"=>{"name"=>"mcp", "version"=>"0.1.0"}}, "jsonrpc"=>"2.0", "id"=>0, "application"=>{"method"=>"initialize", "params"=>{"protocolVersion"=>"2025-03-26", "capabilities"=>{}, "clientInfo"=>{"name"=>"mcp", "version"=>"0.1.0"}}, "jsonrpc"=>"2.0", "id"=>0}}
2025-11-28T00:22:43.102217+00:00 app[web.1]: [1544763c-772d-6581-7f79-26f5756e168e] Completed 200 OK in 1ms (Views: 0.1ms | GC: 0.0ms)
2025-11-28T00:22:43.103062+00:00 app[web.1]: [650d1765-cb7f-c860-ff66-76b19e8855bf] Started POST "/mcp" for 34.59.11.47 at 2025-11-28 00:22:43 +0000
2025-11-28T00:22:43.103642+00:00 app[web.1]: [650d1765-cb7f-c860-ff66-76b19e8855bf] Client connected: mcp v0.1.0
2025-11-28T00:22:43.103667+00:00 app[web.1]: [650d1765-cb7f-c860-ff66-76b19e8855bf] Server response: {:protocolVersion=>"2025-06-18", :capabilities=>{:resources=>{:subscribe=>true, :listChanged=>true}, :tools=>{:listChanged=>true}}, :serverInfo=>{:name=>"app", :version=>"1.0.0"}}
2025-11-28T00:22:43.103688+00:00 app[web.1]: [650d1765-cb7f-c860-ff66-76b19e8855bf] Sending result: {:jsonrpc=>"2.0", :id=>0, :result=>{:protocolVersion=>"2025-06-18", :capabilities=>{:resources=>{:subscribe=>true, :listChanged=>true}, :tools=>{:listChanged=>true}}, :serverInfo=>{:name=>"app", :version=>"1.0.0"}}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions