Skip to content

Fix custom-header schema freshness#358

Open
jstar0 wants to merge 1 commit into
modelcontextprotocol:mainfrom
jstar0:fix/http-custom-headers-fresh-ttl
Open

Fix custom-header schema freshness#358
jstar0 wants to merge 1 commit into
modelcontextprotocol:mainfrom
jstar0:fix/http-custom-headers-fresh-ttl

Conversation

@jstar0

@jstar0 jstar0 commented Jun 19, 2026

Copy link
Copy Markdown

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

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

1 participant