Skip to content

mcp-http-surface (a): POST /api/v1/mcp/skill returns a hand-rolled 405 envelope, not the standard API error shape #7649

Description

@huangyiirene

Symptom

POST /api/v1/mcp/skill (a method mismatch — the route is GET-only) answers 405 with the wrong envelope.

Root cause

dispatcher-plugin.ts (packages/runtime/src/dispatcher-plugin.ts:919) registers the skill route with server.get(${prefix}/mcp/skill, …) only — unlike /mcp, which is mounted for POST+GET+DELETE (the method-keyed register at line ~902). Because no POST handler is registered for /mcp/skill, a method mismatch never reaches the dispatcher: Hono routes it to notFound and the hono adapter's unmatchedResponse() answers with its own envelope. The domain's 405 branch (via buildApiError, #3842) is dead code on this adapter.

Still present on origin/main (dispatcher-plugin.ts:919 is server.get(...) only).

Reproduction

Boot a showcase with the MCP server available, then:

curl -X POST http://<host>/api/v1/mcp/skill

Expected {success:false, error:{code, message, httpStatus:405}} / "Method not allowed — use GET". Actual {error, code, message, method, path, allowed} from unmatchedResponse().

Source

Extracted from the QA run #7627 (framework 92f26f7, console 6314e87f).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions