Skip to content

[Server] Announce listChanged for a custom registry wired to the notification bus - #608

Merged
chr-hertel merged 1 commit into
modelcontextprotocol:mainfrom
chr-hertel:issue-607-listchanged-is-not-announced-for
Oct 18, 2026
Merged

chr-hertel merged 1 commit into
modelcontextprotocol:mainfrom
chr-hertel:issue-607-listchanged-is-not-announced-for

Conversation

@chr-hertel

@chr-hertel chr-hertel commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #593, which was too strict: a registry passed via setRegistry() can be wired to the bus by the caller, as symfony/mcp-bundle does, but never got listChanged announced => no list-change notifications on 2026-07-28 for bundle users.

Instead of a flag on setRegistry(), the registry says so itself via RegistryInterface::publishesListChanges(): Registry returns true when its dispatcher is a PublishingEventDispatcher. No change needed in the bundle.

[BC Break] for other implementations - the ones I found are decorators (api-platform's SecureRegistry, EC-CUBE's ScopeFilteringRegistry) and just forward to the inner registry. On the interface rather than a separate one, so a decorated registry doesn't silently lose the announcement.

Fixes #607

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The focused change preserves existing defaults and the bus requirement, with relevant tests and no identified blocking issues.

No open issues 🎉

What changed in this PR

Adds an explicit opt-in for custom registries that publish changes, addressing #607 while preserving #593’s safeguards.

Changes:

  • Adds setRegistry(..., publishesChanges: true), retaining the notification-bus requirement.
  • Tests custom-registry capability announcements with and without a bus.
  • Documents the opt-in and updates the changelog.
File Description
tests/​Unit/​Server/​BuilderTest.php Tests opt-in behavior and the bus requirement.
src/​Server/​Builder.php Adds the opt-in to capability detection.
docs/​run/​subscriptions.md Shows custom-registry wiring and opt-in usage.
docs/​run/​server-builder.md Documents the new parameter.
CHANGELOG.md Records expanded custom-registry support.

Review effort: Balanced

@chr-hertel chr-hertel changed the title [Server] Announce listChanged for a custom registry that publishes its changes [Server] Announce listChanged for a custom registry wired to the notification bus Oct 18, 2026
@chr-hertel
chr-hertel force-pushed the issue-607-listchanged-is-not-announced-for branch from 1264be4 to f8d8fbc Compare October 18, 2026 13:33
@chr-hertel
chr-hertel force-pushed the issue-607-listchanged-is-not-announced-for branch from f8d8fbc to 6232c69 Compare October 18, 2026 13:43
@chr-hertel
chr-hertel requested a balanced review from Copilot October 18, 2026 13:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The focused fix preserves the notification-bus requirement, includes regression coverage, and documents the interface break.

No open issues 🎉

Review effort: Balanced

@chr-hertel chr-hertel added breaking change Breaking the Backwards Compatibility Promise Server Issues & PRs related to the Server component labels Oct 18, 2026
@chr-hertel
chr-hertel merged commit 39578c2 into modelcontextprotocol:main Oct 18, 2026
28 checks passed
@chr-hertel
chr-hertel deleted the issue-607-listchanged-is-not-announced-for branch October 18, 2026 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Breaking the Backwards Compatibility Promise Server Issues & PRs related to the Server component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Server] listChanged is not announced for a registry wired to the bus by the caller

2 participants