Skip to content

[Server] Make resource subscribe/unsubscribe errors protocol-version-aware (SEP-2164) - #474

Open
chr-hertel wants to merge 2 commits into
modelcontextprotocol:mainfrom
chr-hertel:fix/issue-359-resource-not-found-error-code-v2
Open

[Server] Make resource subscribe/unsubscribe errors protocol-version-aware (SEP-2164)#474
chr-hertel wants to merge 2 commits into
modelcontextprotocol:mainfrom
chr-hertel:fix/issue-359-resource-not-found-error-code-v2

Conversation

@chr-hertel

Copy link
Copy Markdown
Member

Summary

ReadResourceHandler was already version-aware for the resource-not-found error code (-32602 on 2026-07-28+, legacy -32002 otherwise), but ResourceSubscribeHandler and ResourceUnsubscribeHandler still hard-coded the legacy -32002 unconditionally.

Both handlers now follow the same RequestContext/ProtocolVersion pattern ReadResourceHandler already uses.

Closes #359.

Test plan

  • New tests for both handlers, data-provider covering legacy / 2025-11-25 / 2026-07-28 protocol versions (21 tests)
  • Full phpunit suite passes (1713 tests)
  • phpstan analyse — no errors

…aware (SEP-2164)

ReadResourceHandler already picked -32602 vs -32002 based on the
negotiated revision; ResourceSubscribeHandler and
ResourceUnsubscribeHandler still hard-coded the retired -32002 for
every client. Bring them in line.
Comment thread src/Server/Handler/Request/ResourceSubscribeHandler.php Outdated
Comment thread src/Server/Handler/Request/ResourceUnsubscribeHandler.php Outdated
Co-authored-by: Christopher Hertel <mail@christopher-hertel.de>
@chr-hertel chr-hertel added Server Issues & PRs related to the Server component improves spec compliance Improves consistency with other SDKs such as TyepScript labels Aug 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improves spec compliance Improves consistency with other SDKs such as TyepScript Server Issues & PRs related to the Server component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Schema] SEP-2164: Switch resource-not-found error code to -32602 with protocol-version-aware fallback

1 participant