Allowed MCP servers
A tool name such as mcp__github__create_issue carries only the label someone
gave the server. Any server can be labelled github. mcp_servers allows
servers by what they run or connect to, and refuses every other one:
version: "1.0"
settings:
mcp_servers:
allow:
- url: https://mcp.linear.app/* # a final /* is the only wildcard
- url: https://api.githubcopilot.com/mcp
- npm: "@modelcontextprotocol/server-filesystem"
- npm: "@playwright/[email protected]" # this version only
- pypi: mcp-server-fetch
- command: ["/usr/local/bin/acme-mcp", "serve"]
- connector: claude.ai Gmail # no config on this machine
rules:
- id: mcp-server-not-allowed
mode: enforce
Put it in ~/.prismor/policy.yaml for your own machine, in a project's
.prismor/policy.yaml, or in the organization policy.
Without the setting, any server is allowed. An empty list allows none. An
invalid value counts as a list that allows none until it is fixed; prismor policy validate shows the problem. Start with mode: observe to see which servers
your agents use before you block.
What each entry matches
| Entry | Matches |
|---|---|
url | Scheme, host, port and path. The query string is ignored. Also matches npx mcp-remote <url>. |
npm | npx [-y] <package>. Without a version, any published version or tag. |
pypi | uvx <package>, the same way. |
command | The exact program and arguments. Use it for docker run, bunx, pnpm dlx, uvx --from and cmd /c npx. |
connector | The name only, and only when no definition of that name is on this machine: hosted connectors and servers built into the agent's app. |
A package name counts only when it is a plain registry name. An npm alias
(x@npm:y), a Git, URL or file source, --registry, --package, or a path to
another npx does not match. A server is also refused when its env sets a
variable that can change what runs, such as PATH, NODE_OPTIONS,
LD_PRELOAD, npm_config_* or UV_*.
Arguments after an allowed package are not checked. Do not allow a package
whose job is to start or connect to other servers (@smithery/cli,
supergateway, mcp-proxy): its arguments choose the server. Allow the exact
command instead.
Where it is checked
- MCP gateway. It checks a server before it starts the process or connects, and again on each call. A refused server never runs.
- Hooks. They check each MCP tool call. The agent has already started the server by then, so a hook stops the calls and not the process. Prismor looks the name up in the config files of the agent that made the call. If several definitions have that name, each must be allowed.
Hooks identify MCP servers for Claude Code, Codex, Cursor, Windsurf, Copilot,
Gemini CLI, Antigravity, OpenCode, Qwen Code and Continue (servers in
~/.continue/config.json). Prismor does not read Grok's MCP config, so only
connector entries match there.
Kiro, Crush, OpenHands, Goose, Hermes and OpenClaw calls do not name the server in a form Prismor reads, so hooks do not cover them. Route their servers through the gateway. The LLM proxy does not run this check.
Which policy file wins
A repository's .prismor/policy.yaml cannot replace a list set in
~/.prismor/policy.yaml or by the machine's admin, change the rule's mode, or
add an exception to it. The signed organization policy replaces both, and the
same protection then applies against every local policy file.
Known limits
- Hooks cannot see servers passed on the command line (
claude --mcp-config). Such a server can reuse the name of an allowed one. - Hooks read the config as it is at the time of the call. A server started before an edit keeps running the old command.
- A package entry says which package is asked for.
npxcan still take it from a localnode_modules, or from the registry in the project's.npmrc.
Related
- MCP Gateway: the surface that can stop a server from starting.
- Guardrails for MCP tools: block or approve one tool of a server you allow.
- Skill Scanner: check the servers you already have for risky settings.