Skip to content

Keep unknown server and client capability keys - #3642

Closed
epistemedeus wants to merge 1 commit into
modelcontextprotocol:mainfrom
epistemedeus:heavy/root-1004-mcp-event-capability
Closed

epistemedeus wants to merge 1 commit into
modelcontextprotocol:mainfrom
epistemedeus:heavy/root-1004-mcp-event-capability

Conversation

@epistemedeus

Copy link
Copy Markdown

Fixes #3640

ServerCapabilities and ClientCapabilities are documented as not a closed set, but the public models and the generated wire models use extra="ignore". An unknown key such as a draft events object disappears in model_dump and again in serialize_server_result, which is what ServerRunner._serialize runs for server/discover and initialize.

Unknown keys are now kept on those two capability models only. Nested known capability objects stay closed, so a bad listChanged, a non-object capabilities value, or a malformed extensions value still fails validation. After the surface dump, serialize_server_result removes only names that belong to the other schema era (tasks on 2026-07-28, extensions before it). This does not add an events field and does not register events/* methods.

Covered by tests/issues/test_3640_open_capabilities.py: public model dumps, the discover and initialize sieve (including wire bytes), a streamable-HTTP server/discover response, and the in-process SDK client in auto and legacy modes.

AI assistance: this draft was prepared with Grok 4.7. It is not a request to merge. Under CONTRIBUTING.md an outside PR stays open only after a maintainer assigns the linked issue.

ServerCapabilities and ClientCapabilities are not closed sets, but the
wire sieve dropped keys such as a draft events object during
server/discover. Allow extras on those models and still remove names
that belong only to another schema era.

Fixes modelcontextprotocol#3640
@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 4, 2026
@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

This PR has been closed automatically. It's still a draft, but we close those early so you don't put in more time only to have it closed the moment you mark it ready.

This repo only keeps pull requests open when they come from a maintainer, or from a contributor a maintainer has assigned to the linked issue, and you aren't currently assigned to #3640.

If a maintainer assigns you to #3640, this PR reopens on its own and there's nothing more you need to do here. Assignment is a maintainer call based on capacity; comments that only ask to be assigned don't factor in. What does help is engaging on the issue itself by confirming the repro, explaining why it matters for your use case, or describing the approach you'd take.

You're welcome to keep pushing commits here (just avoid force-pushing, since GitHub can't reopen a rewritten branch), but that on its own won't get the PR reviewed or the issue assigned, and realistically most auto-closed PRs stay closed. There's no need to open a new PR either way.

CONTRIBUTING.md has the full reasoning, but in short:

  • We're a small team with very little capacity to review community PRs right now.
  • Many recent PRs are AI-generated with little human review, and reviewing one carefully still costs a maintainer as much time as it ever did. A well-described issue is usually more useful to us than the code.

Maintainers: reopen, remove missing-issue-link, or add bypass-issue-check to override.

@github-actions github-actions Bot closed this Oct 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

missing-issue-link Auto-closed: PR needs a linked issue assigned to its author (see CONTRIBUTING.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ServerCapabilities drops unknown keys, so a server can't advertise events for ChatGPT's MCP Events

1 participant