---
title: "Shadow MCP servers: finding the servers developers added themselves"
type: guide
url: https://agentsfordevs.com/guides/shadow-mcp-servers
markdown: https://agentsfordevs.com/guides/shadow-mcp-servers.md
publisher: Agents for Devs
author: Agents for Devs desk
reviewed_by: Agents for Devs desk
published: 2026-12-06
updated: 2026-12-06
license: https://agentsfordevs.com/reuse
citation: 'Agents for Devs. "Shadow MCP servers: finding the servers developers added themselves." Published Dec 6, 2026. https://agentsfordevs.com/guides/shadow-mcp-servers'
attribution: Credit Agents for Devs and link to https://agentsfordevs.com/guides/shadow-mcp-servers
format: Guide
topics:
  - security
description: "Find shadow MCP servers: config paths for Claude Code, Grok Build, Claude Desktop, VS Code and Codex, and the managed allowlists that block the rest."
---

# Shadow MCP servers: finding the servers developers added themselves

Developers add MCP servers in one command, and nobody is asked first. Here is where each client keeps its MCP config, how to build an inventory, and how each client's managed allowlist blocks the rest.

## Short answer

Shadow MCP servers are MCP servers developers connect to their AI clients without security or IT review. Find them in each client's config files, such as `~/.claude.json` and `.mcp.json` for Claude Code or `~/.cursor/mcp.json` for Grok Build (formerly Cursor), and with `claude mcp list` or `codex mcp list`. Block new ones with each client's managed allowlist, matched on server URL or launch command, because a server name is a label any user can choose.

