Skip to content
Open
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html)

## [Unreleased]

### Fixed

- Accept optional request metadata on session-era `initialize` requests in the
pinned conformance fixture instead of misclassifying them as modern traffic.

## [0.5.0] - 2026-09-16

### Added
Expand Down
32 changes: 27 additions & 5 deletions docker/mcp-conformance.patch
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,32 @@
// Stateless (draft) operations whose results MUST carry the SEP-2549 caching
// hints (`ttlMs`, `cacheScope`).
const STATELESS_CACHEABLE_METHODS: ReadonlySet<string> = new Set([
@@ -1283,8 +1291,42 @@
meta === undefined &&
reqVersion !== undefined &&
LEGACY_SESSION_PROTOCOL_VERSIONS.includes(reqVersion);
@@ -1276,15 +1284,57 @@
const meta = params._meta;
const metaVersion = meta?.['io.modelcontextprotocol/protocolVersion'];
-
- if (!sessionId && (reqVersion || meta) && !isLegacySessionEraRequest) {
+
- // A request that carries no `_meta` and names a legacy session-era revision
- // in the header is legacy traffic; it is served by the session path below
- // instead of being rejected for missing per-request metadata.
+ // An initialize request negotiates its version in params and may carry the
+ // optional RequestParams `_meta` field. Route session-era versions through
+ // the stateful transport even when that metadata is present.
+ const isLegacyInitializeRequest =
+ isInitializeRequest(body) &&
+ typeof params.protocolVersion === 'string' &&
+ LEGACY_SESSION_PROTOCOL_VERSIONS.includes(params.protocolVersion);
+
+ // A non-initialize request that carries no `_meta` and names a legacy
+ // session-era revision in the header is also legacy traffic.
const isLegacySessionEraRequest =
- meta === undefined &&
- reqVersion !== undefined &&
- LEGACY_SESSION_PROTOCOL_VERSIONS.includes(reqVersion);
+ isLegacyInitializeRequest ||
+ (meta === undefined &&
+ reqVersion !== undefined &&
+ LEGACY_SESSION_PROTOCOL_VERSIONS.includes(reqVersion));
+ const isModernEraRequest =
+ !sessionId && (reqVersion !== undefined || meta !== undefined) &&
+ !isLegacySessionEraRequest;
Expand Down Expand Up @@ -64,7 +84,9 @@
+ }
+ });
+ }
-
+
- if (!sessionId && (reqVersion || meta) && !isLegacySessionEraRequest) {
+ if (isModernEraRequest) {
// Missing Transport Header Validation Check
if (!reqVersion) {
Expand Down
Loading