MCP · Tools
vite-doctor/mcptoolserrorNo fix
Why it happens
Clients call a tool by name, so MCP requires names to be unique within a server. h3-mcp (okmcp) answers the whole tools/list with HTTP 500 when two tools share a name, so the client sees no tools at all. nitro-mcp-toolkit refuses to start, and the MCP SDK, which @nuxtjs/mcp-toolkit builds on, throws when the second tool registers.
Fix
Rename one of the tools or remove a repeated registration. For file-discovered tools, rename the file or set name on the definition.
Example
Name each tool once
Before
// server/mcp/tools/orders/list.ts
export default defineMcpTool({ handler: listOrders })
// server/mcp/tools/users/list.ts
export default defineMcpTool({ handler: listUsers })
After
// server/mcp/tools/orders/list.ts
export default defineMcpTool({ name: 'list_orders', handler: listOrders })
// server/mcp/tools/users/list.ts
export default defineMcpTool({ name: 'list_users', handler: listUsers })
Verify the fix
Run only this rule after editing so the report stays focused on the diagnostic you are closing:
pnpm vite-doctor . --rules mcp/tools/unique-name