Skip to content

Fix custom-header schema freshness - #358

Merged
pcarleton merged 2 commits into
modelcontextprotocol:mainfrom
jstar0:fix/http-custom-headers-fresh-ttl
Sep 6, 2026
Merged

Fix custom-header schema freshness#358
pcarleton merged 2 commits into
modelcontextprotocol:mainfrom
jstar0:fix/http-custom-headers-fresh-ttl

Conversation

@jstar0

@jstar0 jstar0 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Make the positive http-custom-headers mock advertise a fresh tools/list schema before requiring clients to mirror x-mcp-header parameters into Mcp-Param-* request headers.

Root Cause / Context

http-custom-headers returned tools/list with ttlMs: 0, which marks the tool schema immediately stale. The scenario then required the following tools/call to include Mcp-Param-* headers derived from that schema.

A strict client that composes the custom-header and caching rules can reasonably treat that schema as stale and omit schema-derived headers. That makes the positive custom-header scenario fail because of the mock's cache hint rather than the client's header support.

Changes

  • Change the positive custom-header tools/list response to use a positive TTL.
  • Add a regression test that only sends schema-derived Mcp-Param-* headers when the listed schema is fresh, then asserts all custom-header checks pass.
  • Update the 2026 result-field test to pin this scenario to a positive TTL while still checking the required cache fields.

Scope / Risk

This only changes the positive http-custom-headers client scenario. The invalid-tool scenario and other cacheable mock responses are unchanged.

Verification

npm test -- src/scenarios/client/http-custom-headers.test.ts -t "serves a fresh tools/list TTL"
npm run typecheck
npm run lint
npm run build
npm test

All commands passed.

Closes #354

@pcarleton pcarleton left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks — taking this because ttlMs: 300000 is a more realistic fixture, but wanted to note that since this PR was opened clients should not drop Mcp-Param-* on a stale schema: since modelcontextprotocol/modelcontextprotocol#2972 and #3071 the 2026-07-28 text makes header emission independent of TTL (streamable-http 'Client Behavior' steps 3–5), so a client that omitted them at ttlMs: 0 would still be non-conformant.

@pcarleton
pcarleton enabled auto-merge (squash) September 6, 2026 18:46
@pkg-pr-new

pkg-pr-new Bot commented Sep 6, 2026

Copy link
Copy Markdown

Open in StackBlitz

npx https://pkg.pr.new/@modelcontextprotocol/conformance@358

commit: 93dcef3

@pcarleton
pcarleton merged commit 7022d78 into modelcontextprotocol:main Sep 6, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

http-custom-headers requires a SEP-2243/SEP-2549 interpretation that is not implied by either SEP

2 participants