# Where Every MCP Client Keeps Its Config

> MCP config file locations for Claude Code, Claude Desktop, Cursor, VS Code, Windsurf, Gemini CLI and Codex, with user, project and managed scopes.

- Canonical URL: https://webofmike.com/mcp-config-file-locations/
- Author: Mike Moore (https://webofmike.com/about/)
- Published: 2026-11-15
- Last modified: 2026-11-15
- Tags: MCP, Security, AI Agents, Platform Engineering
- Cite as: Mike Moore, "Where Every MCP Client Keeps Its Config", Web of Mike (webofmike.com), 2026-11-15. https://webofmike.com/mcp-config-file-locations/


Every MCP client keeps its server list in its own file: Claude Code uses ~/.claude.json and a project .mcp.json, Claude Desktop uses claude_desktop_config.json, Cursor uses ~/.cursor/mcp.json, VS Code uses .vscode/mcp.json, Gemini CLI uses ~/.gemini/settings.json, and Codex uses ~/.codex/config.toml. Most clients also have project and managed scopes, and connectors added in a vendor's web app have no local file at all. This page is the reference table. [Why shadow MCP servers are hard to track](/shadow-mcp-servers/) is the hub.

Paths move. Last checked November 15, 2026. Claude Code user, project, and managed paths were re-checked against Anthropic's docs on that date. The other rows match the vendor docs linked under the table.

## Where does each client keep the file?

| Client | Scope | Path | Format key |
|---|---|---|---|
| Claude Code | user / local | `~/.claude.json` | `mcpServers` |
| Claude Code | project | `.mcp.json` at the repo root (often committed) | `mcpServers` |
| Claude Code | managed | macOS: `/Library/Application Support/ClaudeCode/managed-mcp.json`; Linux and WSL: `/etc/claude-code/managed-mcp.json`; Windows: `C:\Program Files\ClaudeCode\managed-mcp.json` | `allowedMcpServers` / `deniedMcpServers` |
| Claude Desktop | user | macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`; Windows: `%APPDATA%\Claude\claude_desktop_config.json` | `mcpServers` |
| Cursor | global | `~/.cursor/mcp.json` | `mcpServers` |
| Cursor | project | `.cursor/mcp.json` | `mcpServers` |
| VS Code | workspace | `.vscode/mcp.json` | `servers` |
| VS Code | workspace | `.mcp.json` | `mcpServers` |
| VS Code | user profile | profile `mcp.json` (one per profile) | `mcpServers` |
| VS Code | dev container | `customizations.vscode.mcp` in `devcontainer.json` | MCP config block |
| VS Code / Copilot | Agent Host | `~/.copilot/mcp-config.json` | Copilot MCP config |
| Windsurf (Devin Cascade) | user | macOS and Linux: `~/.config/devin/mcp_config.json`; Windows: `%APPDATA%\devin\mcp_config.json` | MCP config |
| Gemini CLI | user | `~/.gemini/settings.json` | `mcpServers` |
| Gemini CLI | project | `.gemini/settings.json` | `mcpServers` |
| OpenAI Codex | user | `~/.codex/config.toml` | `[mcp_servers.<name>]` |
| Claude.ai custom connectors | account | no local file (connection originates from Anthropic's cloud) | n/a |
| Cursor team / marketplace servers | team | no local file unless someone also wrote them into `mcp.json` | n/a |

Docs: [Claude Code](https://code.claude.com/docs/en/mcp), [managed MCP](https://code.claude.com/docs/en/managed-mcp), [Claude Desktop](https://modelcontextprotocol.io/docs/develop/connect-local-servers), [Cursor](https://cursor.com/docs/context/mcp), [VS Code](https://code.visualstudio.com/docs/copilot/customization/mcp-servers), [Windsurf / Devin](https://docs.devin.ai/desktop/cascade/mcp), [Gemini CLI](https://github.com/google-gemini/gemini-cli/blob/main/docs/tools/mcp-server.md), [Codex](https://developers.openai.com/codex/mcp), [Claude connectors](https://support.claude.com/en/articles/11175166-get-started-with-custom-connectors-using-remote-mcp).

## Where does Claude Code store MCP servers?

### User and local scope

User and local servers live in `~/.claude.json`. Local scope is the default for `claude mcp add`. It is stored under that project's path inside `~/.claude.json`, so a server you add in one repo does not automatically appear in the others. User scope, passed with `--scope user`, is also in `~/.claude.json` and is available across projects.

### Project scope

Project servers live in a `.mcp.json` file at the repo root, under an `mcpServers` key. Teams often commit this file so everyone gets the same tools. Claude Code prompts for approval in an interactive session before using those servers.

### Managed scope

Managed allowlists and denylists, and the exclusive managed server set, live in a system path that differs by operating system. The current filename is `managed-mcp.json` on all three platforms, in the directories in the table. `allowedMcpServers` and `deniedMcpServers` key on `serverUrl` or `serverCommand`. A `serverName` entry is not a security control. <!-- TODO: link /stop-shadow-mcp-servers/ when S4 is live -->

## Where is the Claude Desktop config?

On macOS it is `~/Library/Application Support/Claude/claude_desktop_config.json`. On Windows it is `%APPDATA%\Claude\claude_desktop_config.json`. Local servers in that file use the machine's local network. Remote connectors you add in the Claude app are not stored there.

## Where is Cursor's mcp.json?

Global servers are in `~/.cursor/mcp.json`. Project servers are in `.cursor/mcp.json` inside the repo. Both use the `mcpServers` key. Cursor's docs also describe installing servers from the Marketplace or from a team marketplace, and those team or marketplace servers do not appear in either file unless someone also adds them there.

## Where do VS Code and GitHub Copilot keep MCP config?

The workspace file `.vscode/mcp.json` uses a `servers` key, not `mcpServers`. A workspace `.mcp.json` uses `mcpServers`. User-profile config lives in a per-profile `mcp.json`. Dev containers can also carry a `customizations.vscode.mcp` block in `devcontainer.json`. Copilot's Agent Host has its own file at `~/.copilot/mcp-config.json`. VS Code can also read config that other tools wrote, so a sweep of only one of these paths will miss the rest.

## Where did Windsurf's config go?

If you install Windsurf, the MCP config path says Devin, because Windsurf's docs now live under Devin and name `~/.config/devin/mcp_config.json` on macOS and Linux, or `%APPDATA%\devin\mcp_config.json` on Windows. A sweep script written against an older Windsurf path will skip it. That is a small, true oddity, and exactly the kind of thing that breaks a scanner you wrote last spring.

## Where does Gemini CLI store servers?

User servers go in `~/.gemini/settings.json`. Project servers go in `.gemini/settings.json`. Both use `mcpServers`.

## Where does OpenAI Codex keep MCP servers?

In `~/.codex/config.toml`, as one `[mcp_servers.name]` table per server. That is TOML, not JSON, so a sweep that only parses JSON will miss it.

## Which servers have no local file?

Claude custom connectors, and Cursor team or marketplace servers that were never also written into `mcp.json`, have no file on the laptop. The connection comes from the vendor's cloud or from the team account. A file sweep will report a clean machine and still miss the server the developer uses every day.

## How should you read these files safely?

Parse JSON for `mcpServers`, `servers`, and `projects.*.mcpServers`, and parse TOML for `mcp_servers`. Emit the client, the scope, the file, the server name, the transport, and the URL host or command basename. Never print `env` or `headers` values. [Keys don't belong in these files](/secretless-ai-agents/). <!-- TODO: link /mcp-servers-on-employee-machines/ when S3 is live -->

## Where does one remote server land in three clients?

I use [Pocket's MCP server](/pocket-mcp-server/) as the example, because I run it from Claude Code. The URL is `https://public.heypocketai.com/mcp`. In Claude Code a user-scope entry lands in `~/.claude.json` under `mcpServers`. In Claude Desktop it lands in `claude_desktop_config.json` under the same key. In Cursor it lands in `~/.cursor/mcp.json`, or in `.cursor/mcp.json` if I added it only for one repo. The [meeting recorder I use](/pocket-ai-recorder/) is the product on the other end of that URL. If I add the same server as a Claude custom connector instead, none of those files will show it.

`claude mcp add` writes to local scope by default, which is the current project's entry inside `~/.claude.json`, unless you pass `--scope project` or `--scope user`.

## What has changed in these paths?

- September 28, 2026: first table published on the shadow MCP hub, including Windsurf's docs moving under Devin and naming `~/.config/devin/mcp_config.json`.
- November 15, 2026: Claude Code managed config is `managed-mcp.json` on macOS, Linux, WSL, and Windows. Earlier shorthand on the hub listed the Linux and Windows directories without the filename. Anthropic's managed MCP docs are the source for the filename.

