Skip to content

Everything-server rejects valid _meta on stateful initialize #506

Description

@lucarlig

Problem

The TypeScript everything-server misclassifies a stateful initialize request as stateless whenever params._meta is present. It rejects a valid 2025-11-25 request with HTTP 400 and -32020 Missing MCP-Protocol-Version header.

InitializeRequestParams extends RequestParams in the 2025-11-25 schema, so _meta is allowed on initialize. MCP Python SDK 2.x currently emits _meta: {} there, which makes the conformance fixture unusable as an upstream server for that client.

Reproduction

Start the fixture:

npx tsx examples/servers/typescript/everything-server.ts

Then send:

curl -i -X POST http://127.0.0.1:3000/mcp \
  -H 'Accept: application/json, text/event-stream' \
  -H 'Content-Type: application/json' \
  --data '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"probe","version":"1"},"_meta":{}}}'

Observed:

{"jsonrpc":"2.0","id":1,"error":{"code":-32020,"message":"Missing MCP-Protocol-Version header"}}

The same request succeeds when _meta is omitted.

Suggested fix

Route initialize through the stateful transport when params.protocolVersion names a session-era protocol, independently of whether optional request metadata is present. Add an integration regression test that sends _meta: {} to the everything-server and asserts a successful initialize response.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions