MCP · Tools
vite-doctor/mcptoolswarnSuggestion
Why it happens
Clients decide from these hints whether a tool may run without asking. MCP's defaults are readOnlyHint: false and destructiveHint: true, so a tool that declares neither is treated as one that may destroy data. Claude prompts before every call to such a tool, and Anthropic's Connectors Directory flags it at submission.
Fix
Set readOnlyHint: true on a tool that only reads, or destructiveHint: true on one that changes or deletes data.
Example
Mark a read-only tool
Before
export default defineMcpTool({
name: 'list_drops',
title: 'List drops',
annotations: { title: 'List drops' },
handler: () => listDrops(),
})
After
export default defineMcpTool({
name: 'list_drops',
title: 'List drops',
annotations: { title: 'List drops', readOnlyHint: true },
handler: () => listDrops(),
})
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/require-safety-hint