Implements SEP-2164 for the MCP Spec 2026-07-28 release.
Tracked by umbrella #337.
Spec summary
Resource-not-found now uses JSON-RPC -32602 (Invalid Params) instead of the MCP-custom -32002, aligning with JSON-RPC.
PHP SDK changes
src/Schema/JsonRpc/Error.php:37 defines RESOURCE_NOT_FOUND = -32002. Change to -32602, or deprecate the constant and add RESOURCE_NOT_FOUND_INVALID_PARAMS = -32602.
Error::forResourceNotFound() (line ~109) is called from ReadResourceHandler, ResourceSubscribeHandler, ResourceUnsubscribeHandler, GetPromptHandler, CompletionCompleteHandler — all flip automatically once the constant changes.
- Negotiate by protocol version: pre-
2026-07-28 clients still expect -32002. Add version-aware dispatch in Error::forResourceNotFound() reading session/request protocol version.
- Update conformance & unit tests asserting the old code.
Related
Implements SEP-2164 for the MCP Spec 2026-07-28 release.
Tracked by umbrella #337.
Spec summary
PHP SDK changes
src/Schema/JsonRpc/Error.php:37definesRESOURCE_NOT_FOUND = -32002. Change to-32602, or deprecate the constant and addRESOURCE_NOT_FOUND_INVALID_PARAMS = -32602.Error::forResourceNotFound()(line ~109) is called fromReadResourceHandler,ResourceSubscribeHandler,ResourceUnsubscribeHandler,GetPromptHandler,CompletionCompleteHandler— all flip automatically once the constant changes.2026-07-28clients still expect-32002. Add version-aware dispatch inError::forResourceNotFound()reading session/request protocol version.Related