Request for more technical documentation on allowedTools wildcards and local config storage

Status Fixed / completed
Maintainer reply ✓ Yes — rboyce-ant
Activity 7 comments · opened Mar 26, 2025 · closed Apr 11, 2025
💡 Likely answer: A maintainer (rboyce-ant, contributor) responded on this thread — see the highlighted reply below.

I'd like clearer info in the docs on the config of allowedTools, and where MCP "local" configs are stored.

I'll walk through my use cases to clarify where I'm getting stuck.

Allow claude-code to open certain urls for me

In this use case, I'm requesting a workflow that ends with the github new PR page being opened. On mac, it's something like:
open https://github.com/foo/bar/pull/new/branchnamehere

the branchname is task-dependent, and I'd like to be cautious about which URLs claude-code can open for safety reasons.

I tried both of these commands:

claude config add allowedTools "Bash(open https://github.com/foo/bar/pull/new:*)"
claude config add allowedTools "Bash(open https://github.com/foo/bar/pull/new*)"

I even tried claude config add allowedTools "Bash(open *github.com/melengoteam/tailormade-v2/pull/new*)", in case the : in https: was the problem.

So clearly I'm confused.
Is the :* implying that the args can be wildcards, but you cannot put a wildcard at the end of a given command arg? Why the :?

cp -a a repo directory doesn't pull in the MCP config (local)

I setup a MCP server via claude mcp add, and chose local. Where did that config go? It doesn't appear to be any hidden variable in the directory, and I'm not seeing it in ~/Library/Application Support. Since I often have to give env vars for these servers to work, it would be nice to know where this kind of config ends up.

Sometimes I like to work on multiple branches with unstaged commits for each on the same computer, so I was looking for a clean way to copy over the allowedTools and MCP configs. Project-specific personal dotfiles.

View original on GitHub ↗

7 Comments

sjourdan · 1 year ago

on Mac the config is stored in ~/Library/Application\ Support/Claude/config.json
and inside it you find a "mcpServers": {} for each directory

      "mcpServers": {
        "anyshift-mcp-server": {
          "command": "npx",
          "args": [
            "-y",
            "@anyshift/anyshift-mcp-server"
          ],
          "env": {
            "API_TOKEN": "qwertyuiop"
          }
        }
      },

alternatively, you can use a .mcp.json file inside a directory (https://docs.anthropic.com/en/docs/agents-and-tools/claude-code/tutorials#configure-mcp-servers)

acrefoot · 1 year ago

@sjourdan ~/Library/Application\ Support/Claude/config.json doesn't contain what I expect.

It has:

{
        "darkMode": "light",
        "scale": 0,
        "locale": "en-US"
}

It's not showing the MCP servers that have actually been setup for claude-code in my working directory, and which are known to be working properly:

claude mcp list
example: node /Users/acrefoot/mcp/example/build/index.js

I'm aware of the .mcp.json, this is the "project" config for MCP servers.

If you set up a new MCP server via the claude-code command line with no args, it asks how you want to store the config:

claude mcp add

 Server Scope
                                              
 Choose where this server will be available:

 ❯ Project (shared via .mcp.json)
   Local (private to you in this project)
   User (available in all your projects)

(box decoration removed for clarity)

.mcp.json is great for configs you want to check into a repo, but I may have tools that only I want to use, with env keys I don't want to share. If a repo already has a .mcp.json, it's not ideal to keep unstaged changes to it, so i use the "local" setting.

sjourdan · 1 year ago

you're right @acrefoot I copypasted the wrong path earlier while answering! I meant ~/.claude.json and not ~/Library/Application\ Support/Claude/config.json

acrefoot · 1 year ago

@sjourdan nice!! I should have been able to find that, but clearly didn't :).

Thanks a bunch! I'd love to see that info in the docs or in the MCP wizard itself.

Still want to learn more about the wildcard behavior for allowedTools too, in case you or anyone else knows.

rboyce-ant contributor · 1 year ago

Thanks for the feedback. The rule format is now documented here: https://docs.anthropic.com/en/docs/agents-and-tools/claude-code/overview#permission-rules

acrefoot · 1 year ago

Hey @rboyce-ant the docs still don't specify how to use a wildcard inside a command argument, or maybe it's just a bug in the program or the docs.

For example, following the given documented wildcard example:

~/.claude/settings.json

{
  "permissions": {
    "allow": [
      "Bash(npm run test:*)"
    ]
  }
}

Chat log, with summary of what happened after:

> can you run `npm run test-browser` for me?

⏺ Bash(npm run test-browser)…
  ⎿  No (tell Claude what to do differently)

> can you run `npm run test:browser` for me?

⏺ Bash(npm run test:browser)…
  ⎿  No (tell Claude what to do differently)

> can you run `npm run test browser` for me?

⏺ Let me check what test scripts are available in your package.json first.

⏺ Read(package.json)…
  ⎿  Read 47 lines (ctrl+r to expand)

⏺ I don't see a "test browser" or related test script in the package.json. Available scripts are:
  - dev
  - build
  - start
  - lint

  Would you like me to run one of these instead?

> can you just run it?

⏺ Let me try running the command as requested.

⏺ Bash(npm run test browser)…
  ⎿  Running…
  1. npm run test-browser asked for further permissions
  2. npm run test:browser asked for further permissions
  3. npm run test browser (after nudging to just try running it) ran without asking for further permissions, which is the expected wildcard behavior for all three commands.

Claude Code is up to date:

$ claude update       
Current version: 0.2.78
Checking for updates...
Claude Code is up to date (0.2.78)
github-actions[bot] · 1 year ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.