Rightshold™ Sign up

Answers · MCP security

How do companies restrict which MCP servers employees can run in Claude Code, VS Code and GitHub Copilot (allowedMcpServers, deniedMcpServers, managed-mcp.json), and as an MCP server builder, how do I make my server easy for a security team to allowlist and keep allowlisted?

Last updated

TL;DR: Both use the same kind of rules: an allowedMcpServers list and a deniedMcpServers list in managed settings, where each entry matches a remote server by serverUrl (with * wildcards), a local stdio server by serverCommand (the exact command and every argument, in order), or either by serverName. Both vendors warn that a serverName entry doesn't verify which server actually runs, because the name is whatever label the user typed. Denylist matches always win. Claude Code also has managed-mcp.json, a file deployed to a system path that gives administrators exclusive control: users can't add any other server, including plugin servers. In Claude Code an allowlist is only authoritative when allowManagedMcpServersOnly is true; otherwise users can broaden it in their own settings. In GitHub Copilot's enterprise-managed settings, allowlists from several sources intersect and denylists add up. VS Code 1.145 and later puts an enterprise-managed allowlist ahead of registry-only access, so being in an MCP registry doesn't get a server past an allowlist. For you as a builder, this means the URL and launch command you publish are what customers approve. Serve the remote server from a stable https host on the default port, publish one exact launch command for the local version, write the matching allowlist entries in your docs, and treat a change of host, path, port or arguments as a change your customers have to re-approve.

What should I check, step by step?

1. Publish the exact allowlist entries for your server in your docs, for example {"serverUrl": "https://mcp.example.com/*"} for the remote server and {"serverCommand": ["npx", "-y", "@example/mcp-server@1.4.2"]} for the local one, so a security team can paste them instead of guessing.

  1. Keep the remote endpoint stable: one https host, the default port, and a path you don't move. In Claude Code a pattern with the hostname written in full matches only the scheme's default port, so a server on :8443 needs its own entry, and moving to a new host breaks every allowlist that names the old one.
  2. Give the local server one canonical launch command. serverCommand entries match the command and every argument exactly and in order, and GitHub's reference says wildcards and command-line expansion aren't supported, so ["npx", "server"] doesn't match ["npx", "-y", "server"].
  3. Decide how you want upgrades approved. A command pinned to a version (pkg@1.4.2) changes every release and needs a new allowlist entry each time, which gives the security team a review point; an unpinned command keeps matching while the code behind it changes. Say which you recommend and why.
  4. Don't ask customers to allowlist you by name. Claude Code's documentation says a serverName entry is not a security control, and GitHub's says users choose server names, so use serverUrl or serverCommand to enforce identity.
  5. Keep credentials out of the server definition. Claude Code's managed-mcp.json is readable by any user on the machine, and its documentation says not to store API keys in env blocks there; support OAuth, per-user headers or environment variables instead.
  6. Don't rely on registry listing alone. In VS Code 1.145 and later, a server that appears in the registry but doesn't match the managed allowlist is blocked, and one that matches the allowlist but isn't in the registry is permitted unless a deny rule or MCP disablement blocks it.
  7. Use a host that can't be confused with someone else's. GitHub's clients canonicalise URLs before matching (lowercase scheme and host, Punycode for Unicode host names, percent-decoded host octets, default port and fragment removed), which stops lookalike tricks from matching a pattern but doesn't make a lookalike domain safe to approve.
  8. Tell users what a block looks like. Claude Code says a server blocked by policy disappears from /mcp and claude mcp list with no signal that policy is the reason, so list the error messages and the entries to request in your troubleshooting docs.
  9. Re-announce changes. When your URL, port or launch command changes, publish the new allowlist entries before you switch, and keep the old endpoint serving or redirecting until customers have updated.

How do you restrict which MCP servers can run in Claude Code with managed-mcp.json, allowedMcpServers and deniedMcpServers?

Anthropic's documentation says that by default anyone running Claude Code can connect any MCP server they choose, and that while Anthropic reviews connectors against listing criteria before adding them to its directory, it doesn't security-audit or manage any MCP server. Administrators choose a pattern: disable MCP, deploy a fixed set, provide servers alongside users' own, publish an approved catalog, allow plugin servers only, use a soft allowlist, or a denylist only.

How do you allowlist or block MCP servers in GitHub Copilot and VS Code with enterprise-managed settings?

GitHub's enterprise-managed settings reference defines allowedMcpServers (any server not matched is blocked; omit it to allow all; an empty array blocks everything except built-in default servers) and deniedMcpServers (blocked even if also allowlisted). It lists both keys as supported in Copilot CLI, VS Code, the GitHub Copilot app, Copilot in the cloud (sandbox) and JetBrains IDEs, and not in Copilot in the cloud on GitHub Actions.

How do you make an MCP server easy for a company to allowlist?

Your server is approved by its address and launch line, not its name or its listing. In both products, the entries that actually constrain what runs are serverUrl and serverCommand, so whatever you publish as the URL and the install command becomes the identity a security team signs off on.

How do I ask Rightshold about this (free, no key)?

Add the MCP server https://www.rightshold.com/mcp to Claude, Cursor, ChatGPT, Grok or VS Code, then ask: “Our security team is deciding whether to add this MCP server to our allowedMcpServers list. Is it a listed server, what tools does it expose right now, and have its tool definitions changed since they were recorded?”

One-click setup

{
  "tool": "precall_check",
  "arguments": {
    "url": "<the MCP server's https URL>",
    "tool": "<optional tool name>"
  }
}

Rightshold reports what it has on record about MCP servers and probes the tool definitions they serve. It doesn't manage Claude Code, VS Code or GitHub Copilot settings and isn't affiliated with Anthropic, Microsoft or GitHub. Product behaviour is quoted from each vendor's documentation as checked on November 10, 2026, and changes between versions.

What are the sources?

Related

Not legal advice. JSON · Markdown · All answers

Get a free API key in one call

No card and no email needed. 100 free credits; the license and policy checks stay free without a key.

curl -s -X POST https://www.rightshold.com/v1/accounts/signup -H "Content-Type: application/json" -d '{"accept_terms":true}'
export RIGHTSHOLD_API_KEY=rs_...   # the api_key from the reply (shown once)
curl -s https://www.rightshold.com/v1/licenses/check -H "Authorization: Bearer $RIGHTSHOLD_API_KEY" \
  -H "Content-Type: application/json" -d '{"license":"MIT","intended_use":{"commercial_use":true}}'