Spaces:
Running

mcp-primitives / index.html
evalstate's picture
evalstate HF Staff
Clarify subscriptions/listen rollout draining and stateless catch-up
68d123f verified
Raw History Blame Contribute Delete
79.1 kB
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>MCP primitive versioning proposal</title> <link rel="icon" href="data:,"> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet"> <style> :root { --bg: #FFFFFF; --surface: #F8FAFC; --surface-subtle: #F1F5F9; --ink: #0F172A; --ink-secondary: #334155; --mute: #475569; --rule: #E2E8F0; --rule-strong: #CBD5E1; --accent: #1D4ED8; --accent-tint: #EFF6FF; --ok: #15803D; --bad: #B91C1C; --bad-tint: #FEF2F2; --warn: #B45309; --warn-tint: #FFFBEB; --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; /* Strict 3-size body scale below H1 */ --text-lg: 1.1875rem; /* 19px: section headings */ --text-body: 0.9375rem; /* 15px: all body prose, lists, item titles */ --text-sm: 0.8125rem; /* 13px: controls, code, notes, diagram text */ } *, *::before, *::after { box-sizing: border-box; } html { background: var(--bg); color: var(--ink); scrollbar-gutter: stable; } body { margin: 0; font-family: var(--sans); font-size: var(--text-body); line-height: 1.55; color: var(--ink); -webkit-font-smoothing: antialiased; } a { color: var(--accent); text-decoration: underline; text-decoration-color: rgba(29, 78, 216, 0.35); text-underline-offset: 2px; } a:hover { text-decoration-color: var(--accent); } code, pre { font-family: var(--mono); font-size: var(--text-sm); } code { background: var(--surface-subtle); color: var(--ink); padding: 0.08em 0.32em; border-radius: 3px; } a code { color: inherit; } button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; } :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; } .page { max-width: 1080px; margin: 0 auto; padding: 0 28px 56px; } /* Header & Navigation */ .masthead { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 0 12px; } .masthead h1 { margin: 0; font-size: 1.375rem; font-weight: 600; line-height: 1.25; letter-spacing: -0.025em; color: var(--ink); } .control-pair { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; flex-wrap: wrap; } .control-label { font-size: var(--text-sm); color: var(--mute); font-weight: 500; } .segmented { display: inline-flex; flex-wrap: wrap; background: var(--surface-subtle); padding: 2px; border-radius: 6px; border: 1px solid var(--rule); } .segmented button { font-size: var(--text-sm); font-weight: 500; color: var(--mute); padding: 4px 11px; border-radius: 4px; white-space: nowrap; transition: background-color 160ms cubic-bezier(0.22, 1, 0.36, 1), color 160ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 160ms cubic-bezier(0.22, 1, 0.36, 1); } .segmented button:hover { color: var(--ink); } .segmented button[aria-checked="true"] { background: var(--bg); color: var(--ink); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.07); } /* Primary Tabs */ .tabbar { display: flex; gap: 28px; border-bottom: 1px solid var(--rule); margin-bottom: 16px; } .tabbar button { position: relative; padding: 8px 0 10px; font-size: var(--text-body); font-weight: 500; color: var(--mute); transition: color 160ms cubic-bezier(0.22, 1, 0.36, 1); } .tabbar button:hover { color: var(--ink); } .tabbar button[aria-selected="true"] { color: var(--ink); font-weight: 600; } .tabbar button[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); } .tabpanel[hidden] { display: none; } /* Intro prose */ .opening-prose { max-width: 68ch; margin: 0 0 18px; color: var(--ink-secondary); } .opening-prose p { margin: 0; } .opening-prose p + p { margin-top: 10px; color: var(--ink); } .opening-prose strong { color: var(--ink); font-weight: 600; } /* Section structure */ .section-block { padding-top: 16px; border-top: 1px solid var(--rule); margin-bottom: 20px; } .section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; } h2 { margin: 0; font-size: var(--text-lg); font-weight: 600; line-height: 1.3; letter-spacing: -0.02em; color: var(--ink); } h3 { margin: 0; font-size: var(--text-body); font-weight: 600; line-height: 1.35; color: var(--ink); } /* Silent drift 3-column horizontal flow */ .drift-flow { display: grid; grid-template-columns: minmax(0, 1.05fr) 38px minmax(0, 1fr) 38px minmax(0, 1.2fr); align-items: stretch; border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule); background: var(--surface); } .flow-step { padding: 14px 16px; min-width: 0; display: flex; flex-direction: column; gap: 6px; } .flow-step-title { font-size: var(--text-body); font-weight: 600; color: var(--ink); } .flow-detail { margin: 0; font-size: var(--text-sm); color: var(--ink-secondary); line-height: 1.5; } .flow-detail strong { color: var(--ink); font-weight: 600; } .flow-code { font-family: var(--mono); font-size: var(--text-sm); color: var(--ink); background: var(--bg); border-left: 2px solid var(--rule-strong); padding: 5px 9px; line-height: 1.45; overflow-wrap: anywhere; } .flow-code.is-amber { background: var(--warn-tint); border-left-color: var(--warn); color: var(--warn); font-weight: 500; } .flow-arrow { display: flex; align-items: center; justify-content: center; color: var(--mute); border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); background: var(--bg); } .flow-outcome { border-left: 3px solid var(--bad); background: var(--bad-tint); transition: background-color 180ms cubic-bezier(0.22, 1, 0.36, 1), border-color 180ms cubic-bezier(0.22, 1, 0.36, 1); } .flow-outcome.is-amber-mismatch { border-left-color: var(--warn); background: var(--warn-tint); } .outcome-verdict { font-size: var(--text-body); font-weight: 600; color: var(--bad); } .flow-outcome.is-amber-mismatch .outcome-verdict { color: var(--warn); } .drift-footnote { margin: 11px 0 0; font-size: var(--text-sm); color: var(--mute); max-width: 82ch; } .drift-footnote strong { color: var(--ink); font-weight: 600; } /* 3-column hairline grid (Why caching isn't enough) */ .three-col-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); } .hairline-col { padding: 14px 16px 15px 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; } .hairline-col + .hairline-col { padding: 14px 16px 15px 16px; border-left: 1px solid var(--rule); } .hairline-col:last-child { padding-right: 0; } .hairline-col p { margin: 0; color: var(--ink-secondary); } /* 2x2 typographic hairline grid (Requirements) */ .req-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule); } .req-cell { padding: 14px 24px 15px 0; display: flex; flex-direction: column; gap: 5px; min-width: 0; } .req-cell:nth-child(even) { padding: 14px 0 15px 24px; border-left: 1px solid var(--rule); } .req-cell:nth-child(n + 3) { border-top: 1px solid var(--rule); } .req-cell p { margin: 0; color: var(--ink-secondary); } /* Footer note */ .guardrails { padding-top: 16px; border-top: 1px solid var(--rule); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; } .guardrail-note { margin: 0; font-size: var(--text-sm); color: var(--mute); line-height: 1.55; } .guardrail-note strong { color: var(--ink); font-weight: 600; } /* Tab 2: Topologies */ .topo-intro { max-width: 68ch; margin: 0 0 20px; color: var(--ink-secondary); } .topo-intro strong { color: var(--ink); font-weight: 600; } .topo-row { padding: 22px 0 26px; border-top: 1px solid var(--rule); } .topo-row h2 { margin-bottom: 13px; } .diagram-wrap { width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 13px; background: var(--surface); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 10px 0; } .diagram-wrap svg { width: 100%; min-width: 1024px; height: auto; display: block; } .row-captions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; } .caption-item { margin: 0; color: var(--ink-secondary); } .caption-item strong { color: var(--ink); font-weight: 600; } .topo-closing { margin: 4px 0 0; padding-top: 18px; border-top: 1px solid var(--rule-strong); color: var(--ink-secondary); } .topo-closing p { margin: 0; max-width: 72ch; } .topo-closing strong { color: var(--ink); font-weight: 600; } @media (max-width: 820px) { .masthead { flex-direction: column; align-items: flex-start; } .drift-flow { grid-template-columns: 1fr; } .flow-arrow { height: 30px; border-left: 0; border-right: 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); } .flow-arrow svg { transform: rotate(90deg); } .three-col-grid, .req-grid, .guardrails, .row-captions { grid-template-columns: 1fr; } .hairline-col, .hairline-col + .hairline-col { padding: 14px 0; border-left: 0; } .hairline-col + .hairline-col { border-top: 1px solid var(--rule); } .req-cell, .req-cell:nth-child(even) { padding: 14px 0; border-left: 0; } .req-cell + .req-cell { border-top: 1px solid var(--rule); } } @media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; } } /* Proposed solution & At scale tabs */ .sol-lead { max-width: 68ch; margin: 0 0 22px; } .sol-lead p { margin: 0 0 10px; color: var(--ink-secondary); } .sol-lead p:last-child { margin-bottom: 0; color: var(--ink); font-weight: 500; } .sol-block { padding: 20px 0 0; border-top: 1px solid var(--rule); } .sol-block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 12px; } .sol-block-head h2 { margin: 0; font-size: var(--text-lg); font-weight: 600; line-height: 1.3; letter-spacing: -0.015em; } .sol-intro { margin: 0 0 16px; max-width: 70ch; color: var(--ink-secondary); } .sol-diagram-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); padding: 14px 16px; } .sol-diagram-wrap svg { display: block; width: 100%; min-width: 820px; height: auto; } .outcomes-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-top: 18px; } .outcome-col { padding: 16px 18px; } .outcome-col + .outcome-col { border-left: 1px solid var(--rule); } .outcome-col:first-child { padding-left: 0; } .outcome-col:last-child { padding-right: 0; } .outcome-col h3 { margin: 0 0 6px; font-size: var(--text-body); font-weight: 600; display: flex; align-items: center; gap: 8px; } .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; } .dot-ok { background: var(--ok); } .dot-warn { background: var(--warn); } .dot-mute { background: var(--mute); } .outcome-col p { margin: 0 0 8px; font-size: var(--text-sm); color: var(--ink-secondary); } .outcome-col p:last-child { margin-bottom: 0; } .outcome-meta { font-family: var(--mono); font-size: 12px; color: var(--mute); } .catalog-stage { border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); padding: 16px 18px; } .catalog-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--rule); } .blast-stat { font-size: var(--text-body); font-weight: 600; } .blast-stat.is-warn { color: var(--warn); } .blast-stat.is-ok { color: var(--ok); } .legend-inline { display: inline-flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: var(--text-sm); color: var(--mute); } .legend-item { display: inline-flex; align-items: center; gap: 6px; } .swatch { width: 11px; height: 11px; border-radius: 2px; border: 1px solid; display: inline-block; } .sw-ok { background: #F0FDF4; border-color: #86EFAC; } .sw-warn { background: var(--warn-tint); border-color: #FCD34D; } .sw-bad { background: var(--bad-tint); border-color: #F87171; } .groups-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } .tool-group { background: var(--bg); border: 1px solid var(--rule); border-radius: 5px; padding: 10px 12px; } .tool-group.has-change { border-color: #FECACA; } .tool-group.all-stale { border-color: #FDE68A; } .group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; } .group-name { font-size: var(--text-sm); font-weight: 600; color: var(--ink); } .group-count { font: 500 12px var(--mono); color: var(--mute); font-variant-numeric: tabular-nums; } .tile-row { display: flex; flex-wrap: wrap; gap: 4px; } .tile { height: 20px; min-width: 24px; padding: 0 5px; border-radius: 3px; border: 1px solid; font: 500 11px/18px var(--mono); display: inline-flex; align-items: center; justify-content: center; transition: background 160ms ease-out, border-color 160ms ease-out, color 160ms ease-out; } .tile.t-ok { background: #F0FDF4; border-color: #86EFAC; color: #166534; } .tile.t-warn { background: var(--warn-tint); border-color: #FCD34D; color: #92400E; } .tile.t-bad { background: var(--bad-tint); border-color: #F87171; color: #991B1B; font-weight: 600; } .tile.t-named { padding: 0 6px; } .tradeoff-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-top: 18px; } .tradeoff-col { padding: 16px 20px; } .tradeoff-col + .tradeoff-col { border-left: 1px solid var(--rule); } .tradeoff-col:first-child { padding-left: 0; } .tradeoff-col:last-child { padding-right: 0; } .tradeoff-col h3 { margin: 0 0 6px; font-size: var(--text-body); font-weight: 600; } .tradeoff-col p { margin: 0 0 8px; font-size: var(--text-sm); color: var(--ink-secondary); } .tradeoff-col p:last-child { margin-bottom: 0; } details.wire-details { margin-top: 18px; border-top: 1px solid var(--rule); padding-top: 14px; } details.wire-details summary { font-size: var(--text-sm); font-weight: 500; color: var(--accent); cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; } details.wire-details summary::-webkit-details-marker { display: none; } .wire-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 12px; } .wire-pane h4 { margin: 0 0 6px; font-size: var(--text-sm); font-weight: 600; color: var(--ink-secondary); } .wire-pane pre { margin: 0; padding: 11px 13px; background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; font-size: 12px; line-height: 1.5; overflow-x: auto; color: var(--ink); } .wire-pane pre .hl { background: var(--warn-tint); color: var(--warn); font-weight: 500; } @media (max-width: 860px) { .outcomes-grid, .groups-grid, .tradeoff-grid, .wire-grid { grid-template-columns: 1fr; } .outcome-col, .tradeoff-col { padding: 14px 0; } .outcome-col + .outcome-col, .tradeoff-col + .tradeoff-col { border-left: 0; border-top: 1px solid var(--rule); } } </style> </head> <body> <div class="page"> <header class="masthead"> <h1>MCP primitive versioning proposal</h1> <div class="control-pair"> <span class="control-label" id="example-label">Hypothetical example</span> <div class="segmented" role="radiogroup" aria-labelledby="example-label"> <button type="button" role="radio" aria-checked="false" data-example="minimal">Minimal</button> <button type="button" role="radio" aria-checked="true" data-example="hf">Hugging Face MCP</button> <button type="button" role="radio" aria-checked="false" data-example="db">Database Toolbox</button> </div> </div> </header> <nav class="tabbar" role="tablist" aria-label="Primitive versioning problem views"> <button type="button" role="tab" id="tab-btn-problem" aria-controls="panel-problem" aria-selected="true" data-tab="problem">The core problem</button> <button type="button" role="tab" id="tab-btn-topologies" aria-controls="panel-topologies" aria-selected="false" data-tab="topologies">Where mismatches happen</button> <button type="button" role="tab" id="tab-btn-solution" aria-controls="panel-solution" aria-selected="false" data-tab="solution">Proposed solution</button> <button type="button" role="tab" id="tab-btn-scale" aria-controls="panel-scale" aria-selected="false" data-tab="scale">At scale: per-tool tags</button> </nav> <!-- TAB 1: THE CORE PROBLEM --> <section class="tabpanel" id="panel-problem" role="tabpanel" aria-labelledby="tab-btn-problem"> <div class="opening-prose"> <p> Clients discover a tool once and invoke it later &mdash; across a TTL cache (<code>ttlMs</code>), a saved startup cache, or a pause for user approval. A call can satisfy the current input schema even when an argument&rsquo;s meaning or the tool&rsquo;s UI metadata has changed. </p> <p> <strong>An ordinary <code>tools/call</code> request does not reliably identify the definition the client used.</strong> </p> </div> <!-- Interactive Silent Drift Diagram --> <div class="section-block"> <div class="section-head"> <h2>Silent drift on a valid call</h2> <div class="segmented" role="radiogroup" aria-label="Silent drift variant"> <button type="button" role="radio" aria-checked="true" data-drift="unit">Unit / behavior change</button> <button type="button" role="radio" aria-checked="false" data-drift="metadata">Metadata-only change</button> <button type="button" role="radio" aria-checked="false" data-drift="approval">Paused for approval</button> </div> </div> <div class="drift-flow" id="drift-diagram"> <div class="flow-step"> <div class="flow-step-title">Client prepared from v1</div> <p class="flow-detail" id="d-client-desc"></p> <div class="flow-code" id="d-client-code"></div> </div> <div class="flow-arrow" aria-hidden="true"> <svg width="24" height="14" viewBox="0 0 24 14" fill="none"> <path d="M1 7H21M21 7L16 2M21 7L16 12" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> </svg> </div> <div class="flow-step"> <div class="flow-step-title">On the wire</div> <div class="flow-code" id="d-wire-code"></div> <p class="flow-detail" id="d-wire-desc"></p> </div> <div class="flow-arrow" aria-hidden="true"> <svg width="24" height="14" viewBox="0 0 24 14" fill="none"> <path d="M1 7H21M21 7L16 2M21 7L16 12" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> </svg> </div> <div class="flow-step flow-outcome" id="d-server-box"> <div class="flow-step-title">Server now runs v2</div> <div class="outcome-verdict" id="d-server-verdict"></div> <p class="flow-detail" id="d-server-desc"></p> </div> </div> <p class="drift-footnote"> <strong>Chained tools and outputs too:</strong> A change to one tool can silently break another (e.g., Tool A returns dollars while Tool B switches to cents). The server can also return <code>structuredContent</code> that matches its new <code>outputSchema</code> but fails validation against the client&rsquo;s cached schema, after the side effect has occurred. </p> </div> <!-- Why caching, TTLs, and notifications aren't enough --> <div class="section-block"> <div class="section-head"> <h2>Why caching, TTLs, and notifications aren&rsquo;t enough</h2> </div> <div class="three-col-grid"> <div class="hairline-col"> <h3>TTLs are hints, not guarantees</h3> <p> <code>ttlMs</code> hints how long a result may be treated as fresh; the definition may change sooner. <code>cacheScope</code> controls who may reuse it. Clients also reuse persisted lists at startup without re-checking freshness to cut latency. </p> </div> <div class="hairline-col"> <h3>Notifications miss rollouts and still race</h3> <p> <code>subscriptions/<wbr>listen</code> is a long-held stream pinned to one replica and drained last during a rolling deploy, while <code>tools/call</code> already hits new pods &mdash; and reconnecting carries no prior state. Even when <code>list_changed</code> arrives, definitions can still change between lookup and call. </p> </div> <div class="hairline-col"> <h3>Prepared work outlives the cache</h3> <p> A call awaiting user approval still reflects the old definition even if a background refresh updates the client&rsquo;s cached list to <code>v2</code> before the user clicks Approve. </p> </div> </div> </div> <!-- What a solution must do for a prepared call --> <div class="section-block"> <div class="section-head"> <h2>What a solution must do for a prepared call</h2> </div> <div class="req-grid"> <div class="req-cell"> <h3>Identify the definition used to prepare a call</h3> <p> Keep the original definition reference when the cache refreshes. Distinguish a missing reference from one the service cannot honor. </p> </div> <div class="req-cell"> <h3>Detect mismatches before execution</h3> <p> Allow the service to honor a compatible call, route it to a replica that supports that definition, or reject it before running side effects. </p> </div> <div class="req-cell"> <h3>Separate &ldquo;succeeded, refresh later&rdquo; from &ldquo;rejected before execution&rdquo;</h3> <p> Keep compatible and unrelated calls working while signaling staleness, so clients know when to refresh without repeating an operation that already ran. </p> </div> <div class="req-cell"> <h3>Distinguish definition mismatch from bad arguments</h3> <p> Give clients a distinct mismatch error so they can refresh and replan, with identical behavior across every transport &mdash; including stdio without HTTP headers. </p> </div> </div> <p class="drift-footnote"> <strong>Catalog consistency too:</strong> During discovery, clients also need a way to detect mixed pages across a paginated catalog and prevent a delayed response from overwriting a completed refresh. </p> </div> <footer class="guardrails"> <p class="guardrail-note"> <strong>Beyond tools:</strong> The same gap affects <code>prompts</code> (arguments added while a user fills out a form), <code>resource</code> URI templates, and <code>skills/list</code> (Skills extension) &mdash; where a skill definition can change across reads separately from referenced files already checked via manifest digests. </p> <p class="guardrail-note"> <strong>Scope &amp; wire design:</strong> This page covers the core problem statement (<a href="problem-statement.md"><code>problem-statement.md</code></a>). See the <strong>Proposed solution</strong> and <strong>At scale: per-tool tags</strong> tabs above for how list tags and per-tool tags address these requirements (see also <a href="versioning-scope-decision.md"><code>versioning-scope-decision.md</code></a>). </p> </footer> </section> <!-- TAB 2: WHERE MISMATCHES HAPPEN --> <section class="tabpanel" id="panel-topologies" role="tabpanel" aria-labelledby="tab-btn-topologies" hidden> <p class="topo-intro"> <strong>Discovery and execution can reach different versions of the same service.</strong> Routine deployments, load balancers, and multi-service gateways create windows where the node handling <code>tools/call</code> runs a different definition from the one that answered <code>tools/list</code>. </p> <div id="topology-rows"></div> <div class="topo-closing"> <p> <strong>Takeaway:</strong> Phased expand-and-contract schemas help with argument shape during rollouts, but cannot expose silent unit drift or calls prepared from stale startup caches. A definition reference could expose that the call was prepared before the confirmation UI was added. It would not prove that the client displayed the dialog. Because MCP is a transport-agnostic RPC protocol (including <code>stdio</code> without HTTP headers), traditional HTTP mechanisms like <code>ETag</code> and <code>If-Match</code> are not a direct fit: they describe a single HTTP resource representation rather than the tool or catalog definitions an RPC call depends on. </p> </div> </section> <!-- TAB 3: PROPOSED SOLUTION (LIST TAGS & COMPATIBILITY) --> <section class="tabpanel" id="panel-solution" role="tabpanel" aria-labelledby="tab-btn-solution" hidden> <div class="sol-lead"> <p> Add an opaque <code>tag</code> to cacheable list responses (such as <code>tools/list</code>) alongside <code>ttlMs</code> and <code>cacheScope</code>. When a client prepares a call, it keeps that tag and echoes it on <code>tools/call</code> — even if its local cache refreshes before the call is sent. </p> <p> Backwards compatibility comes from three server behaviors: reject before running, accept and signal stale, or ignore. </p> </div> <div class="sol-block"> <div class="sol-block-head"> <h2>Tag the list, echo it on the call</h2> <div class="segmented" role="radiogroup" aria-label="Server response mode"> <button type="button" role="radio" aria-checked="true" data-mode="reject">Reject before running</button> <button type="button" role="radio" aria-checked="false" data-mode="accept">Accept + signal stale</button> <button type="button" role="radio" aria-checked="false" data-mode="ignore">Ignore (legacy compat)</button> </div> </div> <p class="sol-intro" id="base-intro"></p> <div class="sol-diagram-wrap" id="base-svg-wrap"></div> <div class="outcomes-grid" aria-label="Server response semantics"> <div class="outcome-col"> <h3><span class="dot dot-warn"></span>Reject before running</h3> <p>When the server cannot safely honor the older definition, it rejects before side effects and echoes the client's stale tag (<code>L1</code>). The client refreshes, rebuilds, and decides whether to retry.</p> <p class="outcome-meta">error -32987 (illustrative) · data.staleTags</p> </div> <div class="outcome-col"> <h3><span class="dot dot-ok"></span>Accept + signal stale</h3> <p>When the server can still honor the call (compatible edit, shim, or unchanged tool), it runs once and echoes stale <code>L1</code> in result metadata so the client refreshes without repeating the call.</p> <p class="outcome-meta">result._meta.staleTags · do not replay</p> </div> <div class="outcome-col"> <h3><span class="dot dot-mute"></span>Ignore (backwards compat)</h3> <p>Older servers ignore unknown <code>_meta</code> keys, and servers may accept untagged calls from older clients (with no drift check). Whether servers must enforce supplied tags or may require them remains open.</p> <p class="outcome-meta">gradual adoption · enforcement policy open</p> </div> </div> <p class="drift-footnote"> <strong>Stateless subscription catch-up too:</strong> Sending known tags when opening <code>subscriptions/<wbr>listen</code> (at startup or after a rolling-deploy drain) also lets any stateless replica compare tags immediately and emit <code>list_changed</code> without session history &mdash; complementing call-time checks while an older stream is still draining. </p> <details class="wire-details"> <summary>+ Show illustrative wire JSON excerpts</summary> <p class="drift-footnote" style="margin-top:8px"><strong>Attribution:</strong> <code>resultType: "complete"</code>, <code>ttlMs</code>, and <code>cacheScope</code> are in the MCP caching draft. Highlighted fields (<code>tag</code>, <code>io.modelcontextprotocol/knownTags</code>, <code>staleTags</code>, <code>-32987</code>) are illustrative proposal spellings; exact wire layout remains open.</p> <div class="wire-grid" id="wire-excerpts-list"></div> </details> <div class="topo-closing"> <p> <strong>Next question:</strong> A list tag works with zero per-tool overhead, but in a 50+ tool PTC catalog, editing two tools changes the whole list tag. Open <strong>At scale: per-tool tags</strong> to see how per-tool tags isolate call verification at scale. </p> </div> </div> </section> <!-- TAB 4: AT SCALE (52-TOOL PTC CATALOG BLAST RADIUS) --> <section class="tabpanel" id="panel-scale" role="tabpanel" aria-labelledby="tab-btn-scale" hidden> <div class="sol-lead"> <p> With PTC (programmatic tool calling) or multi-service proxies, a single MCP server routinely exposes <strong>50+ tools</strong> across distinct capability groups. </p> <p> When one interrelated pair of tools changes, should a stateless server have to reject calls to the other 50 tools, or can it verify untouched tools independently? (Refreshing may still fetch the whole list &mdash; per-tool tags narrow call verification, not delta fetching.) </p> </div> <div class="sol-block"> <div class="sol-block-head"> <h2>Blast radius of a 2-tool edit in a 52-tool catalog</h2> <div class="segmented" role="radiogroup" aria-label="Tag granularity"> <button type="button" role="radio" aria-checked="true" data-gran="list">List tag only (L1 → L2)</button> <button type="button" role="radio" aria-checked="false" data-gran="prim">List + per-tool tags</button> </div> </div> <p class="sol-intro" id="scale-intro"></p> <div class="catalog-stage"> <div class="catalog-summary"> <div class="blast-stat" id="blast-stat"></div> <div class="legend-inline"> <span class="legend-item"><i class="swatch sw-bad"></i>Changed tools (2)</span> <span class="legend-item"><i class="swatch sw-warn"></i>Unknown without history</span> <span class="legend-item"><i class="swatch sw-ok"></i>Verified unchanged</span> </div> </div> <div class="groups-grid" id="groups-grid"></div> </div> <div class="tradeoff-grid"> <div class="tradeoff-col"> <h3>List tag only (box label)</h3> <p><strong>1 tag per list response</strong> (zero per-tool bytes on the wire). Changing 2 interrelated tools flips <code>L1 → L2</code> for all 52 tools.</p> <p>A stateless replica cannot tell which of the 52 tools changed; avoiding false rejections on the other 50 tools requires a server-side history or diff index for <code>L1</code>.</p> </div> <div class="tradeoff-col"> <h3>List + per-tool tags</h3> <p><strong>+1 tag per listed tool</strong> (and the invoked tool's tag echoed on <code>tools/call</code>). Changing the 2 interrelated tools only changes those 2 tags.</p> <p>Any stateless replica with deterministic tags verifies the other 50 untouched tools directly (<code>tag = tag</code>) with no old catalog lookup, while <code>L1 ≠ L2</code> still signals a lazy refresh for additions or removals.</p> </div> </div> <details class="wire-details"> <summary>+ Show illustrative per-tool wire JSON excerpts</summary> <p class="drift-footnote" style="margin-top:8px"><strong>Attribution:</strong> <code>resultType: "complete"</code>, <code>ttlMs</code>, and <code>cacheScope</code> are in the MCP caching draft. Highlighted fields (<code>tag</code>, <code>io.modelcontextprotocol/knownTags</code>, <code>io.modelcontextprotocol/primitiveTag</code>) are illustrative proposal spellings; exact wire layout remains open.</p> <div class="wire-grid" id="wire-excerpts-scale"></div> </details> <div class="topo-closing"> <p> <strong>Groups, instructions &amp; compatible edits:</strong> Per-tool tags verify an unchanged tool definition without history, but do not verify whether <code>server/discover</code> or group instructions changed, and do not provide delta fetching. Group tags (if tools are discovered by group) version a whole group together rather than individual tools, and need per-group identity. Neither replaces server-side compatibility logic when a <em>changed</em> tool must keep honoring older callers (<a href="versioning-scope-decision.md"><code>versioning-scope-decision.md</code></a>). </p> </div> </div> </section> </div> <script> (function () { var EXAMPLES = { minimal: { drift: { unit: { clientDescHtml: 'Read <code>v1</code> description (fresh within <code>ttlMs</code> or reused at startup): <code>combine(a, b)</code> returns <strong>a + b</strong>.', clientCode: 'Intent: 10 + 4 = 14', clientAmber: false, wireCode: 'combine(a: 10, b: 4)', wireDescHtml: '<code>inputSchema</code> checks two numbers <code>a</code> and <code>b</code>. Both satisfy validation; no field identifies <code>v1</code>.', serverAmber: false, serverVerdict: 'Silent behavior mismatch', serverDescHtml: '<code>v2</code> changed <code>combine</code> to return <strong>a &minus; b</strong> with the same schema. Validation passes; client expects <strong>14</strong> and receives <strong>6</strong>.' }, metadata: { clientDescHtml: 'Cached <code>v1</code> definition had no <code>_meta.ui</code> confirmation dialog. Client prepares and sends the call directly.', clientCode: 'Prepared before confirmation UI existed', clientAmber: false, wireCode: 'combine(a: 10, b: 4)', wireDescHtml: '<code>inputSchema</code> did not change in <code>v2</code>. The request payload looks identical whether UI metadata was added or not.', serverAmber: false, serverVerdict: 'Prepared without v2 UI metadata', serverDescHtml: '<code>v2</code> added <code>_meta.ui</code> without changing <code>inputSchema</code>. The call runs without the client ever seeing <code>v2</code>.' }, approval: { clientDescHtml: 'Builds <code>combine(10, 4)</code> expecting <strong>14</strong> (<code>a + b</code>) and pauses for approval. While waiting, a background refresh updates the cache to <code>v2</code> (<code>a &minus; b</code>).', clientCode: 'Cache is now v2 · Prepared call still v1', clientAmber: true, wireCode: 'combine(a: 10, b: 4)', wireDescHtml: 'User clicks <strong>Approve</strong>. The already-prepared call fires &mdash; refreshing the cache did not rebuild the call.', serverAmber: true, serverVerdict: 'Stale call fires despite fresh cache', serverDescHtml: 'Even though the client cache holds <code>v2</code>, the approved payload still reflects <code>v1</code> and returns <strong>6</strong> instead of <strong>14</strong>.' } }, topo: { callMono: 'combine(a: 10, b: 4)', v1Short: 'v1: returns a + b', v2Short: 'v2: returns a − b', singleServerLine: 'Evaluates 10 − 4 and returns 6 (expected 14)', podALine: 'Advertises v1: combine (returns a + b)', podBLine: 'Executes v2: combine (returns a − b)', podBOutcome: 'Same inputs, different operation', rollingWhyHard: 'A refresh can hit A again. If the next call hits B, the inputs still validate while running the new behavior.', backendAHeader: 'Backend A (formatting)', backendAOwns: 'Owns: format_number (v1, unchanged)', backendBHeader: 'Backend B (arithmetic)', backendBOwns: 'Owns: combine → deployed v2 (a − b)' } }, hf: { drift: { unit: { clientDescHtml: 'Read <code>v1</code> description (fresh within <code>ttlMs</code> or reused at startup): <code>timeout</code> is in <strong>minutes</strong>.', clientCode: 'Intent: 30-minute training job', clientAmber: false, wireCode: 'hf_job_run(timeout: 30)', wireDescHtml: '<code>inputSchema</code> checks <code>timeout: number</code>. <code>30</code> satisfies validation; no field identifies <code>v1</code>.', serverAmber: false, serverVerdict: 'Silent unit mismatch', serverDescHtml: '<code>v2</code> updated <code>timeout</code> to <strong>seconds</strong>. Validation passes; a <strong>30-minute</strong> job is killed after <strong>30 seconds</strong>.' }, metadata: { clientDescHtml: 'Cached <code>v1</code> definition had no <code>_meta.ui</code> spend-confirmation dialog. Client prepares and sends the call directly.', clientCode: 'Prepared before spend UI existed', clientAmber: false, wireCode: 'hf_job_run(flavor: "a100-large", script: "eval.py")', wireDescHtml: '<code>inputSchema</code> did not change in <code>v2</code>. The request payload looks identical whether a dialog was defined or not.', serverAmber: false, serverVerdict: 'Prepared without v2 UI metadata', serverDescHtml: '<code>v2</code> added a <code>_meta.ui</code> spend-confirmation dialog without changing <code>inputSchema</code>. Paid GPU job runs without seeing <code>v2</code>.' }, approval: { clientDescHtml: 'Builds <code>timeout: 30</code> (<strong>30 min</strong>) and pauses for approval. While waiting, a background refresh updates the local cache to <code>v2</code> (<strong>seconds</strong>).', clientCode: 'Cache is now v2 · Prepared call still v1', clientAmber: true, wireCode: 'hf_job_run(timeout: 30)', wireDescHtml: 'User clicks <strong>Approve</strong>. The already-prepared call fires with <code>30</code> &mdash; refreshing the cache did not rebuild the call.', serverAmber: true, serverVerdict: 'Stale call fires despite fresh cache', serverDescHtml: 'Even though the client cache holds <code>v2</code>, the approved payload still reflects <code>v1</code> and runs with a <strong>30-second</strong> timeout.' } }, topo: { callMono: 'hf_job_run(timeout: 30)', v1Short: 'v1: timeout in minutes', v2Short: 'v2: timeout in seconds', singleServerLine: 'Interprets timeout: 30 as 30 seconds', podALine: 'Advertises v1: hf_job_run (minutes)', podBLine: 'Executes v2: hf_job_run (seconds)', podBOutcome: 'Same number, different timeout', rollingWhyHard: 'A refresh can hit A again. If the next call hits B, the number still validates with the wrong unit.', backendAHeader: 'Backend A (catalog)', backendAOwns: 'Owns: hf_models_search (v1, unchanged)', backendBHeader: 'Backend B (compute / billing)', backendBOwns: 'Owns: hf_job_run → deployed v2 (seconds + UI)' } }, db: { drift: { unit: { clientDescHtml: 'Read <code>v1</code> schema (fresh within <code>ttlMs</code> or reused at startup): <code>create_instance</code> lists supported Postgres versions up to <strong>POSTGRES_18</strong>.', clientCode: 'Intent: latest Postgres (saw up to 18)', clientAmber: false, wireCode: 'create_instance("POSTGRES_18")', wireDescHtml: '<code>"POSTGRES_18"</code> is still a valid enum value in <code>v2</code>. Validation passes; no field identifies <code>v1</code>.', serverAmber: false, serverVerdict: 'Silent stale choice', serverDescHtml: '<code>v2</code> rolled out <strong>POSTGRES_19</strong> in the schema enum. Validation passes; the server provisions <strong>Postgres 18</strong> and cannot tell the model never saw <strong>Postgres 19</strong>.' }, metadata: { clientDescHtml: 'Cached <code>v1</code> definition had no <code>_meta.ui</code> provisioning confirmation dialog. Client prepares and sends the call directly.', clientCode: 'Prepared before confirmation UI existed', clientAmber: false, wireCode: 'create_instance("POSTGRES_18")', wireDescHtml: '<code>inputSchema</code> did not change in <code>v2</code>. The request payload looks identical whether a dialog was defined or not.', serverAmber: false, serverVerdict: 'Prepared without v2 UI metadata', serverDescHtml: '<code>v2</code> added a <code>_meta.ui</code> provisioning confirmation dialog without changing <code>inputSchema</code>. Instance provisioning runs without seeing <code>v2</code>.' }, approval: { clientDescHtml: 'Builds <code>database_version: "POSTGRES_18"</code> ("latest Postgres") and pauses for approval. While waiting, a background refresh updates the cache to <code>v2</code> (adds <strong>POSTGRES_19</strong>).', clientCode: 'Cache is now v2 · Prepared call still v1', clientAmber: true, wireCode: 'create_instance("POSTGRES_18")', wireDescHtml: 'User clicks <strong>Approve</strong>. The already-prepared call fires with <code>"POSTGRES_18"</code> &mdash; refreshing the cache did not rebuild the call.', serverAmber: true, serverVerdict: 'Stale call fires despite fresh cache', serverDescHtml: 'Even though the client cache holds <code>v2</code> with <strong>POSTGRES_19</strong>, the approved payload still reflects <code>v1</code> and provisions <strong>Postgres 18</strong>.' } }, topo: { callMono: 'create_instance("POSTGRES_18")', v1Short: 'v1: Postgres up to POSTGRES_18', v2Short: 'v2: adds POSTGRES_19', singleServerLine: 'Provisions Postgres 18 (valid enum in v2)', podALine: 'Advertises v1: create_instance (≤ PG 18)', podBLine: 'Executes v2: create_instance (≤ PG 19)', podBOutcome: 'Valid enum, stale "latest" choice', rollingWhyHard: 'A refresh can hit A again. If the next call hits B, "POSTGRES_18" still validates even though B supports POSTGRES_19.', backendAHeader: 'Backend A (inventory)', backendAOwns: 'Owns: list_instances (v1, unchanged)', backendBHeader: 'Backend B (provisioning)', backendBOwns: 'Owns: create_instance → deployed v2 (+ PG 19)' } } }; var SOL_DATA = { minimal: { changedTool: 'combine', changedCall: 'combine(10, 4)', changedEdit: 'v1 (a + b) → v2 (a − b)', changedSafeNote: 'Blocks 10 − 4 = 6 (expected 14)', unchangedTool: 'format_number', t1: 'F1', t2old: 'C1', t2new: 'C2', scaleIntro: 'Two interrelated tools in <strong>Core arithmetic</strong> (<code>combine</code> and <code>combine_batch</code>) changed from <code>a + b</code> to <code>a − b</code>. The other 50 tools across 5 groups are untouched.', groups: [ { name: 'Core arithmetic', count: 6, changed: ['combine', 'combine_batch'], sample: ['add', 'sub', 'mul', 'div'] }, { name: 'Formatting', count: 9, changed: [], sample: ['format_number', 'round', 'pad'] }, { name: 'Strings & parsing', count: 10, changed: [], sample: ['split', 'trim', 'match'] }, { name: 'Dates & time', count: 9, changed: [], sample: ['now', 'diff', 'tz'] }, { name: 'Collections', count: 9, changed: [], sample: ['sort', 'filter', 'map'] }, { name: 'Encoding', count: 9, changed: [], sample: ['b64', 'hash', 'json'] } ] }, hf: { changedTool: 'hf_job_run', changedCall: 'hf_job_run(timeout: 30)', changedEdit: 'v1 (minutes) → v2 (seconds)', changedSafeNote: 'Blocks 30s timeout (meant 30m)', unchangedTool: 'hf_models_search', t1: 'M1', t2old: 'J1', t2new: 'J2', scaleIntro: 'In a 52-tool Hugging Face PTC catalog, two interrelated tools in <strong>Jobs &amp; Compute</strong> (<code>hf_job_run</code> and <code>hf_job_schedule</code>) switch <code>timeout</code> from minutes to seconds. The other 50 tools across Discovery, Repos, Sandboxes, Datasets, and Spaces are untouched.', groups: [ { name: 'Jobs & Compute', count: 7, changed: ['hf_job_run', 'hf_job_schedule'], sample: ['hf_jobs_list', 'hf_job_logs', 'hf_job_get'] }, { name: 'Discovery & Search', count: 10, changed: [], sample: ['hf_models_search', 'hf_trending', 'hf_hub_lookup'] }, { name: 'Repos & Files', count: 9, changed: [], sample: ['hf_repo_info', 'hf_repo_write', 'hf_repo_read'] }, { name: 'Sandboxes', count: 7, changed: [], sample: ['hf_sandbox_create', 'hf_sandbox_exec', 'hf_sandbox_kill'] }, { name: 'Datasets & Papers', count: 8, changed: [], sample: ['hf_dataset_rows', 'hf_papers_search', 'hf_daily_papers'] }, { name: 'People & Spaces', count: 11, changed: [], sample: ['hf_spaces_list', 'hf_profile_get', 'hf_space_invoke'] } ] }, db: { changedTool: 'create_instance', changedCall: 'create_instance("POSTGRES_18")', changedEdit: 'v1 (≤ PG 18) → v2 (+ PG 19)', changedSafeNote: 'Blocks PG 18 before model sees PG 19', unchangedTool: 'list_instances', t1: 'I1', t2old: 'C1', t2new: 'C2', scaleIntro: 'In a 52-tool Database Toolbox catalog, two interrelated tools in <strong>Provisioning</strong> (<code>create_instance</code> and <code>clone_instance</code>) add <code>POSTGRES_19</code> to their version enum. The other 50 tools across Inventory, Queries, Schema, Backups, and Monitoring are untouched.', groups: [ { name: 'Provisioning', count: 7, changed: ['create_instance', 'clone_instance'], sample: ['resize_instance', 'restart_instance', 'promote_replica'] }, { name: 'Inventory & Users', count: 9, changed: [], sample: ['list_instances', 'get_instance', 'list_users'] }, { name: 'Queries & Plans', count: 10, changed: [], sample: ['execute_sql', 'explain_query', 'list_active_tx'] }, { name: 'Schema & Tables', count: 9, changed: [], sample: ['list_tables', 'describe_table', 'list_indexes'] }, { name: 'Backups & Restore', count: 8, changed: [], sample: ['list_backups', 'create_backup', 'pitr_status'] }, { name: 'Monitoring & Logs', count: 9, changed: [], sample: ['query_insights', 'slow_logs', 'cpu_metrics'] } ] } }; var state = { example: 'hf', tab: 'problem', drift: 'unit', mode: 'reject', gran: 'list' }; /* Initialize from URL query parameters (?tab=problem|topologies&ex=hf|db) */ try { var params = new URLSearchParams(window.location.search); var qTab = params.get('tab'); var qEx = params.get('ex'); var qDrift = params.get('drift'); if (qTab === 'problem' || qTab === 'topologies' || qTab === 'solution' || qTab === 'scale') { state.tab = qTab; } var qMode = params.get('mode'); if (qMode === 'reject' || qMode === 'accept' || qMode === 'ignore') state.mode = qMode; var qGran = params.get('gran'); if (qGran === 'list' || qGran === 'prim') state.gran = qGran; if (qEx === 'minimal' || qEx === 'hf' || qEx === 'db') { state.example = qEx; } if (qDrift === 'unit' || qDrift === 'metadata' || qDrift === 'approval') { state.drift = qDrift; } } catch (_) {} function syncUrlParams() { try { var url = new URL(window.location.href); url.searchParams.set('tab', state.tab); url.searchParams.set('ex', state.example); window.history.replaceState(null, '', url.toString()); } catch (_) {} } function esc(str) { return String(str) .replace(/&/g, '&amp;') .replace(/</g, '&lt;') .replace(/>/g, '&gt;') .replace(/"/g, '&quot;'); } function renderSingleServerSvg(t) { return ( '<svg viewBox="0 0 1024 192" role="img" aria-label="In-place deploy diagram: Client holds cached v1 list while single server updates in place to v2">' + '<defs>' + '<marker id="arr-list-s1" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="6" markerHeight="6" orient="auto">' + '<path d="M 0 1.5 L 8.5 5 L 0 8.5 z" fill="#1D4ED8"/>' + '</marker>' + '<marker id="arr-call-s1" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="6" markerHeight="6" orient="auto">' + '<path d="M 0 1.5 L 8.5 5 L 0 8.5 z" fill="#B91C1C"/>' + '</marker>' + '</defs>' + /* Client [12..332] */ '<rect x="12" y="22" width="320" height="148" rx="5" fill="#FFFFFF" stroke="#CBD5E1" stroke-width="1.2"/>' + '<line x1="12" y1="58" x2="332" y2="58" stroke="#E2E8F0" stroke-width="1"/>' + '<text x="26" y="45" font-family="Inter, sans-serif" font-size="13.5" font-weight="600" fill="#0F172A">Client <tspan font-weight="400" fill="#475569">(TTL or startup cache)</tspan></text>' + '<text x="26" y="84" font-family="Inter, sans-serif" font-size="13" fill="#334155">Holds ' + esc(t.v1Short) + '</text>' + '<text x="26" y="111" font-family="JetBrains Mono, monospace" font-size="13" font-weight="500" fill="#0F172A">' + esc(t.callMono) + '</text>' + '<text x="26" y="138" font-family="Inter, sans-serif" font-size="13" fill="#475569">Within ttlMs, or startup cache reused</text>' + /* Lanes between Client (332) and Server (648) */ '<path d="M 648 62 L 340 62" fill="none" stroke="#1D4ED8" stroke-width="1.6" stroke-dasharray="5 3" marker-end="url(#arr-list-s1)"/>' + '<text x="490" y="49" text-anchor="middle" font-family="Inter, sans-serif" font-size="13" font-weight="600" fill="#1D4ED8">① List response: v1</text>' + '<rect x="392" y="83" width="196" height="26" rx="13" fill="#FFFBEB" stroke="#FCD34D" stroke-width="1"/>' + '<text x="490" y="100" text-anchor="middle" font-family="Inter, sans-serif" font-size="12.5" font-weight="600" fill="#B45309">Deploy replaces v1 → v2</text>' + '<path d="M 332 134 L 640 134" fill="none" stroke="#B91C1C" stroke-width="1.75" marker-end="url(#arr-call-s1)"/>' + '<text x="490" y="154" text-anchor="middle" font-family="Inter, sans-serif" font-size="13" font-weight="600" fill="#B91C1C">② Later tools/call</text>' + /* Single Server [648..1012] */ '<rect x="648" y="22" width="364" height="148" rx="5" fill="#FFFFFF" stroke="#FCA5A5" stroke-width="1.2"/>' + '<line x1="648" y1="58" x2="1012" y2="58" stroke="#E2E8F0" stroke-width="1"/>' + '<text x="662" y="45" font-family="Inter, sans-serif" font-size="13.5" font-weight="600" fill="#0F172A">Single server <tspan font-weight="400" fill="#475569">(updated in place)</tspan></text>' + '<text x="662" y="84" font-family="Inter, sans-serif" font-size="13" fill="#334155">Now serves ' + esc(t.v2Short) + '</text>' + '<text x="662" y="111" font-family="Inter, sans-serif" font-size="13" fill="#334155">' + esc(t.singleServerLine) + '</text>' + '<text x="662" y="138" font-family="Inter, sans-serif" font-size="13" font-weight="500" fill="#B91C1C">Arguments pass v2 validation</text>' + '</svg>' ); } function renderRollingLbSvg(t) { return ( '<svg viewBox="0 0 1024 230" role="img" aria-label="Rolling deploy diagram: Client lists v1 from Pod A through a load balancer, then call hits Pod B running v2">' + '<defs>' + '<marker id="arr-list-s2" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="6" markerHeight="6" orient="auto">' + '<path d="M 0 1.5 L 8.5 5 L 0 8.5 z" fill="#1D4ED8"/>' + '</marker>' + '<marker id="arr-call-s2" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="6" markerHeight="6" orient="auto">' + '<path d="M 0 1.5 L 8.5 5 L 0 8.5 z" fill="#B91C1C"/>' + '</marker>' + '</defs>' + /* Client [12..288] */ '<rect x="12" y="44" width="276" height="140" rx="5" fill="#FFFFFF" stroke="#CBD5E1" stroke-width="1.2"/>' + '<line x1="12" y1="80" x2="288" y2="80" stroke="#E2E8F0" stroke-width="1"/>' + '<text x="26" y="67" font-family="Inter, sans-serif" font-size="13.5" font-weight="600" fill="#0F172A">Client</text>' + '<text x="26" y="105" font-family="Inter, sans-serif" font-size="13" fill="#334155">Discovered v1 from Pod A</text>' + '<text x="26" y="131" font-family="JetBrains Mono, monospace" font-size="13" font-weight="500" fill="#0F172A">' + esc(t.callMono) + '</text>' + '<text x="26" y="157" font-family="Inter, sans-serif" font-size="13" fill="#475569">Refresh may hit Pod A (v1) again</text>' + /* Load balancer [424..544] */ '<rect x="424" y="72" width="120" height="84" rx="5" fill="#FFFFFF" stroke="#CBD5E1" stroke-width="1.2"/>' + '<text x="484" y="108" text-anchor="middle" font-family="Inter, sans-serif" font-size="13.5" font-weight="600" fill="#0F172A">Load balancer</text>' + '<text x="484" y="130" text-anchor="middle" font-family="Inter, sans-serif" font-size="13" fill="#475569">Stateless hop</text>' + /* Zero-crossing lanes: top = Pod A -> LB -> Client (list v1); bottom = Client -> LB -> Pod B (call) */ '<path d="M 624 58 C 580 58, 572 96, 544 96" fill="none" stroke="#1D4ED8" stroke-width="1.6" stroke-dasharray="5 3" marker-end="url(#arr-list-s2)"/>' + '<path d="M 424 96 L 296 96" fill="none" stroke="#1D4ED8" stroke-width="1.6" stroke-dasharray="5 3" marker-end="url(#arr-list-s2)"/>' + '<text x="356" y="84" text-anchor="middle" font-family="Inter, sans-serif" font-size="13" font-weight="600" fill="#1D4ED8">① v1 list</text>' + '<path d="M 288 130 L 418 130" fill="none" stroke="#B91C1C" stroke-width="1.75" marker-end="url(#arr-call-s2)"/>' + '<path d="M 544 130 C 576 130, 584 169, 618 169" fill="none" stroke="#B91C1C" stroke-width="1.75" marker-end="url(#arr-call-s2)"/>' + '<text x="356" y="150" text-anchor="middle" font-family="Inter, sans-serif" font-size="13" font-weight="600" fill="#B91C1C">② tools/call</text>' + /* Pod A (v1) [624..1012] */ '<rect x="624" y="12" width="388" height="94" rx="5" fill="#FFFFFF" stroke="#CBD5E1" stroke-width="1.2"/>' + '<line x1="624" y1="45" x2="1012" y2="45" stroke="#E2E8F0" stroke-width="1"/>' + '<text x="638" y="34" font-family="Inter, sans-serif" font-size="13.5" font-weight="600" fill="#0F172A">Pod A (v1) <tspan font-weight="400" fill="#475569">(older replica)</tspan></text>' + '<text x="638" y="68" font-family="Inter, sans-serif" font-size="13" fill="#334155">' + esc(t.podALine) + '</text>' + '<text x="638" y="91" font-family="Inter, sans-serif" font-size="13" fill="#475569">Still returns v1 if client refreshes</text>' + /* Pod B (v2) [624..1012] */ '<rect x="624" y="122" width="388" height="96" rx="5" fill="#FFFFFF" stroke="#FCA5A5" stroke-width="1.2"/>' + '<line x1="624" y1="155" x2="1012" y2="155" stroke="#E2E8F0" stroke-width="1"/>' + '<text x="638" y="144" font-family="Inter, sans-serif" font-size="13.5" font-weight="600" fill="#0F172A">Pod B (v2) <tspan font-weight="400" fill="#475569">(updated replica)</tspan></text>' + '<text x="638" y="178" font-family="Inter, sans-serif" font-size="13" fill="#334155">' + esc(t.podBLine) + '</text>' + '<text x="638" y="201" font-family="Inter, sans-serif" font-size="13" font-weight="500" fill="#B91C1C">' + esc(t.podBOutcome) + '</text>' + '</svg>' ); } function renderGatewaySvg(t) { return ( '<svg viewBox="0 0 1024 230" role="img" aria-label="Multi-backend gateway diagram: Gateway serves merged v1 list while Backend B independently deploys v2">' + '<defs>' + '<marker id="arr-list-s3" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="6" markerHeight="6" orient="auto">' + '<path d="M 0 1.5 L 8.5 5 L 0 8.5 z" fill="#1D4ED8"/>' + '</marker>' + '<marker id="arr-call-s3" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="6" markerHeight="6" orient="auto">' + '<path d="M 0 1.5 L 8.5 5 L 0 8.5 z" fill="#B91C1C"/>' + '</marker>' + '</defs>' + /* Client [12..276] */ '<rect x="12" y="44" width="264" height="140" rx="5" fill="#FFFFFF" stroke="#CBD5E1" stroke-width="1.2"/>' + '<line x1="12" y1="80" x2="276" y2="80" stroke="#E2E8F0" stroke-width="1"/>' + '<text x="26" y="67" font-family="Inter, sans-serif" font-size="13.5" font-weight="600" fill="#0F172A">Client</text>' + '<text x="26" y="105" font-family="Inter, sans-serif" font-size="13" fill="#334155">Holds merged v1 catalog</text>' + '<text x="26" y="131" font-family="JetBrains Mono, monospace" font-size="13" font-weight="500" fill="#0F172A">' + esc(t.callMono) + '</text>' + '<text x="26" y="157" font-family="Inter, sans-serif" font-size="13" fill="#475569">Sees one unified MCP endpoint</text>' + /* Gateway [406..568] */ '<rect x="406" y="56" width="162" height="114" rx="5" fill="#FFFFFF" stroke="#CBD5E1" stroke-width="1.2"/>' + '<line x1="406" y1="90" x2="568" y2="90" stroke="#E2E8F0" stroke-width="1"/>' + '<text x="487" y="78" text-anchor="middle" font-family="Inter, sans-serif" font-size="13.5" font-weight="600" fill="#0F172A">Proxy / gateway</text>' + '<text x="487" y="114" text-anchor="middle" font-family="Inter, sans-serif" font-size="13" fill="#334155">Caches upstream lists</text>' + '<text x="487" y="138" text-anchor="middle" font-family="Inter, sans-serif" font-size="12.5" font-weight="600" fill="#B45309">Still advertises v1</text>' + /* Client <-> Gateway lanes */ '<path d="M 406 96 L 284 96" fill="none" stroke="#1D4ED8" stroke-width="1.6" stroke-dasharray="5 3" marker-end="url(#arr-list-s3)"/>' + '<text x="341" y="84" text-anchor="middle" font-family="Inter, sans-serif" font-size="13" font-weight="600" fill="#1D4ED8">① v1 list</text>' + '<path d="M 276 132 L 400 132" fill="none" stroke="#B91C1C" stroke-width="1.75" marker-end="url(#arr-call-s3)"/>' + '<text x="341" y="152" text-anchor="middle" font-family="Inter, sans-serif" font-size="13" font-weight="600" fill="#B91C1C">② tools/call</text>' + /* Gateway -> Backends */ '<path d="M 568 86 C 598 86, 606 58, 634 58" fill="none" stroke="#94A3B8" stroke-width="1.4" stroke-dasharray="4 3"/>' + '<path d="M 568 136 C 598 136, 606 169, 628 169" fill="none" stroke="#B91C1C" stroke-width="1.75" marker-end="url(#arr-call-s3)"/>' + /* Backend A [634..1012] */ '<rect x="634" y="12" width="378" height="94" rx="5" fill="#FFFFFF" stroke="#CBD5E1" stroke-width="1.2"/>' + '<line x1="634" y1="45" x2="1012" y2="45" stroke="#E2E8F0" stroke-width="1"/>' + '<text x="648" y="34" font-family="Inter, sans-serif" font-size="13.5" font-weight="600" fill="#0F172A">' + esc(t.backendAHeader) + ' <tspan font-weight="400" fill="#475569">(v1)</tspan></text>' + '<text x="648" y="68" font-family="Inter, sans-serif" font-size="13" fill="#334155">' + esc(t.backendAOwns) + '</text>' + '<text x="648" y="91" font-family="Inter, sans-serif" font-size="13" fill="#475569">Independent release cadence</text>' + /* Backend B [634..1012] */ '<rect x="634" y="122" width="378" height="96" rx="5" fill="#FFFFFF" stroke="#FCA5A5" stroke-width="1.2"/>' + '<line x1="634" y1="155" x2="1012" y2="155" stroke="#E2E8F0" stroke-width="1"/>' + '<text x="648" y="144" font-family="Inter, sans-serif" font-size="13.5" font-weight="600" fill="#0F172A">' + esc(t.backendBHeader) + ' <tspan font-weight="400" fill="#475569">(v2)</tspan></text>' + '<text x="648" y="178" font-family="Inter, sans-serif" font-size="13" fill="#334155">' + esc(t.backendBOwns) + '</text>' + '<text x="648" y="201" font-family="Inter, sans-serif" font-size="13" font-weight="500" fill="#B91C1C">Gateway advertises v1; client uses v1</text>' + '</svg>' ); } function renderBaseSvg(ex, mode) { var isReject = mode === 'reject'; var isAccept = mode === 'accept'; var replyColor = isReject ? '#B91C1C' : isAccept ? '#15803D' : '#475569'; var replyBg = isReject ? '#FEF2F2' : isAccept ? '#F0FDF4' : '#F8FAFC'; var replyBd = isReject ? '#FCA5A5' : isAccept ? '#86EFAC' : '#CBD5E1'; var replyArrowLabel = isReject ? '③ error -32987 · staleTags: { "tools/list": "L1" }' : isAccept ? '③ result + staleTags: { "tools/list": "L1" }' : '③ result (unknown _meta ignored)'; var serverLine1 = isReject ? 'Sees L1 ≠ L2 · cannot honor v1 safely' : isAccept ? 'Sees L1 ≠ L2 · honors call (shim or compatible)' : 'Ignores unknown _meta (legacy server)'; var serverLine2 = isReject ? ex.changedSafeNote : isAccept ? 'Runs once; flags L1 stale for next turn' : 'Runs as today — no drift protection'; var serverFooter = (isReject || isAccept) ? 'Echoes client\'s stale L1 (illustrative)' : 'Does not check or echo tags'; var clientFooter = isReject ? 'Did not run → refreshes L2, rebuilds call' : isAccept ? 'Already ran → refreshes L2, does not replay' : 'Legacy behavior preserved'; return ( '<svg viewBox="0 0 960 206" role="img" aria-label="List tag flow showing discovery, echoed knownTags, and server response">' + '<defs>' + '<marker id="a-blue" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="6" markerHeight="6" orient="auto"><path d="M 0 1.5 L 8.5 5 L 0 8.5 z" fill="#1D4ED8"/></marker>' + '<marker id="a-ink" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="6" markerHeight="6" orient="auto"><path d="M 0 1.5 L 8.5 5 L 0 8.5 z" fill="#0F172A"/></marker>' + '<marker id="a-rep" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="6" markerHeight="6" orient="auto"><path d="M 0 1.5 L 8.5 5 L 0 8.5 z" fill="' + replyColor + '"/></marker>' + '</defs>' + '<rect x="10" y="16" width="286" height="174" rx="5" fill="#FFFFFF" stroke="#CBD5E1" stroke-width="1.2"/>' + '<line x1="10" y1="50" x2="296" y2="50" stroke="#E2E8F0" stroke-width="1"/>' + '<text x="24" y="38" font-family="Inter, sans-serif" font-size="13.5" font-weight="600" fill="#0F172A">Client <tspan font-weight="400" fill="#475569">(cached list L1)</tspan></text>' + '<text x="24" y="76" font-family="Inter, sans-serif" font-size="12.5" fill="#334155">Prepared call from L1:</text>' + '<text x="24" y="99" font-family="JetBrains Mono, monospace" font-size="12.5" font-weight="500" fill="#0F172A">' + esc(ex.changedCall) + '</text>' + '<text x="24" y="124" font-family="Inter, sans-serif" font-size="12.5" fill="#475569">Keeps L1 attached to this call</text>' + '<rect x="22" y="144" width="262" height="32" rx="4" fill="' + replyBg + '" stroke="' + replyBd + '" stroke-width="1"/>' + '<text x="32" y="164" font-family="Inter, sans-serif" font-size="12" font-weight="500" fill="' + replyColor + '">' + esc(clientFooter) + '</text>' + '<path d="M 654 48 L 304 48" fill="none" stroke="#1D4ED8" stroke-width="1.5" stroke-dasharray="5 3" marker-end="url(#a-blue)"/>' + '<text x="475" y="36" text-anchor="middle" font-family="Inter, sans-serif" font-size="12.5" font-weight="600" fill="#1D4ED8">① tools/list → tag: "L1", ttlMs: 300000</text>' + '<path d="M 296 104 L 646 104" fill="none" stroke="#0F172A" stroke-width="1.6" marker-end="url(#a-ink)"/>' + '<text x="475" y="92" text-anchor="middle" font-family="Inter, sans-serif" font-size="12.5" font-weight="600" fill="#0F172A">② tools/call + knownTags: { "tools/list": "L1" }</text>' + '<path d="M 654 158 L 304 158" fill="none" stroke="' + replyColor + '" stroke-width="1.75" marker-end="url(#a-rep)"/>' + '<text x="475" y="146" text-anchor="middle" font-family="Inter, sans-serif" font-size="12.5" font-weight="600" fill="' + replyColor + '">' + esc(replyArrowLabel) + '</text>' + '<rect x="654" y="16" width="296" height="174" rx="5" fill="#FFFFFF" stroke="' + replyBd + '" stroke-width="1.2"/>' + '<line x1="654" y1="50" x2="950" y2="50" stroke="#E2E8F0" stroke-width="1"/>' + '<text x="668" y="38" font-family="Inter, sans-serif" font-size="13.5" font-weight="600" fill="#0F172A">Server <tspan font-weight="400" fill="#475569">(now list L2)</tspan></text>' + '<text x="668" y="76" font-family="Inter, sans-serif" font-size="12.5" fill="#334155">Updated: ' + esc(ex.changedEdit) + '</text>' + '<text x="668" y="102" font-family="Inter, sans-serif" font-size="12.5" font-weight="600" fill="' + replyColor + '">' + esc(serverLine1) + '</text>' + '<text x="668" y="128" font-family="Inter, sans-serif" font-size="12" fill="#475569">' + esc(serverLine2) + '</text>' + '<text x="668" y="164" font-family="JetBrains Mono, monospace" font-size="11.5" fill="#475569">' + esc(serverFooter) + '</text>' + '</svg>' ); } function renderCatalogGrid(ex, gran) { var isPrim = gran === 'prim'; var statEl = document.getElementById('blast-stat'); if (isPrim) { statEl.className = 'blast-stat is-ok'; statEl.textContent = '2 of 52 tools invalidated · 50 untouched tools verified without history'; } else { statEl.className = 'blast-stat is-warn'; statEl.textContent = 'All 52 tools fall under stale L1 ≠ L2 · stateless server cannot tell which 2 changed'; } document.getElementById('groups-grid').innerHTML = ex.groups.map(function (g) { var hasChange = g.changed.length > 0; var grpClass = 'tool-group' + (hasChange ? ' has-change' : (!isPrim ? ' all-stale' : '')); var tiles = []; g.changed.forEach(function (name) { tiles.push('<span class="tile t-bad t-named" title="Changed in v2">' + esc(name) + '</span>'); }); var untouchedClass = isPrim ? 't-ok' : 't-warn'; var shownSample = g.sample.slice(0, hasChange ? 1 : 2); shownSample.forEach(function (name) { tiles.push('<span class="tile ' + untouchedClass + ' t-named" title="Unchanged in v2">' + esc(name) + '</span>'); }); var rest = g.count - g.changed.length - shownSample.length; for (var i = 0; i < rest; i++) { tiles.push('<span class="tile ' + untouchedClass + '" title="Unchanged tool">' + (isPrim ? '✓' : '?') + '</span>'); } var statusLabel = hasChange ? (g.changed.length + ' changed / ' + g.count) : (isPrim ? (g.count + ' verified') : (g.count + ' stale (L1)')); return ( '<div class="' + grpClass + '">' + '<div class="group-head">' + '<span class="group-name">' + esc(g.name) + '</span>' + '<span class="group-count">' + esc(statusLabel) + '</span>' + '</div>' + '<div class="tile-row">' + tiles.join('') + '</div>' + '</div>' ); }).join(''); } function renderWireList(ex, mode) { var callJson = '{\n "method": "tools/call",\n "params": {\n "name": "' + esc(ex.changedTool) + '",\n "arguments": { ... },\n "_meta": {\n <span class="hl">"io.modelcontextprotocol/knownTags": { "tools/list": "L1" }</span>\n }\n }\n}'; var respTitle, respJson; if (mode === 'reject') { respTitle = 'Server response: Reject before running'; respJson = '{\n "error": {\n <span class="hl">"code": -32987</span>, /* illustrative */\n "message": "Definitions changed; refresh before retrying.",\n "data": {\n <span class="hl">"staleTags": { "tools/list": "L1" }</span>\n }\n }\n}'; } else if (mode === 'accept') { respTitle = 'Server response: Accept + signal stale'; respJson = '{\n "result": {\n "resultType": "complete",\n "content": [ { "type": "text", "text": "Done." } ],\n "isError": false,\n "_meta": {\n <span class="hl">"io.modelcontextprotocol/staleTags": { "tools/list": "L1" }</span>\n }\n }\n}'; } else { respTitle = 'Server response: Ignore (legacy compat)'; respJson = '{\n "result": {\n "resultType": "complete",\n "content": [ { "type": "text", "text": "Done." } ],\n "isError": false\n } /* unknown _meta.knownTags ignored */\n}'; } return ( '<div class="wire-pane"><h4>tools/call request (excerpt)</h4><pre>' + callJson + '</pre></div>' + '<div class="wire-pane"><h4>' + respTitle + '</h4><pre>' + respJson + '</pre></div>' ); } function renderWireScale(ex, includePrim) { var listTitle = includePrim ? 'tools/list response (list + per-tool tags)' : 'tools/list response (list tag only)'; var callTitle = includePrim ? 'tools/call request (echoes list + tool tag)' : 'tools/call request (echoes list tag only)'; var listJson = includePrim ? '{\n "resultType": "complete",\n "ttlMs": 300000, "cacheScope": "private",\n <span class="hl">"tag": "L1"</span>,\n "tools": [\n { "name": "' + esc(ex.unchangedTool) + '", <span class="hl">"tag": "' + esc(ex.t1) + '"</span>, ... },\n { "name": "' + esc(ex.changedTool) + '", <span class="hl">"tag": "' + esc(ex.t2old) + '"</span>, ... }\n ]\n}' : '{\n "resultType": "complete",\n "ttlMs": 300000, "cacheScope": "private",\n <span class="hl">"tag": "L1"</span>,\n "tools": [\n { "name": "' + esc(ex.unchangedTool) + '", ... },\n { "name": "' + esc(ex.changedTool) + '", ... } /* no per-tool tags */\n ]\n}'; var callJson = includePrim ? '{\n "method": "tools/call",\n "params": {\n "name": "' + esc(ex.unchangedTool) + '",\n "arguments": { ... },\n "_meta": {\n <span class="hl">"io.modelcontextprotocol/knownTags": { "tools/list": "L1" }</span>,\n <span class="hl">"io.modelcontextprotocol/primitiveTag": "' + esc(ex.t1) + '"</span>\n }\n }\n}' : '{\n "method": "tools/call",\n "params": {\n "name": "' + esc(ex.unchangedTool) + '",\n "arguments": { ... },\n "_meta": {\n <span class="hl">"io.modelcontextprotocol/knownTags": { "tools/list": "L1" }</span>\n }\n }\n}'; return ( '<div class="wire-pane"><h4>' + listTitle + '</h4><pre>' + listJson + '</pre></div>' + '<div class="wire-pane"><h4>' + callTitle + '</h4><pre>' + callJson + '</pre></div>' ); } function render() { var ex = EXAMPLES[state.example]; /* Sync controls */ document.querySelectorAll('[data-example]').forEach(function (btn) { btn.setAttribute('aria-checked', String(btn.getAttribute('data-example') === state.example)); }); document.querySelectorAll('[data-tab]').forEach(function (btn) { var active = btn.getAttribute('data-tab') === state.tab; btn.setAttribute('aria-selected', String(active)); btn.tabIndex = active ? 0 : -1; }); document.getElementById('panel-problem').hidden = state.tab !== 'problem'; document.getElementById('panel-topologies').hidden = state.tab !== 'topologies'; document.getElementById('panel-solution').hidden = state.tab !== 'solution'; document.getElementById('panel-scale').hidden = state.tab !== 'scale'; document.querySelectorAll('[data-mode]').forEach(function (btn) { btn.setAttribute('aria-checked', String(btn.getAttribute('data-mode') === state.mode)); }); document.querySelectorAll('[data-gran]').forEach(function (btn) { btn.setAttribute('aria-checked', String(btn.getAttribute('data-gran') === state.gran)); }); document.querySelectorAll('[data-drift]').forEach(function (btn) { btn.setAttribute('aria-checked', String(btn.getAttribute('data-drift') === state.drift)); }); /* Tab 1: Silent drift flow */ var d = ex.drift[state.drift]; document.getElementById('d-client-desc').innerHTML = d.clientDescHtml; var clientCodeEl = document.getElementById('d-client-code'); clientCodeEl.textContent = d.clientCode; clientCodeEl.classList.toggle('is-amber', d.clientAmber); document.getElementById('d-wire-code').textContent = d.wireCode; document.getElementById('d-wire-desc').innerHTML = d.wireDescHtml; var serverBox = document.getElementById('d-server-box'); serverBox.classList.toggle('is-amber-mismatch', d.serverAmber); document.getElementById('d-server-verdict').textContent = d.serverVerdict; document.getElementById('d-server-desc').innerHTML = d.serverDescHtml; /* Tab 2: 3 topology rows */ var t = ex.topo; var topologies = [ { heading: '1. In-place deploy or stale startup cache', svg: renderSingleServerSvg(t), howItHappens: 'The client reuses a fresh list within <code>ttlMs</code> or invokes optimistically from a persisted startup list without re-checking, while the single server replaces <code>v1</code> with <code>v2</code> in place.', whyHard: 'Because <code>v1</code> is overwritten in place and arguments still pass <code>v2</code> schema validation, neither side sees that the contract changed.' }, { heading: '2. Rolling deploy behind a load balancer', svg: renderRollingLbSvg(t), howItHappens: '<code>tools/list</code> lands on Pod A (<code>v1</code>), and the subsequent <code>tools/call</code> routes to Pod B (<code>v2</code>) behind the same MCP endpoint &mdash; while any open <code>subscriptions/<wbr>listen</code> stream stays pinned to Pod A until connection drain.', whyHard: t.rollingWhyHard }, { heading: '3. MCP proxy or multi-backend gateway', svg: renderGatewaySvg(t), howItHappens: 'A proxy or gateway caches and merges tools from independent upstream services. Backend B deploys <code>v2</code> while the proxy still advertises <code>v1</code> and the client uses <code>v1</code>. After a rollback, the proxy can still advertise <code>v2</code> while B runs <code>v1</code>.', whyHard: 'Even a client with zero caching still gets <code>v1</code> from the proxy until the proxy refreshes Backend B, and Backend B cannot tell from valid arguments alone which definition the caller used.' } ]; var sol = SOL_DATA[state.example]; document.getElementById('base-intro').innerHTML = 'Client cached <code>L1</code>, server updated <code>' + esc(sol.changedTool) + '</code> (<code>' + esc(sol.changedEdit) + '</code>) to <code>L2</code>, and the client calls <code>' + esc(sol.changedCall) + '</code> echoing <code>L1</code>.'; document.getElementById('base-svg-wrap').innerHTML = renderBaseSvg(sol, state.mode); document.getElementById('wire-excerpts-list').innerHTML = renderWireList(sol, state.mode); document.getElementById('scale-intro').innerHTML = sol.scaleIntro; renderCatalogGrid(sol, state.gran); document.getElementById('wire-excerpts-scale').innerHTML = renderWireScale(sol, state.gran === 'prim'); document.getElementById('topology-rows').innerHTML = topologies.map(function (row) { return ( '<article class="topo-row">' + '<h2>' + row.heading + '</h2>' + '<div class="diagram-wrap">' + row.svg + '</div>' + '<div class="row-captions">' + '<p class="caption-item"><strong>How it happens:</strong> ' + row.howItHappens + '</p>' + '<p class="caption-item"><strong>Why refreshing falls short:</strong> ' + row.whyHard + '</p>' + '</div>' + '</article>' ); }).join(''); } /* Event bindings */ document.querySelectorAll('[data-example]').forEach(function (btn) { btn.addEventListener('click', function () { state.example = btn.getAttribute('data-example'); syncUrlParams(); render(); }); }); document.querySelectorAll('[data-drift]').forEach(function (btn) { btn.addEventListener('click', function () { state.drift = btn.getAttribute('data-drift'); render(); }); }); var tabButtons = Array.prototype.slice.call(document.querySelectorAll('[data-tab]')); tabButtons.forEach(function (btn, idx) { btn.addEventListener('click', function () { state.tab = btn.getAttribute('data-tab'); syncUrlParams(); render(); }); btn.addEventListener('keydown', function (e) { if (e.key === 'ArrowRight' || e.key === 'ArrowLeft') { e.preventDefault(); var next = tabButtons[(idx + (e.key === 'ArrowRight' ? 1 : tabButtons.length - 1)) % tabButtons.length]; state.tab = next.getAttribute('data-tab'); syncUrlParams(); render(); next.focus(); } }); }); document.querySelectorAll('[data-mode]').forEach(function (btn) { btn.addEventListener('click', function () { state.mode = btn.getAttribute('data-mode'); render(); }); }); document.querySelectorAll('[data-gran]').forEach(function (btn) { btn.addEventListener('click', function () { state.gran = btn.getAttribute('data-gran'); render(); }); }); render(); })(); </script> </body> </html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>MCP primitive versioning proposal</title>
<link rel="icon" href="data:,">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet">
<style>
:root {
--bg: #FFFFFF;
--surface: #F8FAFC;
--surface-subtle: #F1F5F9;
--ink: #0F172A;
--ink-secondary: #334155;
--mute: #475569;
--rule: #E2E8F0;
--rule-strong: #CBD5E1;
--accent: #1D4ED8;
--accent-tint: #EFF6FF;
--ok: #15803D;
--bad: #B91C1C;
--bad-tint: #FEF2F2;
--warn: #B45309;
--warn-tint: #FFFBEB;
--sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
--mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
/* Strict 3-size body scale below H1 */
--text-lg: 1.1875rem; /* 19px: section headings */
--text-body: 0.9375rem; /* 15px: all body prose, lists, item titles */
--text-sm: 0.8125rem; /* 13px: controls, code, notes, diagram text */
}
*, *::before, *::after {
box-sizing: border-box;
}
html {
background: var(--bg);
color: var(--ink);
scrollbar-gutter: stable;
}
body {
margin: 0;
font-family: var(--sans);
font-size: var(--text-body);
line-height: 1.55;
color: var(--ink);
-webkit-font-smoothing: antialiased;
}
a {
color: var(--accent);
text-decoration: underline;
text-decoration-color: rgba(29, 78, 216, 0.35);
text-underline-offset: 2px;
}
a:hover {
text-decoration-color: var(--accent);
}
code, pre {
font-family: var(--mono);
font-size: var(--text-sm);
}
code {
background: var(--surface-subtle);
color: var(--ink);
padding: 0.08em 0.32em;
border-radius: 3px;
}
a code {
color: inherit;
}
button {
font: inherit;
color: inherit;
background: none;
border: 0;
padding: 0;
cursor: pointer;
}
:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 2px;
border-radius: 4px;
}