Coding agents and MCP
Adding MCP servers to coding agents and editors: config file locations, scopes, commands and permission settings.
Every coding agent reads MCP configuration from its own file, with its own scopes and its own approval model. Each guide here gives the exact file path, a working config block and the command to check the server loaded, taken from that tool’s documentation. The MCP clients table puts the same facts side by side.
Read in this order
- Claude Code MCP config: commands, scopes and managed settings
How Claude Code registers, stores, authenticates and restricts MCP servers, with each command taken from Anthropic's docs.
- Codex CLI MCP config: config.toml, servers and approvals
Where Codex CLI keeps MCP servers, how to add stdio and Streamable HTTP servers, how OAuth sign-in works, and how per-tool approvals and admin allowlists apply.
- Gemini CLI MCP config: settings.json servers and trust
How Gemini CLI finds MCP servers in settings.json, adds them with gemini mcp add, signs in with OAuth, and decides when an MCP tool call needs your approval.
- Grok Build MCP config: mcp.json, project vs global, and OAuth
Where Grok Build reads MCP servers, how a server entry is shaped, how OAuth sign-in and tool allowlists work, and what team and enterprise admins can control.
- VS Code MCP config: mcp.json, Copilot agents and policies
VS Code now reads MCP servers for Copilot agent sessions from two native files, keeps .vscode/mcp.json only for a deprecated harness, and lets admins allowlist servers centrally.
- How coding agents ask permission: approval modes by agent
Mode names, starting defaults, rule files, MCP approvals and admin locks for Claude Code, Codex CLI, Gemini CLI, Grok Build and VS Code Copilot, from each vendor's docs.
Terms
Human-in-the-loop (HITL), MCP host, Prompt injection, Shadow MCP