Skip to content

[Client] Expose the capabilities the server declared - #542

Merged
chr-hertel merged 1 commit into
mainfrom
claude/client-server-capabilities
Oct 7, 2026
Merged

chr-hertel merged 1 commit into
mainfrom
claude/client-server-capabilities

Conversation

@chr-hertel

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

Copy link
Copy Markdown
Member

The client parses the server's capabilities in initialize but keeps only serverInfo and instructions, so a caller can't check for completions, logging or resources.subscribe before relying on them. Found while building the interop suite in #540.

Changes

  • New Client::getServerCapabilities(): ?ServerCapabilities, taken from initialize, or from server/discover on 2026-07-28. null until a server declared them.
  • ClientStateInterface / ClientState gain setServerCapabilities() / getServerCapabilities().

BC

Adding methods to ClientStateInterface breaks custom implementations, hence [BC Break] in the CHANGELOG. Protocol always creates its own ClientState and there's no way to inject another, so I don't expect any exist.

@chr-hertel chr-hertel added Client Issues & PRs related to the Client component breaking change Breaking the Backwards Compatibility Promise labels Oct 7, 2026
@chr-hertel chr-hertel added this to the 0.9.0 milestone Oct 7, 2026
@chr-hertel
chr-hertel force-pushed the claude/client-server-capabilities branch 2 times, most recently from 18859e6 to 20e7eb0 Compare October 7, 2026 20:17
The client parsed the server's capabilities during the handshake but kept
none of them. Keep them in the client state and expose them through
Client::getServerCapabilities(), read from server/discover on 2026-07-28.
@chr-hertel
chr-hertel force-pushed the claude/client-server-capabilities branch from 20e7eb0 to b414f78 Compare October 7, 2026 20:27
@chr-hertel
chr-hertel merged commit 032ab80 into main Oct 7, 2026
30 checks passed
@chr-hertel chr-hertel added the enhancement Request for a new feature that's not currently supported label Oct 7, 2026
@chr-hertel
chr-hertel deleted the claude/client-server-capabilities branch October 7, 2026 20:36
chr-hertel added a commit to chr-hertel/mcp-test that referenced this pull request Oct 18, 2026
The SDK's client now keeps what the server declared — from `initialize`, or from
`server/discover` on 2026-07-28 (modelcontextprotocol/php-sdk#542) — and the
bundle's connection forwards it once chr-hertel/ai's "Expose the server
capabilities on ServerConnectionInterface" lands. Until then the check skips
itself rather than failing against the bundle's `main`.
chr-hertel added a commit to chr-hertel/ai that referenced this pull request Oct 18, 2026
…face`

mcp/sdk 0.9 adds `Client::getServerCapabilities()`, returning what the server
declared in `initialize` or, on 2026-07-28, in `server/discover`
(modelcontextprotocol/php-sdk#542). The connection already forwards the other
three things the server declares about itself - info, protocol version and
instructions - so this completes the set.
chr-hertel added a commit to chr-hertel/ai that referenced this pull request Oct 18, 2026
…face`

mcp/sdk 0.9 adds `Client::getServerCapabilities()`, returning what the server
declared in `initialize` or, on 2026-07-28, in `server/discover`
(modelcontextprotocol/php-sdk#542). The connection already forwards the other
three things the server declares about itself - info, protocol version and
instructions - so this completes the set.
chr-hertel added a commit to chr-hertel/ai that referenced this pull request Oct 18, 2026
…face`

mcp/sdk 0.9 adds `Client::getServerCapabilities()`, returning what the server
declared in `initialize` or, on 2026-07-28, in `server/discover`
(modelcontextprotocol/php-sdk#542). The connection already forwards the other
three things the server declares about itself - info, protocol version and
instructions - so this completes the set.
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 Client Issues & PRs related to the Client component enhancement Request for a new feature that's not currently supported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant