Description
When a client sends a completion/complete request with ref.type = "ref/resource" pointing to a regular MCP resource, the server triggers a PHP warning/internal error:
Warning: Undefined property: Mcp\Capability\Registry\ResourceReference::$completionProviders
This happens because CompletionCompleteHandler fetches the resource reference and unconditionally reads $reference->completionProviders, but Mcp\Capability\Registry\ResourceReference does not define that property. The property exists on PromptReference and ResourceTemplateReference, but not on plain ResourceReference.
Example request
{
"jsonrpc": "2.0",
"id": 16,
"method": "completion/complete",
"params": {
"argument": {
"name": "tone"
},
"ref": {
"type": "ref/resource",
"uri": "page-editor://version-1/instruction"
}
}
}
Current behavior
The server logs/returns an internal error because PHP raises:
Undefined property: Mcp\Capability\Registry\ResourceReference::$completionProviders
This becomes an ErrorException and produces a JSON-RPC internal error.
Version
Observed on mcp/sdk v0.5.0.
I also checked v0.6.0 and main, and the same access pattern appears to still exist.
Description
When a client sends a
completion/completerequest withref.type = "ref/resource"pointing to a regular MCP resource, the server triggers a PHP warning/internal error:This happens because CompletionCompleteHandler fetches the resource reference and unconditionally reads
$reference->completionProviders, butMcp\Capability\Registry\ResourceReferencedoes not define that property. The property exists on PromptReference and ResourceTemplateReference, but not on plain ResourceReference.Example request
Current behavior
The server logs/returns an internal error because PHP raises:
This becomes an ErrorException and produces a JSON-RPC internal error.
Version
Observed on
mcp/sdkv0.5.0.I also checked
v0.6.0andmain, and the same access pattern appears to still exist.