threatdeck
Live 13:45 UTC ·

Learn / Securing AI coding assistants in an organisation

Lesson 4 of 610 minReviewed

MCP allowlists for developer tools

Choose between a fixed MCP deployment, an approved catalogue and a denylist, write entries that match what actually runs, and close the repository and automation paths that skip approval.

Every MCP server a developer adds is either code running with their privileges or a remote endpoint whose tool descriptions the model reads as instructions. The MCP project's own guidance is to treat a third-party local server as untrusted code with exactly the privileges you hand it [1]. An allowlist turns that into policy: which servers may load at all.

Claude Code: choose a pattern

MCP restriction patterns in Claude Code [2]
PatternConfigureEffect
Fixed deploymentmanaged-mcp.json in the system directoryOnly the listed servers load; claude mcp add fails
Provided serversmanagedMcpServers in managed settingsRemote https servers for everyone; entries cannot name a command to run
Approved catalogueallowedMcpServers with allowManagedMcpServersOnly: trueUsers add what they need from your list; anything else is blocked
Denylist onlydeniedMcpServersKnown-bad servers blocked; everything else allowed

Entries match by serverUrl (wildcards allowed), serverCommand (the exact command and arguments, every argument in order) or serverName. The documentation warns that a serverName entry is not a security control, because the name is a label the user assigns and anyone can call a server github [2]. Two further details catch teams out: an unset allowedMcpServers allows everything while an empty array allows nothing, and without allowManagedMcpServersOnly users' own allowlists merge with yours and can broaden it. The denylist always wins over an allowlist match [2].

Managed settings: approved catalogue with a denylist
{
  "allowManagedMcpServersOnly": true,
  "allowedMcpServers": [
    { "serverUrl": "https://mcp.internal.example.com/*" },
    { "serverCommand": ["npx", "-y", "@example/approved-server@1.4.2"] }
  ],
  "deniedMcpServers": [
    { "serverUrl": "https://*.untrusted.example.com/*" }
  ]
}

Pinning the version in a serverCommand entry helps, but know its reach: launchers such as npx and uvx fix only the top-level package, and transitive dependencies resolve fresh at install time. A container image pinned by digest freezes the whole tree [1].

Paths that skip the prompt

A repository can ship a .mcp.json. In interactive sessions Claude Code asks before using those project servers, and a cloned repository in an untrusted folder cannot approve its own servers. In claude -p runs, Agent SDK sessions and some cloud sessions there is no one to ask, so Claude Code loads project-scoped servers without asking [3]. A CI job that runs the agent on a pull request branch therefore runs whatever servers that branch declares, unless you pass --strict-mcp-config or list them in disabledMcpjsonServers [3].

Approvals also need to bind to content. In MCPoison (CVE-2025-54136), Cursor tied trust to the entry's name, so once a user approved an MCP entry in a shared repository, a later change to its command ran without a new prompt. Cursor 1.3, released 29 July 2025, requires approval for any change [4].

GitHub Copilot

Copilot's enterprise allowlist uses the same key names in its own managed-settings.json, matching by serverUrl or serverCommand. Built-in default servers are always allowed, a deny match blocks, a server outside a configured allowlist is blocked, and an entry with an unresolved ${VARIABLE} is blocked because the client cannot verify it [5]. GitHub describes restricting access to a private registry as a public preview and not the recommended method [6].

Try it on ThreatDeck

Self-check

4 questions

Pick an answer to see whether it is right and why. Only your score is saved, in this browser.

  1. Why is a serverName allowlist entry not a security control?
  2. What does "allowedMcpServers": [] in managed settings do in Claude Code?
  3. A CI job runs claude -p against a pull request branch that adds a .mcp.json. What does Claude Code do with those servers by default?
  4. What design flaw did MCPoison (CVE-2025-54136) expose?

References

  1. MCP Local Server Security. Model Context Protocol, 2026-07-28.
  2. Control MCP server access for your organization. Anthropic (Claude Code docs).
  3. Connect Claude Code to tools via MCP. Anthropic (Claude Code docs).
  4. Cursor IDE's MCP Vulnerability (MCPoison, CVE-2025-54136). Check Point Research, 2025-08-05.
  5. Configuring an MCP server allowlist for your enterprise. GitHub Docs.
  6. Restrict MCP server access to a custom registry. GitHub Docs.
Completing the self-check also marks the lesson complete. Saved in this browser only.

Following

Follow the vendors, products, AI tools, techniques and actors you care about. Matching stories, CVEs and exploited bugs are marked, a Following tab appears in the feed, and returning visits show what changed. Saved only in this browser.

Presets

Get updates

A personal RSS feed of new stories on everything you follow. Paste it into any feed reader, Slack or Teams RSS app.