Feature Request: MCP repo scope

Status Fixed / completed
Maintainer reply ✓ Yes — ashwin-ant
Activity 6 comments · opened Mar 6, 2025 · closed Mar 21, 2025
💡 Likely answer: A maintainer (ashwin-ant, collaborator) responded on this thread — see the highlighted reply below.

I'm experimenting with Claude Code + MCP Servers.

One thing that tripped me up is that the Claude project config appears to be scoped to whatever directory claude was run from, so if I run claude mcp add in one directory in a repo then move to another directory in the same repo, the mcp config is gone. This is a monorepo using yarn workspaces.

I would expect project scope to refer to the repository rather than the folder claude was run from.

Maybe there could be an explicit repo scope when managing MCP servers. I would imagine this would also be useful for other config that would be unexpectedly absent / different depending on the current working directory.

Thanks!

View original on GitHub ↗

6 Comments

ashwin-ant collaborator · 1 year ago

We're working on something like this. Should be ready soon!

CiaranMn · 1 year ago

Great to hear, thank you!

ashwin-ant collaborator · 1 year ago

@CiaranMn this shipped this week. Check out "project-scoped MCP servers" here https://docs.anthropic.com/en/docs/agents-and-tools/claude-code/tutorials#understanding-mcp-server-scopes

CiaranMn · 1 year ago

Great, thank you!

jlgeering · 1 year ago

@ashwin-ant I don't think this is working (using v1.0.35): I have a mcp config file in the root of the repo (repo_root/.mcp.json). If I start claude from repo_root, everything works as advertised (project scope), but if start claude from a subfolder (eg repo_root/project_a) which doesn't contain a .mcp.json file, then no mcp is available.

What would be nice is to be able to have a hierary of mcp configurations that get merged, just like you do with memory (repo_root/CLAUDE.md and repo_root/project_a/CLAUDE.md)

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.