Omniscio

OmniscioGuidesClaude Code MCP tool permissions

Claude Code MCP permissions: allow and deny tools

An MCP server hands Claude a set of tools with names you did not write. The permission rules for them look like Bash rules and behave differently in a few places.

Here is a block that trusts one server’s read tools, asks before a write, and refuses a second server outright — with the naming rules that decide whether it works at all.

Checked against Anthropic’s Claude Code permission documentation. By the Omniscio team. Updated .

The block

The server and tool names here are examples. Replace them with the names your own servers publish; /mcp lists the servers a session has connected.

{
  "permissions": {
    "allow": [
      "mcp__github__get_*",
      "mcp__puppeteer__*"
    ],
    "ask": [
      "mcp__github__create_pull_request"
    ],
    "deny": [
      "mcp__github__merge_pull_request",
      "mcp__playwright__*"
    ]
  }
}

The five entries do four different jobs. mcp__github__get_* approves the read tools whose names start with get_. mcp__puppeteer__* approves every tool on that server. The ask rule names one write tool, so a pull request is a question. The deny rules refuse one tool on the github server and every tool on the playwright server.

Note the order of evaluation, because it is the same for every rule type: deny first, then ask, then allow. If a tool matched both the allow glob and a deny rule, the deny would win.

The name in the rule is a tool name or a server name

RuleMatchesWorks in
mcp__github__get_issueThe get_issue tool from the github serverAll three lists
mcp__github__*Every tool from the github serverAll three lists
mcp__githubAny tool provided by that server. Anthropic’s own example is mcp__puppeteerAll three, but see the __ caveat below
mcp__github__get_*The get_ tools. Ask and deny accept this glob; in allow it works because the glob follows the literal server nameAll three
mcp__*Every MCP tool across all serversAsk and deny only; allow skips it

The server part has to be written the way it appears in the tool names, and that is not always the name you configured:

  • A dot or a space becomes an underscore. For a server you configured as my.server, the rule is mcp__my_server__*.
  • A plugin’s server keeps the plugin in the name. For the database-tools server in a plugin named my-plugin, write mcp__plugin_my-plugin_database-tools__*.
  • A name containing __ or ending in _ needs the wildcard form. For a server named reports__v2, write mcp__reports__v2__*; the shorter mcp__reports reads as a rule for a server named reports. As a deny or ask rule, though, both names do cover every tool of reports__v2.

Why a specifier in an allow rule matches nothing

Bash rules take a command prefix. MCP rules do not take that kind of specifier. An allow rule for an MCP tool is either the full tool name or the server-wide wildcard, and if you add a parenthesized part to narrow it, the rule matches no call at all.

It is worse than a rule that does nothing quietly. When Claude Code loads a settings file, it skips any mcp__ rule that has parentheses, lists the skipped rule in the invalid-settings dialog at the start of an interactive session, and prints it in claude doctor. So the mistake is visible — just not where people look.

When you need to refuse a particular call rather than a particular tool, pass a deny rule to --disallowedTools with the parameter you want to match. A deny or ask rule can gate a top-level parameter on a built-in tool with Tool(param:value); for an MCP tool, that same matching is available only through the flag, because a settings file skips any mcp__ rule with parentheses, in allow or in deny.

Where globs are allowed

This is the second difference from Bash rules. In the tool-name position, deny and ask rules accept glob patterns that must match the full tool name: "*" matches every tool, and "mcp__*" matches every MCP tool across all servers. A tool matched by a bare-name glob in a deny rule is removed from Claude’s context, the same as a bare tool name.

Allow rules are stricter. They accept a tool-name glob only after a literal mcp__<server>__ prefix, with a server segment that is glob-free. mcp__puppeteer__* and mcp__github__get_* are rules. An unanchored allow glob such as "*", "B*" or "mcp__*" is skipped and approves nothing.

The practical consequence: you cannot write “trust everything” in the allow list. That state is simply the absence of deny rules; the wildcard that looks like the way to say it is the one shape allow skips.

