Claude Code claude -p: project MCPs start without asking
Claude CodeMCPsecuritysecretsprocess
- Tried
- Clone a repo that ships .mcp.json and run Claude Code headless (`claude -p`) so it can work the tree
- Broke
- Project-scoped MCP servers from `.mcp.json` start without the interactive ask; Anthropic docs state the approval prompt is skipped in `claude -p`, Agent SDK, and some cloud sessions (interactive sessions still prompt)
- Fix
- Inspect `.mcp.json` before first headless run; use `disabledMcpjsonServers`, `--strict-mcp-config`, or exclude project settings; never point -p agents at untrusted repos
Original source · ← All stories