Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ npx @modelcontextprotocol/conformance client --command "<client-command>" --scen
- `--command` - The command to run your MCP client (can include flags)
- `--scenario` - The test scenario to run (e.g., "initialize")
- `--suite` - Run a suite of tests in parallel: `all`, `core`, `extensions`, `backcompat`, `auth`, `metadata`, `draft` (scenarios targeting the in-progress draft spec), or `sep-835`
- `--spec-version <version>` - Filter scenarios by spec version (e.g., `2025-11-25`, `DRAFT-2026-v1`; `draft` is accepted as an alias for the current draft identifier). The draft version selects the latest dated release plus any draft-only scenarios. When omitted, the version is inferred from the scenario's spec applicability (draft-only scenarios run at the draft version, everything else at the latest dated release); an explicitly requested version outside a scenario's applicability window skips the scenario (exit 0) unless `--force` is passed
- `--spec-version <version>` - Filter scenarios by spec version (e.g., `2025-11-25`, `2026-07-28`; `draft` is accepted as an alias for the current draft identifier). The draft version selects the latest dated release plus any draft-only scenarios. When omitted, the version is inferred from the scenario's spec applicability (draft-only scenarios run at the draft version, everything else at the latest dated release); an explicitly requested version outside a scenario's applicability window skips the scenario (exit 0) unless `--force` is passed
- `--force` - Run a scenario even if it is not applicable at the requested `--spec-version`
- `--expected-failures <path>` - Path to YAML baseline file of known failures (see [Expected Failures](#expected-failures))
- `--timeout` - Timeout in milliseconds (default: 30000)
- `--verbose` - Show verbose output

The framework appends `<server-url>` as an argument to your command and sets the `MCP_CONFORMANCE_SCENARIO` environment variable to the scenario name. For scenarios that require additional context (e.g., client credentials), the `MCP_CONFORMANCE_CONTEXT` environment variable contains a JSON object with scenario-specific data. When `--spec-version` is passed, its resolved value is forwarded to the client process as `MCP_CONFORMANCE_PROTOCOL_VERSION`; example clients can use this value directly as their `protocolVersion`. SDKs that hard-code their protocol version can ignore it. Clients under test must derive the lifecycle from the protocol version they are asked to run: dated versions through `2025-11-25` use the stateful lifecycle (initialize handshake), while the 2026 draft (`DRAFT-2026-v1`) uses the stateless lifecycle (per-request `_meta`).
The framework appends `<server-url>` as an argument to your command and sets the `MCP_CONFORMANCE_SCENARIO` environment variable to the scenario name. For scenarios that require additional context (e.g., client credentials), the `MCP_CONFORMANCE_CONTEXT` environment variable contains a JSON object with scenario-specific data. When `--spec-version` is passed, its resolved value is forwarded to the client process as `MCP_CONFORMANCE_PROTOCOL_VERSION`; example clients can use this value directly as their `protocolVersion`. SDKs that hard-code their protocol version can ignore it. Clients under test must derive the lifecycle from the protocol version they are asked to run: dated versions through `2025-11-25` use the stateful lifecycle (initialize handshake), while the 2026 draft (`2026-07-28`) uses the stateless lifecycle (per-request `_meta`).

### Server Testing

Expand Down
6 changes: 3 additions & 3 deletions examples/servers/typescript/everything-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1276,15 +1276,15 @@ app.post('/mcp', async (req, res) => {
}

// Protocol Version Negotiation Matrix (-32004, HTTP 400)
if (metaVersion !== 'DRAFT-2026-v1') {
if (metaVersion !== '2026-07-28') {
return res.status(400).json({
jsonrpc: '2.0',
id,
error: {
code: -32004,
message: 'UnsupportedProtocolVersionError',
data: {
supported: ['DRAFT-2026-v1'],
supported: ['2026-07-28'],
requested: String(metaVersion)
}
}
Expand Down Expand Up @@ -1344,7 +1344,7 @@ app.post('/mcp', async (req, res) => {
jsonrpc: '2.0',
id,
result: {
supportedVersions: ['DRAFT-2026-v1'],
supportedVersions: ['2026-07-28'],
capabilities: {
tools: { listChanged: true }, // Explicitly announce dynamic capabilities matching Section 7 expectations
prompts: { listChanged: true },
Expand Down
2 changes: 1 addition & 1 deletion examples/servers/typescript/sep-2164-empty-contents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ app.post('/mcp', (req, res) => {
jsonrpc: '2.0',
id,
result: {
supportedVersions: ['DRAFT-2026-v1'],
supportedVersions: ['2026-07-28'],
capabilities: { resources: {} },
serverInfo: { name: 'sep-2164-empty-contents', version: '1.0.0' }
}
Expand Down
2 changes: 1 addition & 1 deletion examples/servers/typescript/sep-2322-mrtr-broken-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type Handler = (params: Record<string, unknown>) => unknown;
const handlers: Record<string, Handler> = {};

handlers['server/discover'] = () => ({
supportedVersions: ['DRAFT-2026-v1'],
supportedVersions: ['2026-07-28'],
capabilities: {
tools: {},
prompts: {},
Expand Down
2 changes: 1 addition & 1 deletion examples/servers/typescript/sep-2549-no-caching-hints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ app.post('/mcp', (req, res) => {
jsonrpc: '2.0',
id,
result: {
supportedVersions: ['DRAFT-2026-v1'],
supportedVersions: ['2026-07-28'],
capabilities: { tools: {}, resources: {}, prompts: {} },
serverInfo: { name: 'sep-2549-no-caching-hints', version: '1.0.0' }
}
Expand Down
8 changes: 4 additions & 4 deletions src/connection/connection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ describe('connectFor', () => {
// version through), so identity with connectStateless no longer holds;
// assert it did not select the stateful implementation. The wire-level
// behaviour of the wrapper is covered in stateless.test.ts.
expect(connectFor('DRAFT-2026-v1')).not.toBe(connectStateful);
expect(connectFor('DRAFT-2026-v1')).not.toBe(connectStateless);
expect(connectFor('2026-07-28')).not.toBe(connectStateful);
expect(connectFor('2026-07-28')).not.toBe(connectStateless);
});
});

Expand Down Expand Up @@ -64,10 +64,10 @@ describe('connectStateless', () => {
await conn.request('tools/list');

const [, init] = mockFetch.mock.calls[0];
expect(init.headers['MCP-Protocol-Version']).toBe('DRAFT-2026-v1');
expect(init.headers['MCP-Protocol-Version']).toBe('2026-07-28');
const sent = JSON.parse(init.body);
expect(sent.params._meta['io.modelcontextprotocol/protocolVersion']).toBe(
'DRAFT-2026-v1'
'2026-07-28'
);
expect(
sent.params._meta['io.modelcontextprotocol/clientInfo']
Expand Down
2 changes: 1 addition & 1 deletion src/scenarios/client/http-standard-headers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('HttpStandardHeadersScenario (SEP-2243) — negative', () => {
id: 1,
method: 'initialize',
params: {
protocolVersion: 'DRAFT-2026-v1',
protocolVersion: '2026-07-28',
clientInfo: { name: 'neg-test', version: '0' },
capabilities: {}
}
Expand Down
6 changes: 3 additions & 3 deletions src/scenarios/client/request-metadata.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async function badClient(serverUrl: string) {
}

const goodMeta = {
'io.modelcontextprotocol/protocolVersion': 'DRAFT-2026-v1',
'io.modelcontextprotocol/protocolVersion': '2026-07-28',
'io.modelcontextprotocol/clientInfo': { name: 'test', version: '1.0' },
'io.modelcontextprotocol/clientCapabilities': {}
};
Expand Down Expand Up @@ -70,7 +70,7 @@ async function nonRetryingClient(serverUrl: string) {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'MCP-Protocol-Version': 'DRAFT-2026-v1'
'MCP-Protocol-Version': '2026-07-28'
},
body: JSON.stringify({
jsonrpc: '2.0',
Expand Down Expand Up @@ -118,7 +118,7 @@ async function malformedCapabilitiesClient(serverUrl: string) {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'MCP-Protocol-Version': 'DRAFT-2026-v1'
'MCP-Protocol-Version': '2026-07-28'
},
body: JSON.stringify({
jsonrpc: '2.0',
Expand Down
2 changes: 1 addition & 1 deletion src/scenarios/server/caching.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Servers MUST include \`ttlMs\` (integer >= 0) and \`cacheScope\` ("public" or "p
// SEP-2549 only exists in the draft spec, so each cacheable endpoint is
// queried over the version-appropriate connection. Under --spec-version
// draft that resolves to the stateless impl (SEP-2575): protocolVersion
// DRAFT-2026-v1 plus the cross-cutting _meta and standard headers
// 2026-07-28 plus the cross-cutting _meta and standard headers
// (issue #315).
let conn: Connection;
try {
Expand Down
4 changes: 2 additions & 2 deletions src/scenarios/server/stateless.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ describe('Stateless Server Scenario Negative Tests', () => {
jsonrpc: '2.0',
id: reqBody.id,
result: {
supportedVersions: ['DRAFT-2026-v1'],
supportedVersions: ['2026-07-28'],
capabilities: {},
serverInfo: { name: 'bad-meta-server', version: '1.0.0' }
}
Expand Down Expand Up @@ -341,7 +341,7 @@ describe('Stateless Server Scenario Negative Tests', () => {
jsonrpc: '2.0',
id: reqBody.id,
result: {
supportedVersions: ['DRAFT-2026-v1'],
supportedVersions: ['2026-07-28'],
capabilities: {
tools: { listChanged: true },
prompts: { listChanged: true }
Expand Down
2 changes: 1 addition & 1 deletion src/spec-types/SOURCE
Original file line number Diff line number Diff line change
@@ -1 +1 @@
modelcontextprotocol@33c3724972e6a87a8ad153e3f8a0d4714b0b9536
modelcontextprotocol@0168c57fc74aba6e6dcf8f0b7191db3caaa5ad65
Loading
Loading