Two things that outrank your rules

The first one bites before the second: an organization policy can make an allow rule do nothing, in every mode. The second only affects a session running in Claude Desktop’s Cowork.

  • An organization’s connector setting. If your organization has set a claude.ai connector tool to ask and that setting reaches your session, allow rules for that tool do not take effect. Claude Code prompts each time, even in auto and bypassPermissions modes; in dontAsk mode it denies the call instead.
  • Cowork’s own tools. In a Cowork session the Claude Desktop app runs shell commands through mcp__workspace__bash rather than the built-in Bash, and offers mcp__workspace__web_fetch for fetches. A deny rule that names the whole Bash or WebFetch tool also applies to those, but an allow rule for Bash never carries over to mcp__workspace__bash.

Before you debug a rule that will not work, run /permissions: it lists the rules that loaded, so a missing rule is a loading problem and a present rule that still prompts points at an organization setting. If the tool is a claude.ai connector, ask whether your organization set it to ask.

Where the block goes

Commit it at .claude/settings.json if the team shares the servers, or keep it in .claude/settings.local.json for yourself. The allow rules in a committed project file wait for the workspace trust dialog; an untracked settings.local.json applies without it, and ask and deny rules apply regardless.

For one session, --allowedTools "mcp__github__get_*" adds the allow rule, and --disallowedTools "mcp__*" removes every MCP tool for that run. A deny rule from any settings file still outranks the flag.

The four settings files and their precedence are on the settings.json locations page.

Confirm it took effect

  1. Run /mcp to see which servers connected, and take the tool name from the server’s own tool list rather than from memory.
  2. Run /permissions and check that each mcp__ rule is listed, with the settings file that supplied it. A rule that is missing here is the one the loader skipped.
  3. Ask Claude to call the read tool: no prompt. Ask for the pull request tool: a prompt. Ask for anything on the denied server: refused.
  4. If a rule was dropped, claude doctor lists the skipped entry.

The common mistake

Narrowing an allow rule with a specifier. mcp__github__get_issue(owner:acme) reads like a careful rule and matches no call, because an allow rule for an MCP tool takes no specifier; the settings file will also list it as skipped. The fix is to allow the tool and refuse the calls you do not want through a deny rule passed to --disallowedTools.

The second mistake is copying a server name from the config rather than from the tool. A configured my.server publishes tools under my_server, and a rule for the dotted name matches nothing. The third is assuming mcp__* works in allow: it is skipped, and it is the one omission that looks like it should be the broadest rule in the file. The fourth is the tool question behind the query this page answers: allowedTools is the command-line flag, so in a settings file the rules belong under permissions.allow, and --allowedTools adds them for one run.

Where these answers come from

  • The MCP rule shapes, the server-name rules, the allow-without-specifier rule and the skipped-rule warning: Configure permissions, read November 25, 2026.
  • Tool-name globs and which lists accept them: the same page, “Tool name wildcards”.
  • Organization connector settings and Cowork tools: the same page, “MCP”.
  • The allow and deny keys, and --disallowedTools: Settings reference and the CLI reference.

Common questions

What is the difference between mcp__github and mcp__github__*?

mcp__github matches any tool from that server. mcp__github__* uses wildcard syntax and covers the same tools. In an allow rule, prefer the wildcard form: the bare name is only unreliable when the server name itself contains __.

Why does my allow rule with a parameter match nothing?

MCP allow rules take no specifier. Claude Code skips an mcp__ rule that has parentheses and lists it as rejected, so the rule never approves a call. Use a deny rule with --disallowedTools to gate a parameter.

Can I deny every MCP tool with one rule?

Yes: "mcp__*" in deny matches every MCP tool across all servers and removes them from Claude’s context. The same string in allow is skipped.

Do these rules cover a connector my organization manages?

Not necessarily. If your organization set a connector tool to ask, allow rules for it do not take effect and Claude Code prompts each time.