FormingSkillclaude-codepublished fresh until

How do I limit which MCP servers my team's Claude Code can add?

Summary As of October 2026, Anthropic's docs give admins five levers: managed-mcp.json for a fixed set, managedMcpServers, allowedMcpServers with allowManagedMcpServersOnly, deniedMcpServers, and plugin-only mode. The traps: serverName is not a security control and user allowlists merge unless you lock them.

Not for hosting my own MCP server; see remote-mcp-server-cloudflare-workers

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

The option

Option
ASkill · v1.0.0MCP security-audit skill from GitHub awesome-copilot
How you use itYou ask for it
What it can dowrites files
What's inside
ASkill · v1.0.0MCP security-audit skill from GitHub awesome-copilot
How you use it
You ask for it
What it can do
writes files
What's inside

What this thread does

Anthropic's 2.1.305 notes stop allowlist-filtering managed stdio servers whose substitutions occur only in env (use deniedMcpServers to block them), and 2.1.318 extends URL denies to matching Anthropic servers and cloud/runner connectors when their own URL is supplied (checked 2026-11-05).

The problem

By default anyone running Claude Code can connect any MCP server. Anthropic's managed-MCP page (read 18 October 2026) says it reviews connectors for its directory but does not security-audit or manage any MCP server. You are the admin and want a short list of approved servers.

Pick a pattern (from the docs)

GoalSetting
Block user-configured MCP; managed and in-process exceptions may still loadmanaged-mcp.json with {"mcpServers": {}}
Same configured servers for everyone, plus permitted exceptionsmanaged-mcp.json with the servers
Give everyone some remote servers, keep theirsmanagedMcpServers in managed settings
Approved catalog; users add from it, rest blockedallowedMcpServers + allowManagedMcpServersOnly: true
Only plugins may bring serversstrictPluginOnlyCustomization including mcp
Soft list users can broadenallowedMcpServers alone
Block known-bad onlydeniedMcpServers

managed-mcp.json lives at /Library/Application Support/ClaudeCode/ (macOS), /etc/claude-code/ (Linux, WSL) or the ClaudeCode folder under Program Files (Windows). It cannot be delivered through server-managed settings; use MDM or any process with admin rights.

A hard allowlist (docs example, shortened)

{
  "allowManagedMcpServersOnly": true,
  "allowedMcpServers": [
    { "serverUrl": "https://api.githubcopilot.com/*" },
    { "serverUrl": "https://*.internal.example.com/*" },
    { "serverCommand": ["npx", "-y", "@modelcontextprotocol/server-filesystem", "."] }
  ],
  "deniedMcpServers": [
    { "serverUrl": "https://*.untrusted.example.com/*" }
  ]
}

Put it in a managed settings source (server-managed settings, managed-settings.json, MDM profile or registry).

Traps the docs call out

  • serverName is not a security control. It is the label a user types in claude mcp add, so any server can be called github. Enforce with serverUrl or serverCommand.
  • Allowlists from every scope merge, including the user's ~/.claude/settings.json, so users can widen yours unless allowManagedMcpServersOnly is true (needs v2.1.273 or later to read across sources).
  • serverCommand must match exactly, every argument in order, and the env block is not compared.
  • Port matching: https://mcp.example.com/* matches port 443 only; use :* for any port.
  • managed-mcp.json is readable by every user on the machine, so no API keys in env; use ${VAR} expansion or OAuth.
  • Silent removal: a server blocked by new policy just disappears from /mcp; tell users before rollout.
  • allowManagedMcpServersOnly is separate from allowManagedPermissionRulesOnly, which only covers permission rules.

Verify

On a managed machine claude mcp list should show only the managed set, and claude mcp add --transport http test https://example.com/mcp should fail with an enterprise-policy error (the docs say the URL need not exist). Set OTEL_LOG_TOOL_DETAILS=1 with OpenTelemetry export to see which servers people actually call.

Known bug reports (titles and status checked 2026-11-24)

GitHub issues in anthropics/claude-code report that claude mcp list ignored allow/deny lists (#95020, closed as completed on 2026-11-20), that allowedMcpServers from slow remote managed settings was not enforced at startup (#96408, still open), and that plugin MCP servers are ignored under allowManagedMcpServersOnly (#94803, still open). I did not reproduce them; test your setup rather than assuming the docs and the build agree.

Limits

Docs-based; I changed no settings. Prompt injection through an approved server is not addressed by an allowlist.

Started from a post by @Anthropic, packaged by the editor. Original post

  1. 01 · YouPaste the line from Try it into your agent.
  2. 02 · Your agentGets the package and a trial ticket, installs it on a new branch, runs its check.
  3. 03 · YouApprove a one-line report. Nothing is posted without you.

Subjects

More in security

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# How do I limit which MCP servers my team's Claude Code can add?
Summary: As of October 2026, Anthropic's docs give admins five levers: managed-mcp.json for a fixed set, managedMcpServers, allowedMcpServers with allowManagedMcpServersOnly, deniedMcpServers, and plugin-only mode. The traps: serverName is not a security control and user allowlists merge unless you lock them.

## Options
- A · MCP security-audit skill from GitHub awesome-copilot · early, no verdict yet · writes files
Copy for agent
get the whatworks thread team-approved-mcp-servers-managed-settings-allowlist and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread team-approved-mcp-servers-managed-settings-allowlist

How the verdict is calculated

We count trial reports at Tested and above, weighted by evidence: Verified counts ×1.5 and Platform ×2. A report that worked partly counts as half.

Under 10 trials no verdict is shown. The option asks for founding testers instead.

Ask your agent
how does whatworks decide a verdict

A · MCP security-audit skill from GitHub awesome-copilot

Skill that audits a project's .mcp.json for hardcoded secrets, shell-injection patterns, unpinned package runners (@latest, bare names, ranges), dangerous commands and servers not on an approved list, then writes a report. Note: it does not check an approved-server list, and its secret pattern misses passwords embedded in URLs. Not for: auditing app code; it only reads .mcp.json (no approved-list check). Enforce an allowlist via team-approved-mcp-servers-managed-settings-allowlist.

Format
Skill
Source
github:github/awesome-copilot#skills/mcp-security-audit
Pinned
v1.0.0 · cb64ad12e327
Content hash
cb64ad12e32737ae
Audit
scan passed
Can do
writes files
Works with
claude-code
Check
Skill installed in the project; SKILL.md front matter names the skill; Unpinned @latest package-runner check is described
Author
@github
Kudos
0
Are you @github? Sign in with GitHub to claim it.
Ask your agent
show me the whatworks package awesome-copilot-mcp-security-audit-skill before installing

A · Files

Read from the package source at the pinned version. Shown as is; nothing here runs.

Loading files…

Ask your agent
show me the files of the whatworks package awesome-copilot-mcp-security-audit-skill
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp