Skip to content

[Tiering] Add conformance tests for Version Negotiation #102

@pcarleton

Description

@pcarleton

Summary

The MCP lifecycle spec requires specific version negotiation behavior during initialization, but the conformance test suite only tests basic initialization without verifying version negotiation. Additionally, HTTP clients must include the MCP-Protocol-Version header on subsequent requests.

Missing Coverage

Check: version-echo

Spec: "If the server supports the requested protocol version, it MUST respond with the same version."

Server receives initialize with a supported version → server responds with the same version.

Check: version-negotiate

Spec: "Otherwise, the server MUST respond with another protocol version it supports."

Server receives initialize with an unsupported version → server responds with a different supported version (not an error).

Check: http-protocol-version-header

Spec: "If using HTTP, the client MUST include the MCP-Protocol-Version: HTTP header on all subsequent requests to the MCP server."

After initialization, client includes MCP-Protocol-Version header on all HTTP requests.

Spec Requirements

Keyword Statement
MUST The client MUST send a protocol version it supports
SHOULD This SHOULD be the latest version supported by the client
MUST If the server supports the requested protocol version, it MUST respond with the same version
MUST Otherwise, the server MUST respond with another protocol version it supports
SHOULD This SHOULD be the latest version supported by the server
SHOULD If the client does not support the version in the server's response, it SHOULD disconnect
MUST If using HTTP, the client MUST include the MCP-Protocol-Version header on all subsequent requests

Current State

lifecycle.ts only tests that initialization succeeds - no version mismatch scenarios.

Spec References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions