claude -p silently connects repo .mcp.json servers without asking, docs confirm

SirRobinBlibs · reddit · 2026-12-04

A Reddit post flags that per the Claude Code docs, claude -p (non-interactive mode) connects MCP servers declared in a repo's .mcp.json without asking the user. Cloning an untrusted repo and running -p therefore trusts whatever tools the repo defines, opening the door to prompt injection and arbitrary command execution. The author advises inspecting .mcp.json or disabling auto-loading before working with unfamiliar repos.

Original post →

More from coding & agent

coding & agent channel →