Request for more technical documentation on allowedTools wildcards and local config storage
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.
7 Comments
on Mac the config is stored in
~/Library/Application\ Support/Claude/config.jsonand inside it you find a
"mcpServers": {}for each directoryalternatively, you can use a
.mcp.jsonfile inside a directory (https://docs.anthropic.com/en/docs/agents-and-tools/claude-code/tutorials#configure-mcp-servers)@sjourdan
~/Library/Application\ Support/Claude/config.jsondoesn't contain what I expect.It has:
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:
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:
(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.
you're right @acrefoot I copypasted the wrong path earlier while answering! I meant
~/.claude.jsonand not~/Library/Application\ Support/Claude/config.json@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.
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
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
Chat log, with summary of what happened after:
npm run test-browserasked for further permissionsnpm run test:browserasked for further permissionsnpm 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:
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.