Skip to content

spec: decouple Mcp-Param-* header emission from schema TTL#2972

Open
pcarleton wants to merge 5 commits into
mainfrom
paulc/mcp-param-ttl-decouple
Open

spec: decouple Mcp-Param-* header emission from schema TTL#2972
pcarleton wants to merge 5 commits into
mainfrom
paulc/mcp-param-ttl-decouple

Conversation

@pcarleton

@pcarleton pcarleton commented Jun 24, 2026

Copy link
Copy Markdown
Member

Problem

The Client Behavior note for Mcp-Param-* headers says clients SHOULD omit custom headers when the cached inputSchema is stale. With ttlMs: 0 this is internally inconsistent:

  1. Schema is always stale → client SHOULD omit Mcp-Param-*.
  2. Body contains the annotated param, header absent → server MUST reject ("client omits header but value is in body").
  3. Note says: on reject, call tools/list and retry "with the appropriate headers".
  4. …but the freshly-fetched schema is also ttlMs: 0, so still stale, so per (1) the client still SHOULD omit. Loop.

ttlMs: 0 + x-mcp-header isn't an unreasonable config (volatile tool list, stable routing needs), so "don't do that" isn't a satisfying answer.

Change

Reframe the rule as optimistic-use-with-revalidation :

  • Clients construct Mcp-Param-* headers from the most recently obtained inputSchema, regardless of TTL.
  • Clients omit headers only when no schema has ever been obtained.
  • On reject (missing or mismatched headers), refresh tools/list and retry.

The server's mandatory header<>body validation is the freshness check for header emission; TTL governs tools/list re-fetch cadence and doesn't need to gate header emission.

This is equal-or-better than "omit when stale" in every drift case:

Scenario Old rule New rule
Schema unchanged extra round-trip wasted ✓ correct, 1 RT
Server added an annotation reject → refresh → retry reject → refresh → retry (same)
Server removed an annotation extra round-trip wasted ✓ unrecognized header ignored, 1 RT
Annotation moved to different param reject → refresh → retry HeaderMismatch → refresh → retry (same)

pcarleton and others added 2 commits June 24, 2026 13:24
The Client Behavior note for custom Mcp-Param-* headers previously said
clients SHOULD omit headers when the cached inputSchema is stale. With
ttlMs: 0 this creates a loop: the schema is always stale, so the client
always omits the header, the server rejects (header missing but value in
body), the client refreshes tools/list, and the refreshed schema is still
stale.

Reframe the rule: clients use the most recently obtained inputSchema to
construct headers, omit only when no schema has ever been obtained, and
refresh-and-retry on reject (now covering both missing and mismatched
headers). TTL governs re-fetch cadence for tools/list; it is not a gate
on emitting routing headers. Server-side header/body validation is the
freshness check.
@pcarleton pcarleton marked this pull request as ready for review June 24, 2026 12:35
@pcarleton pcarleton requested review from a team as code owners June 24, 2026 12:35
@mintlify

mintlify Bot commented Jun 24, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
mcp-staging 🟢 Ready View Preview Jun 24, 2026, 12:37 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@mintlify

mintlify Bot commented Jun 24, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
mcp 🟢 Ready View Preview Jun 24, 2026, 12:41 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

Comment thread docs/specification/draft/basic/transports/streamable-http.mdx Outdated
@localden localden added the rc-high-priority Related to an upcoming specification release and needs to be addressed with a high priority. label Jun 24, 2026
Co-authored-by: Paul Carleton <paulcarletonjr@gmail.com>
Comment thread seps/2243-http-standardization.md Outdated
Comment thread docs/seps/2243-http-standardization.mdx Outdated
@pcarleton

Copy link
Copy Markdown
Member Author

from Core-Maintainers meeting:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rc-high-priority Related to an upcoming specification release and needs to be addressed with a high priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants