Skip to content

Fix legacy initialize extension capability advertisements - #3775

Open
sambhav wants to merge 1 commit into
modelcontextprotocol:mainfrom
sambhav:fix/3773-legacy-extension-capabilities
Open

sambhav wants to merge 1 commit into
modelcontextprotocol:mainfrom
sambhav:fix/3773-legacy-extension-capabilities

Conversation

@sambhav

@sambhav sambhav commented Oct 27, 2026

Copy link
Copy Markdown
Member

Legacy initialize responses drop capabilities.extensions during wire serialization, preventing clients such as MCP Apps hosts from seeing the server's extension advertisement. Preserve the field on both legacy capability wire models, generated from a schema augmentation, across all four supported handshake versions.

Adds client and server round-trip coverage for empty advertisements and nested extension settings, updates the affected initialization snapshots, and corrects the extension documentation. Unknown capability fields retain their existing filtering behavior.

Validation: 6,255 tests passed with 100% branch coverage; strict-no-cover, Pyright, Ruff lint/format, and generated-model consistency checks passed. The full test run used cleared proxy environment variables to avoid the host's SOCKS proxy configuration affecting transport tests.

Fixes #3773.

AI-assisted implementation and validation with Codex.

Preserve capabilities.extensions in both legacy wire models and generated
schemas, with round-trip coverage for every supported handshake version.
Update extension documentation and affected initialization snapshots.

Fixes modelcontextprotocol#3773

AI-assisted implementation and validation with Codex.
@github-actions github-actions Bot added the missing-issue-link Auto-closed: PR needs a linked issue assigned to its author (see CONTRIBUTING.md) label Oct 27, 2026
@github-actions github-actions Bot closed this Oct 27, 2026
@maxisbey maxisbey added bypass-issue-check and removed missing-issue-link Auto-closed: PR needs a linked issue assigned to its author (see CONTRIBUTING.md) labels Oct 27, 2026
@maxisbey maxisbey reopened this Oct 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 27, 2026

Copy link
Copy Markdown

@cubic-dev-ai review this PR

@github-actions[bot] I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 10 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="docs/advanced/extensions.md">

<violation number="1" location="docs/advanced/extensions.md:29">
P2: This overstates the client-side guarantee: claim-bearing extensions are omitted from legacy advertisements when their claims are inactive, so their settings are not sent. Limit this statement to client extensions that remain advertised.</violation>
</file>

Reply to a comment to ask cubic a question or push back. It learns from your replies.

Re-trigger cubic

`initialize` handshake has nowhere to put it, so a legacy client simply doesn't see
the extension. Design for that: an extension *augments* a server, it must not be the
The capability map rides `server/discover` on **2026-07-28** connections and the
`initialize` handshake on **2025-11-25 and earlier** connections. Both client and

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: This overstates the client-side guarantee: claim-bearing extensions are omitted from legacy advertisements when their claims are inactive, so their settings are not sent. Limit this statement to client extensions that remain advertised.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At docs/advanced/extensions.md, line 29:

<comment>This overstates the client-side guarantee: claim-bearing extensions are omitted from legacy advertisements when their claims are inactive, so their settings are not sent. Limit this statement to client extensions that remain advertised.</comment>

<file context>
@@ -25,9 +25,11 @@ Done. The server now advertises `io.modelcontextprotocol/ui` under
-`initialize` handshake has nowhere to put it, so a legacy client simply doesn't see
-the extension. Design for that: an extension *augments* a server, it must not be the
+The capability map rides `server/discover` on **2026-07-28** connections and the
+`initialize` handshake on **2025-11-25 and earlier** connections. Both client and
+server advertisements preserve `capabilities.extensions`, including extension
+settings, on every supported legacy version. Peers that do not support an extension
</file context>

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Legacy initialize responses drop capabilities.extensions (2025-11-25 and earlier)

2 participants