Dev.to Security 🔐 Cybersecurity 👁 2 📖 5 min read

MCP server allowlists in Claude Code, Copilot and Cursor: match on command, not label

Your agent just connected to a new MCP server. Did an admin approve that server, or did the model pick it from memory and your harness ran it anyway? Most teams assume there is an allowlist somewhere. There often is not,

Your agent just connected to a new MCP server. Did an admin approve that server, or did the model pick it from memory and your harness ran it anyway? Most teams assume there is an allowlist somewhere. There often is not, and where one exists, each client checks it differently.

This note covers what Claude Code, GitHub Copilot Enterprise and Cursor Enterprise actually enforce, where the policy lives, and a three-item audit you can run today before your next agent session.

1. Where the policy lives

The file name and syntax differ by client, but the idea is the same. A managed setting decides which MCP servers and plugin marketplaces may load.

Claude Code uses managed settings, or a managed-mcp.json file at the system path that loads only the servers it defines. An approved catalog uses allowedMcpServers together with allowManagedMcpServersOnly set to true. In that shape, only servers named in allowedMcpServers may load, and the managed-mcp.json itself is the single source of truth.

GitHub Copilot Enterprise uses managed-settings.json. Remote servers match on serverUrl. Local servers match on serverCommand. Copilot connectors are remote MCP servers too: once an allowlist is defined, each connector needs a serverUrl entry, or it is blocked. GitHub also keeps an older route, an MCP registry URL plus the Registry only policy, still in public preview and matching servers by name. GitHub now recommends the managed-settings allowlist and setting the registry policy to Allow all once you use it, so there is a single source of truth.

Cursor Enterprise uses the Team dashboard under MCP Configuration, not a file. Command entries approve local stdio servers by command pattern. URL entries approve remote servers by URL pattern. An optional per-server tool allowlist limits which of a server's tools run automatically; empty means all tools are allowed. Local servers also get a per-server network mode: allow all, allowlist, deny all, or no sandbox.

None of these match on a human-friendly label such as "GitHub server." They match on the exact command or URL string, so two spellings of the same server are two different entries.

2. What exact match means

Remote servers are matched on serverUrl, with wildcards allowed. A serverUrl entry for https://mcp.example.com/* covers every path on that host.

Local stdio servers are matched on serverCommand, the exact command and every argument. This last point is the trap. Because the match is exact, npx -y pkg, npx -y pkg at latest, and npx -y pkg pinned at version 1.2.3 are three different entries.

Pinning a version means updating the allowlist entry every time you upgrade the package. If your docs tell developers to run npx -y some-mcp-server but the allowlist only contains npx -y some-mcp-server pinned at version 1.2.3, the unpinned command is blocked. In practice this means the allowlist is not a one-time setup. Every upgrade of a pinned MCP package requires a matching allowlist edit, or the next agent session fails to load the server.

A malformed policy file is treated as an empty allowlist, which blocks everything except built-ins. That fails closed, but it also means a typo in your JSON can silently stop every MCP server your team relies on.

Worked example

A team approves npx -y github-mcp-server for developers. Six months later the maintainer publishes version 2 and the docs change to npx -y github-mcp-server pinned at version 2. The allowlist still holds the npx -y github-mcp-server entry. Because exact-match does not treat a bare name as a prefix of the pinned form, the new command is blocked until someone edits the allowlist. Conversely, if the allowlist holds only npx -y github-mcp-server pinned at version 2 and a teammate still runs the bare npx -y github-mcp-server, that call is blocked too. The rule is: whatever the agent or the docs actually type must appear, verbatim, in the allowlist.

3. Deny wins, and what it blocks

Each client keeps a denylist that is checked before or alongside the allowlist, and deny wins. GitHub's own example blocks a filesystem server pointed at /, even if another entry would allow it. The denylist always wins, so an allow rule cannot resurrect a denied server.

Copilot connectors are remote MCP servers too. Once you define an allowlist, they need serverUrl entries, or they are blocked. The older route, an MCP registry URL plus the Registry only policy, is still in public preview and matches servers by name. GitHub now recommends the managed-settings allowlist and setting the registry policy to Allow all once you use it, so there is a single source of truth.

4. A three-item preflight audit

Before you let an agent connect to a new MCP server in any of these clients, check these.

First, who publishes it. Name a source owner and a repository. If you cannot name either, treat the server as unverified. Server pages show when the code was last pushed, whether there is a SECURITY.md file, the license and adoption, plus the allowlist entry that matches its setup snippet. This is a triage signal, not a security audit.

Second, can you verify the running code? Publisher-controlled infrastructure means the declared code may not be the running code. Prefer the service owner's own hosted endpoint over a package that runs on every laptop.

Third, is it pinned. Record the exact serverCommand or serverUrl you approve, including version. Re-approve when you upgrade, because pkg@latest and pkg pinned at version 1.2.3 are different entries.

Then wire the approval into the client. Add the exact command or URL to the managed setting or dashboard entry, and confirm the server appears in the active allowlist rather than only in a local user config.

Before your next upgrade checklist

  • Open the active allowlist (managed settings file, managed-mcp.json, or Team dashboard MCP Configuration).
  • Confirm every serverCommand and serverUrl your agents actually type appears verbatim, including version.
  • Re-approve any MCP package you plan to upgrade before the upgrade runs, because the pinned form and the bare form are different entries.
  • Confirm the denylist does not already block any entry you are about to allow; deny wins and an allow rule cannot resurrect a denied server.
  • Record who publishes each approved server and where its source repository lives, so the list stays auditable.

5. What this does not fix

An allowlist decides what may load. It does not confine what an approved server can do with its arguments, and it does not inspect tool descriptions or instruction files as attack surface. Pair it with scoped tokens, outbound network allowlists, and human approval for high-risk actions. Connection is not the end of review.

Sources

socketlist, "MCP server allowlists in Claude Code, GitHub Copilot and Cursor," dev.to, posted Nov 29 2026. Primary source for client matching fields, wildcard behavior, malformed policy handling, pinning examples, and the denylist wins semantics.

webofmike, "Coding Agent MCP Allowlist and Plugin Vetting," last checked Nov 29 2026. Secondary confirmation of the three layer model: client managed settings, gateway, OS sandbox. Also confirms the plugin as MCP server point.

GitHub, "Configuring an MCP server allowlist for your enterprise" and "Restrict MCP server access to a custom registry," cited via the dev.to write up above. Source for managed-settings.json, allowedMcpServers, allowManagedMcpServersOnly, and the Registry only public preview policy.

This post was written with AI assistance. The author is responsible for its content.

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.