**Checked against:** Anthropic's Claude Code [managed MCP](https://code.claude.com/docs/en/managed-mcp), [MCP](https://code.claude.com/docs/en/mcp) and [security](https://code.claude.com/docs/en/security) docs, the MCP project's [Local Server Security guide](https://modelcontextprotocol.io/docs/2026-07-28/tutorials/security/local-server-security), Microsoft's [VS Code MCP configuration reference](https://code.visualstudio.com/docs/agents/reference/mcp-configuration) and [policies](https://code.visualstudio.com/docs/enterprise/policies), GitHub's [enterprise MCP allowlist](https://docs.github.com/en/enterprise-cloud@latest/copilot/how-tos/administer-copilot/manage-mcp-usage/configure-enterprise-allowlist) docs, OpenAI's [Codex MCP](https://learn.chatgpt.com/docs/extend/mcp) and [managed configuration](https://learn.chatgpt.com/docs/enterprise/managed-configuration) docs, and Grok Build's [MCP docs](https://docs.grok.com/build/agents-window/mcp), December 6, 2026.

**Run by us:** no. Commands and config are copied from Anthropic's and OpenAI's docs.

## Why do unapproved MCP servers matter?

An unapproved local MCP server is ordinary software running with the developer's access, and nothing in the protocol asks anyone before it is installed. The MCP project's [Local Server Security guide](https://modelcontextprotocol.io/docs/2026-07-28/tutorials/security/local-server-security) describes what that process gets:

| What the server process gets | Per the MCP guide |
|---|---|
| Environment | The environment variables of whatever launched it |
| Files | Whatever the user's account can read: SSH keys, cloud credentials, browser profiles, the home directory |
| Network | Outbound connections "to anywhere" |
| Model context | Shared with every other configured server |

The guide tells administrators to "Assume users install servers the same way they install editor extensions." Anthropic's [managed MCP docs](https://code.claude.com/docs/en/managed-mcp) say that unless an administrator restricts it, any Claude Code user can connect any server, and that Anthropic "doesn't security-audit or manage any MCP server."

Two risks are specific to agents. One server's tool descriptions can steer how the agent uses the others, which is [tool poisoning](/guides/tool-poisoning). And config files hold credentials: Invariant Labs' [tool poisoning demo](https://invariantlabs.ai/blog/mcp-security-notification-tool-poisoning-attacks) stole `~/.cursor/mcp.json` because it "is typically used to store credentials for other MCP servers."

## Where does each client keep its MCP config?

Each client reads a few known files, and most also load servers from places no file shows. As of December 6, 2026, these are the documented paths:

| Path | Client | Scope | Inside the project folder? |
|---|---|---|---|
| `~/.claude.json` | Claude Code | User and local | No |
| `.mcp.json` at the project root | Claude Code | Project | Yes |
| `~/.cursor/mcp.json` | Grok Build (formerly Cursor) | Global | No |
| `.cursor/mcp.json` | Grok Build | Project | Yes |
| `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS), `%APPDATA%\Claude\claude_desktop_config.json` (Windows), `~/.config/Claude/claude_desktop_config.json` (Linux) | Claude Desktop | User | No |
| `~/.copilot/mcp-config.json`, or `$COPILOT_HOME/mcp-config.json` | VS Code with Copilot | User | No |
| `.mcp.json` at the workspace root | VS Code with Copilot | Workspace | Yes |
| `.vscode/mcp.json` and the profile `mcp.json` | VS Code, deprecated Local harness | Workspace and profile | Workspace file only |
| `~/.codex/config.toml` | Codex | User | No |
| `.codex/config.toml` | Codex | Project (trusted projects only) | Yes |

The paths come from [Anthropic](https://code.claude.com/docs/en/mcp), [Grok Build](https://docs.grok.com/build/agents-window/mcp), the MCP project's [local server tutorial](https://modelcontextprotocol.io/docs/develop/connect-local-servers), [Microsoft](https://code.visualstudio.com/docs/agents/reference/mcp-configuration) and [OpenAI](https://learn.chatgpt.com/docs/extend/mcp). Servers that reach a session without appearing in those files:

- **Claude Code:** plugins, claude.ai connectors, and servers an admin provides through `managedMcpServers` or `managed-mcp.json`. Anthropic's [security page](https://code.claude.com/docs/en/security) warns that "reviewing `.mcp.json` doesn't show every server a session can load."
- **Grok Build:** dashboard team servers, marketplace plugins, servers an extension registers with `vscode.cursor.mcp.registerServer()`, and the terminal UI's `[mcp_servers]` in `config.toml`. Cursor took the Grok Build name on [November 30, 2026](https://grok.com/news/cursor-is-now-grok-build); the `.cursor` paths stayed.
- **Claude Desktop:** desktop extensions.
- **VS Code:** with `chat.mcp.discovery.enabled`, it reads other apps' configs (Claude Desktop, GitHub Copilot CLI, Cursor and Windsurf); only the Copilot CLI source is on by default. Microsoft says the Local harness "is deprecated and will be removed in February 2027."
- **Codex:** nothing extra is documented, but one `config.toml` serves Codex CLI, the IDE extension and the ChatGPT desktop app, per OpenAI.

## How do I build an inventory?

Gather config files, ask each client what it loaded, and turn on telemetry, then key every entry by URL or launch command. The client commands, from Anthropic's and OpenAI's docs:

```bash
# List all configured servers
claude mcp list
```

```bash
codex mcp list
```

Claude Code marks a project server nobody has approved yet as `⏸ Pending approval`. VS Code has **MCP: List Servers** in the Command Palette, and Grok Build lists servers on its Customize page.

1. **Pull config files from managed machines.** Per the MCP guide, these files sit "in known locations on each platform," so endpoint management tooling can collect them.
2. **Scan source control** for the project-level paths in the table. Anything committed there lands on every clone.
3. **Turn on tool telemetry.** With `OTEL_LOG_TOOL_DETAILS=1`, Claude Code's OpenTelemetry events carry MCP server and tool names; Anthropic's docs suggest totaling them in your collector "to see which servers your users actually connect to."
4. **Key each entry by URL or command**, with its pinned version, publisher, the teams that run it and the systems it can touch.

Remote servers also show up on the wire: under the [2026-07-28 Streamable HTTP spec](https://modelcontextprotocol.io/specification/2026-07-28/basic/transports/streamable-http), every request carries `MCP-Protocol-Version` and `Mcp-Method` headers. If your egress proxy already decrypts TLS, a rule on those headers can surface remote servers missing from every config file.

## How do I block servers nobody approved?

Turn on each client's managed allowlist and write its rules against URLs and commands. In Claude Code, this example from Anthropic's [managed MCP docs](https://code.claude.com/docs/en/managed-mcp) allows two URL patterns and ignores any allowlist a user writes:

```json
{
  "allowManagedMcpServersOnly": true,
  "allowedMcpServers": [
    { "serverUrl": "https://api.githubcopilot.com/*" },
    { "serverUrl": "https://*.internal.example.com/*" }
  ]
}
```

Deploy it as `managed-settings.json` in the system directory (`/Library/Application Support/ClaudeCode/` on macOS, `/etc/claude-code/` on Linux and WSL, `C:\Program Files\ClaudeCode\` on Windows), per the [managed settings docs](https://code.claude.com/docs/en/managed-settings), or push the same keys through MDM or server-managed settings. Codex takes a `requirements.toml` table instead, per OpenAI's [managed configuration docs](https://learn.chatgpt.com/docs/enterprise/managed-configuration):

```toml
[mcp_servers.docs]
identity = { command = "codex-mcp" }

[mcp_servers.remote]
identity = { url = "https://example.com/mcp" }
```

Codex turns a server on only when "both its name and identity match an approved entry," and an empty `mcp_servers` table turns them all off. Where each client's admin control lives:

| Client | Where an admin sets it | Keys or switches |
|---|---|---|
| Claude Code | `managed-settings.json`, MDM or server-managed settings; `managed-mcp.json` for a fixed set | `allowedMcpServers`, `deniedMcpServers`, `allowManagedMcpServersOnly` |
| Claude Desktop | MDM configuration profiles; Windows registry under `HKLM:\SOFTWARE\Policies\Claude` | `isLocalDevMcpEnabled`, `isDesktopExtensionEnabled` |
| VS Code | Group Policy, macOS configuration profiles, `/etc/vscode/policy.json` | `ChatMCP`, `ChatAllowedMcpServers`, `ChatDeniedMcpServers`, `ChatAllowManagedMcpServersOnly` |
| GitHub Copilot | An enterprise `managed-settings.json`, usually in a `.github-private` repository, or MDM | `allowedMcpServers`, `deniedMcpServers` |
| Grok Build | Grok Dashboard, Team Settings > MCP Configuration | Allowlist entries |
| Codex | Admin Console, Agent security | `mcp_servers` |

The rules compare different things. Claude Code matches `serverUrl` wildcard patterns, exact `serverCommand` arrays or a `serverName` label; GitHub matches name, URL or command; Grok Build matches command or URL patterns; Codex checks name plus command or URL. Microsoft's policies page doesn't document VS Code's entry format. In GitHub and VS Code, deny beats allow.

## Where do allowlists leave gaps?

Allowlists leave gaps for servers matched only by name, servers that load through a path the list doesn't govern, and edits users make to their own settings.

| Gap | What the vendor says |
|---|---|
| Name matching | Anthropic: a `serverName` entry "is not a security control," because "a user can call any server `github`" |
| Soft allowlists | Without `allowManagedMcpServersOnly`, Claude Code merges allowlists from every settings scope, "so a user can broaden what your allowlist permits" |
| Environment | A Claude Code `serverCommand` entry doesn't compare the server's `env` block |
| Name-only registries | GitHub: registry enforcement by name or ID "can be bypassed by editing configuration files" |
| Custom agent profiles | GitHub's allowlist doesn't apply to MCP servers in repository custom agent profiles; block the domains they need to start |
| Desktop extensions | Anthropic: in Claude Desktop, "Desktop extensions can still run local servers," so block extensions as well as local servers |
| Tampering | Claude Desktop's extension allowlist "does not guard against individuals tampering with local MCP file contents after installation" |

Three settings close most of these: rules written as `serverUrl` and `serverCommand` entries rather than names, `allowManagedMcpServersOnly` turned on, and, in Claude Desktop, extensions blocked along with local servers. GitHub describes its [`managed-settings.json` allowlist](https://docs.github.com/en/enterprise-cloud@latest/copilot/how-tos/administer-copilot/manage-mcp-usage/configure-enterprise-allowlist) as "The more secure, generally available method," compared with its [registry-based restriction](https://docs.github.com/en/enterprise-cloud@latest/copilot/reference/enterprise-administrators/mcp-allowlist-enforcement). If approved remote servers sit behind an [MCP gateway](/guides/mcp-gateway-explained), make the gateway's URL the one allowed remote entry, because a gateway can't govern a server that a client reaches directly.

## What do I do when a shadow server turns out to be bad?

Block it everywhere first, then rotate whatever it could reach. A Claude Code `deniedMcpServers` entry applies from any settings scope, and Anthropic says "Nothing overrides a denylist match." The [Local Server Security guide](https://modelcontextprotocol.io/docs/2026-07-28/tutorials/security/local-server-security) gives the fleet sequence:

1. Locate every machine that runs it, from your inventory.
2. Cut its egress at the proxy or firewall while you respond.
3. Rotate each credential those configs handed to it.
4. Roll out a fixed, pinned version through your approved channel.

Per the guide, SBOMs let you work out which machines run something built on an affected SDK version "in minutes instead of days." Its suggested starting point is the pair this page describes: a fleet-wide inventory of client configs and a short list of approved servers.

## What to read next

- [Claude Code MCP config: commands, scopes and managed settings](/guides/claude-code-mcp)
- [VS Code MCP config](/guides/vscode-mcp) and [Codex CLI MCP config](/guides/codex-cli-mcp)
- [What an MCP gateway does between agents and servers](/guides/mcp-gateway-explained)
- Glossary: [shadow MCP](/glossary/shadow-mcp) and [MCP registry](/glossary/mcp-registry)

## Sources

1. [Control MCP server access for your organization, Anthropic](https://code.claude.com/docs/en/managed-mcp)
2. [Connect Claude Code to tools via MCP, Anthropic](https://code.claude.com/docs/en/mcp)
3. [Security, Anthropic](https://code.claude.com/docs/en/security)
4. [Deploy managed settings, Anthropic](https://code.claude.com/docs/en/managed-settings)
5. [Enterprise configuration for Claude Desktop, Anthropic](https://support.claude.com/en/articles/12622667-enterprise-configuration-for-claude-desktop)
6. [Enabling and using the desktop extension allowlist, Anthropic](https://support.claude.com/en/articles/12592343-enabling-and-using-the-desktop-extension-allowlist)
7. [Local Server Security (2026-07-28), Model Context Protocol](https://modelcontextprotocol.io/docs/2026-07-28/tutorials/security/local-server-security)
8. [Connect to local MCP servers, Model Context Protocol](https://modelcontextprotocol.io/docs/develop/connect-local-servers)
9. [Streamable HTTP (2026-07-28), Model Context Protocol](https://modelcontextprotocol.io/specification/2026-07-28/basic/transports/streamable-http)
10. [MCP configuration reference, Microsoft](https://code.visualstudio.com/docs/agents/reference/mcp-configuration)
11. [Centrally manage VS Code settings with policies, Microsoft](https://code.visualstudio.com/docs/enterprise/policies)
12. [Configuring an MCP server allowlist for your enterprise, GitHub](https://docs.github.com/en/enterprise-cloud@latest/copilot/how-tos/administer-copilot/manage-mcp-usage/configure-enterprise-allowlist)
13. [MCP private registry enforcement, GitHub](https://docs.github.com/en/enterprise-cloud@latest/copilot/reference/enterprise-administrators/mcp-allowlist-enforcement)
14. [Model Context Protocol, OpenAI](https://learn.chatgpt.com/docs/extend/mcp)
15. [Managed configuration, OpenAI](https://learn.chatgpt.com/docs/enterprise/managed-configuration)
16. [Model context protocol (MCP), Grok Build docs](https://docs.grok.com/build/agents-window/mcp)
17. [Cursor is now Grok Build, Grok (2026-11-30)](https://grok.com/news/cursor-is-now-grok-build)
18. [MCP Security Notification: Tool Poisoning Attacks, Invariant Labs (2025-04-01)](https://invariantlabs.ai/blog/mcp-security-notification-tool-poisoning-attacks)

## Changelog

- 2026-12-06: First published.

## Cite this page

Agents for Devs. "Shadow MCP servers: finding the servers developers added themselves." Published Dec 6, 2026. https://agentsfordevs.com/guides/shadow-mcp-servers

- Page: https://agentsfordevs.com/guides/shadow-mcp-servers
- Markdown: https://agentsfordevs.com/guides/shadow-mcp-servers.md
- Reuse: quote or summarize with a link to the page. Terms: https://agentsfordevs.com/reuse
