[BUG] Allow partial globs in permissions.allow for MCP tools (regression 2.1.166+)

Resolved 💬 3 comments Opened Jun 6, 2026 by tanvp112 Closed Jul 12, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Environment: Claude Code 2.1.167

Problem

Rules like mcp__[server]__get* are rejected:

▎ Wildcard tool name mcp__[server]__get* is not supported in allow rules

The full mcp__[server]__* wildcard is still accepted. This is a regression from 2.1.163, which allowed partial globs after the server prefix.

Why it matters

Many MCP servers group tools by verb (get_, list_, find_*, etc.). A single MCP server can have dozens of tools, and the agent makes many calls in a session. Previously one allow rule per group was enough. Now every tool must be enumerated by exact name, and at startup the user is forced to either continue without the MCP or line-by-line add to the allow ruleset — this is very unproductive consider there are MANY MCP in-used.

PreToolUse hooks can filter by function name in principle, but they don't help at startup before the user has had a chance to configure one, and they still face the same fail-open problem as the blanket wildcard.

**Why the full wildcard is not a fix*

Some MCP servers mix read and write operations. A blanket mcp__[server]__* would auto-approve future write tools. Partial globs let users express "read-only prefix" intent without trusting the entire namespace.

Proposed fix

Allow mcp__[server]__[prefix]* in permissions.allow for MCP tools, matching the syntax at https://code.claude.com/docs/en/permissions#mcp. Optionally validate that the prefix matches at least one currently-registered tool, so a stale rule can't silently allow renamed/future tools.

Reproduction

"permissions": { "allow": ["mcp__[server]__get*"] }

Rejected on 2.1.167. Same rule works on 2.1.163.

What Should Happen?

Allow mcp__[server]__[prefix]* in permissions.allow for MCP tools.

Error Messages/Logs

N/A

Steps to Reproduce

Simply start claude with MCP configured.

Claude Model

Not sure / Multiple models

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.163

Claude Code Version

2.1.167

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Xterm

Additional Information

This regression has a significant negative impact on productivity: every MCP server upgrade forces a manual trace-and-update of its tool list, every session starts with a choice between working without the MCP or approving dozens of calls one by one, and background/headless workflows break entirely when a new tool appears. For users running multiple MCP servers, this turns routine server maintenance into recurring lost time across every session.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