Skip to content

Connection failed: unrecognised keys "level" #229

@thisismydesign

Description

@thisismydesign

Describe the bug
On v0.7.0 I'm getting the following error when trying to connect in inspector npx @modelcontextprotocol/inspector (v0.20.0)

Connection failed: "[
  {
    "code": "unrecognized_keys",
    "keys": [
      "level"
    ],
    "path": [],
    "message": "Invalid input"
  }
]"

Workaround

Turn off logging via

      @server ||= MCP::Server.new(
        # ...,
        capabilities: {
          tools: {listChanged: true}
        }
      )

Additional context

The configure_logging_level method in MCP::Server returns the LoggingMessageNotification object instead of an empty hash. This causes the JSON-RPC result to include {level: "debug"}, which violates the MCP spec (the result should be {}).

Clients that validate the response schema (e.g. MCP Inspector) reject the response with:

[{"code": "unrecognized_keys", "keys": ["level"], "path": [], "message": "Invalid input"}]

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