Add SEP-2575 conformance tests

Open
#266 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
typescript
Domain
api, testing

Research direction

Start by locating the existing server and client conformance-test entry points in the TypeScript repository, then review the SEP-2575 requirements for per-request _meta, server/discover, version negotiation, errors, removed RPCs, HTTP, and cancellation. Done means coverage exists for the listed server and client behavior across HTTP and STDIO, including the specified JSON-RPC and HTTP errors.

Written by the indexing model from the issue text.

Description

Add conformance tests for SEP-2575 to validate the stateless-MCP behavior. This includes conformance tests for both MCP server and client.

Server

  1. Per-request _meta
    • Rejects request with missing _meta → -32602 Invalid params.
    • Rejects request with _meta missing io.modelcontextprotocol/protocolVersion.
    • Rejects request with _meta missing io.modelcontextprotocol/clientInfo.
    • Rejects request with _meta missing io.modelcontextprotocol/clientCapabilities.
  2. server/discover
    • Responds to server/discover
    • Response includes required fields: supportedVersions (non-empty), capabilities, serverInfo
    • capabilities matches what the server honors on real RPC calls
  3. Version negotiation
    • For a _meta.protocolVersion the server does not support, returns UnsupportedProtocolVersionError (not Invalid params and not silent rejection).
    • UnsupportedProtocolVersionError carries non-empty data.supportedVersions matching the set advertised by server/discover (no drift).
    • server/discover's supportedVersions matches the set the server actually accepts on real RPC calls (no drift).
    • Returns the error even when the unsupported version is on the server/discover request itself (and still advertises supportedVersions so the client can recover).
    • [HTTP] UnsupportedProtocolVersionError → HTTP 400 Bad Request.
    • [HTTP] Rejects request when MCP-Protocol-Version header is absent or does not match _meta.protocolVersion (HTTP 400).
  4. Errors
    • MissingRequiredClientCapabilityError (-32003) carries data.requiredCapabilities listing missing keys.
    • All error responses carry the request's JSON-RPC id.
  5. Removed RPCs
    • ping → -32601.
    • logging/setLevel → -32601.
    • resources/subscribe → -32601.
    • resources/unsubscribe → -32601.
  6. HTTP transport
    • Unknown method → HTTP 404 Not Found + JSON-RPC -32601.
    • MissingRequiredClientCapabilityError → HTTP 400 Bad Request.

Client

  1. Per-request _meta
    • Populates _meta on every request with all three required fields.
    • Accurately reports clientCapabilities per request (does not claim unsupported features).
  2. server/discover
    • Should be able to call
  3. Version negotiation
    • Does version negotiation correctly
    • Includes io.modelcontextprotocol/protocolVersion in _meta on every request.
    • Sends a consistent protocolVersion once chosen (does not flip between versions request-to-request).
    • [HTTP] Sends MCP-Protocol-Version header on every request, equal to _meta.protocolVersion.
  4. Cancellation
    • [HTTP] Cancels by closing the stream (request).
    • [STDIO] Cancels by sending notifications/cancelled with the request id.
Dominant language
TypeScript
Stars
127
Forks
101
Avg merge
4d 7h
Merged PRs (30d)
6

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from modelcontextprotocol/conformance

All issues in modelcontextprotocol/conformance

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.