When an MCP server fails to connect in Claude Code, the cause is almost always one of three things: a wrong command/path in the config, a missing environment variable the server needs, or the server crashing on startup.
Check the exact launch command runs in your own shell first, confirm every required env var is set, and read the server's stderr — Claude Code surfaces it, and it usually names the real problem.
Permission-prompt loops are separate: allowlist the safe repeated tool calls so the agent stops asking, which also speeds up long runs.
Try it: ClaudHQ on fixing claude code mcp.