Skip to content

Commit 3994cb3

Browse files
olaservoclaude
andauthored
feat: support protocol version 2025-11-25 (#81)
- Update client initialization check to accept both 2025-06-18 and 2025-11-25 - Server echoes back client's version if valid (proper version negotiation) - Fixes compatibility with SDK 1.25.1+ which sends 2025-11-25 🦉 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.5 <[email protected]>
1 parent 5f1bedd commit 3994cb3

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

src/checks/client.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,20 @@ export function createServerInfoCheck(serverInfo: {
2323
};
2424
}
2525

26+
// Valid MCP protocol versions
27+
const VALID_PROTOCOL_VERSIONS = ['2025-06-18', '2025-11-25'];
28+
2629
export function createClientInitializationCheck(
2730
initializeRequest: any,
28-
expectedSpecVersion: string = '2025-06-18'
31+
expectedSpecVersion: string = '2025-11-25'
2932
): ConformanceCheck {
3033
const protocolVersionSent = initializeRequest?.protocolVersion;
31-
const versionMatch = protocolVersionSent === expectedSpecVersion;
34+
35+
// Accept known valid versions OR custom expected version (for backward compatibility)
36+
const validVersions = VALID_PROTOCOL_VERSIONS.includes(expectedSpecVersion)
37+
? VALID_PROTOCOL_VERSIONS
38+
: [...VALID_PROTOCOL_VERSIONS, expectedSpecVersion];
39+
const versionMatch = validVersions.includes(protocolVersionSent);
3240

3341
const errors: string[] = [];
3442
if (!protocolVersionSent) errors.push('Protocol version not provided');

src/scenarios/client/initialize.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,18 @@ export class InitializeScenario implements Scenario {
110110

111111
this.checks.push(clientChecks.createServerInfoCheck(serverInfo));
112112

113+
// Echo back client's version if valid, otherwise use latest
114+
const VALID_VERSIONS = ['2025-06-18', '2025-11-25'];
115+
const clientVersion = initializeRequest?.protocolVersion;
116+
const responseVersion = VALID_VERSIONS.includes(clientVersion)
117+
? clientVersion
118+
: '2025-11-25';
119+
113120
const response = {
114121
jsonrpc: '2.0',
115122
id: request.id,
116123
result: {
117-
protocolVersion: '2025-06-18',
124+
protocolVersion: responseVersion,
118125
serverInfo,
119126
capabilities: {}
120127
}

0 commit comments

Comments
 (0)