MCP server returns -32601 for `resources/templates/list`
Summary
The MCP stdio + HTTP server advertises the resources capability but does not implement resources/templates/list. Compliant MCP clients (Claude Desktop, Cursor, Zed) probe resources/templates/list after seeing the resources capability in initialize and today get -32601 Method not found instead of an empty resourceTemplates array.
Problem
The current initialize capability block on main is:
{
"capabilities": {
"tools": {},
"resources": { "subscribe": false, "listChanged": false }
}
}
With resources advertised, the spec invites clients to call all three resource discovery methods (resources/list, resources/read, resources/templates/list). Calling the third returns:
{ "error": { "code": -32601, "message": "Method not found", "data": "unsupported MCP method `resources/templates/list`" } }
Clients log this as a spec violation (cosmetic - graceful fallback) but it pollutes their debug surface and signals an incomplete server. The catalog is fully static, so the correct response is an empty resourceTemplates array; the handler is a one-line stub.
Solution (optional)
Add resources/templates/list to handle_request in src/openhuman/mcp_server/protocol.rs returning { "resourceTemplates": [] } from a new resources::list_resource_templates_result() helper. No capability change (still under the existing resources block). No URI scheme change.
Acceptance criteria
- [ ]
resources/templates/listreturns{resourceTemplates: []}- wired throughhandle_json_valueend-to-end, not just the helper. - [ ] Unknown / cursor params tolerated - extra params do not force a
-32602 Invalid params. - [ ] Unit + wire-through tests - at least one pure helper test plus two
handle_json_valuetests (bare + with cursor). - [ ] Docs updated -
gitbooks/developing/mcp-server.md(+ zh-CN) get a Resource Templates note and the smoke-test snippet exercises the new method;docs/TEST-COVERAGE-MATRIX.mdadds a row under 11.1. - [ ] Diff coverage >= 80% - the implementing PR meets the changed-lines coverage gate.
Related
- #2734 - our open MCP resources PR that explicitly flagged
resources/templates/listas deliberate out-of-scope follow-up tracking. - #2745 - landed the
resourcescapability +resources/list/resources/readon main; this issue extends that surface.
Picking this one up. The catalog is static so the handler is a one-line empty array; will wire it through and add unit + smoke coverage.