To see which MCP servers run on employee machines, read each MCP client’s config files instead of the process list, because local servers start as child processes of the IDE and may not be running when you look. Sweep the known config paths and repos read-only through your MDM tool, record client, scope, transport and URL or command, and never copy env or header values, which hold secrets. This page is the laptop method. Why shadow MCP servers are hard to track is the hub, and how to find shadow MCP servers in your environment is the wider walk across the network, clusters, laptops, and vendor accounts.
I work at Solo.io, which makes agentgateway.
Why doesn’t the process list work?
A local MCP server that speaks stdio is a child of a trusted IDE or agent. It only exists while that client is running it. A laptop that looks idle in the process table can still have a server waiting in a config file, ready to start the next time the developer opens the project.
A remote MCP server may not run on the laptop at all. The process list will never show it. The name you would have seen, if the process were running, is also just whatever the config file called it.
The file is the inventory. The process list is a snapshot of who happened to be launched at that moment.
Which files should you read?
These six paths cover most developer laptops:
- Claude Code:
~/.claude.jsonfor user and local servers, and a repo’s.mcp.jsonfor project servers - Claude Desktop:
claude_desktop_config.json - Cursor:
~/.cursor/mcp.json - VS Code:
.vscode/mcp.json, or the VS Code profilemcp.json - Gemini CLI:
~/.gemini/settings.json - Codex:
~/.codex/config.toml
Most of those clients also have project and managed scopes, and some servers have no local file. The full table, with every scope and the format key each file uses, belongs on a reference page of its own. I am keeping this page on the sweep, not on every path variant.
A filesystem MCP server that can read .env files is one reason to treat those paths as sensitive, not as a dump you paste into a ticket.
How do you run a read-only sweep?
Walk the paths above, plus the repos on the machine, and look for .mcp.json, .vscode/mcp.json, .cursor/mcp.json, and .gemini/settings.json as well as the user-level files. Parse JSON for mcpServers, servers, and projects.*.mcpServers, and parse TOML for mcp_servers.
Emit one row per server: client, scope, file, name, transport, and the URL host or the command basename. Never print env or headers values. Those fields hold API keys and tokens. API keys don’t belong in an agent’s config in the first place, and a sweep that copies them just moves the secret into your inventory tool.
The sweep script
The repo’s scanner/discover_local.py, in themsquared/shadow-mcp-scanner, does that sweep. It is read-only, it redacts env and headers, and its fixture tests pass. I have not re-run those fixtures for this page; that claim is the one already published on the hub.
Push it through MDM
The useful pattern is to run the same read-only script on a schedule through your MDM tool and collect the output in one place. Present it as a pattern, not as a rollout I have done. I have not run an MDM fleet sweep, so I am not going to describe how yours will look once it is in production.
What about configs that arrive with a git clone?
A committed .mcp.json at the repo root brings servers to every clone. That is the project-scope path Claude Code documents, and it is often checked in on purpose so a team shares the same tools.
Claude Code asks before using those project servers in an interactive session. In claude -p runs, Agent SDK sessions, and cloud sessions outside a project’s threads, Claude Code cannot show that prompt: it loads project-scoped servers without asking. Anthropic’s Claude Code MCP docs state that directly. A laptop sweep that only looks at ~/.claude.json will miss the servers that arrived with the clone, and a policy that assumes a human clicked Approve will miss the headless path.
What can a laptop sweep not see?
Some servers never touch a local file.
Claude custom connectors connect from Anthropic’s cloud. They leave no config on the laptop. Cursor team or marketplace servers also have no local file unless someone also wrote them into mcp.json. Personal OAuth grants live in the vendor account.
The one I notice on my own machine is the meeting recorder’s MCP server I use every day. When I add it as a Claude custom connector, a laptop sweep will not see it, because the connection lives in the account, not on disk.
How do you tell approved from unapproved?
The sweep output is only useful against a list of servers you already approved. Anything in the files that is not on that list is unapproved, at least until someone reviews it. Build that list as a private MCP registry you run yourself, with an owner and a domain for each server, not as a spreadsheet of friendly names.
Connectors added in a vendor’s web app still have to be checked in that vendor’s admin console. The file sweep will not catch them.
How do you turn the sweep into enforcement?
Finding a server does not stop it. The next step is to make unapproved servers hard to use.
On the laptop
Claude Code’s managed MCP controls can allow and deny servers with allowedMcpServers and deniedMcpServers. Those lists key on serverUrl or serverCommand. Anthropic’s docs say a serverName entry, in either list, is not a security control, because the name is whatever someone typed when they added the server.
Cursor’s enterprise MCP Allowlist keys on a command pattern for local stdio servers and a URL pattern for remote servers. That is a client fact, not a ranking. Name-only allowlists fail the same way in both products: anyone who can edit the file can reuse an approved name.
Managed Claude Code settings live in a system path that differs by operating system, including /Library/Application Support/ClaudeCode/managed-mcp.json on macOS, /etc/claude-code/managed-mcp.json on Linux and WSL, and C:\Program Files\ClaudeCode\managed-mcp.json on Windows.
At the gateway
For remote MCP, put the approved servers behind agentgateway and authorize each tool call with CEL rules, in standalone mode or on Kubernetes. Kubernetes allows all tools until you attach a tool-access policy, so attach one. A laptop with unrestricted egress can still reach a personal remote server, which is why the gateway path only holds where you also control egress.