[Feature Request] Selective MCP Access Control for SubAgents
Status Closed — not planned
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
Activity 9 comments · opened Aug 26, 2025 · closed Feb 9, 2026
Bug Description
I want to define MCPs that are accessible only to specific sub-agents, and not to the main agent, so the main agent’s context stays clean.
Use case: Some MCPs are meant to be used exclusively by one or more sub-agents, and should not appear in the main agent’s context.
Possible solution: Extend the main agent’s config to include an allowlist of MCPs, similar to how sub-agent configs define their MCPs.
Environment Info
- Platform: darwin
- Terminal: vscode
- Version: 1.0.92
- Feedback ID: e60a8c85-a93a-41b3-aeee-1859d6ff85bf
Errors
[]
9 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
+1, this is a great feature request. I've been thinking about a similar problem where I have a bunch of specialized MCPs (like Sentry, Jira, etc.) that I only want my
debugger-agentorpr-reviewer-agentto use, but they clutter up the main agent's tool list.As a partial workaround, it looks like you can control which tools a sub-agent has access to. The documentation on sub-agents has a section on this.
From the Subagents documentation (
en/docs/claude-code/sub-agents):The key is that
toolsfield. If you omit it, the sub-agent inherits everything. But if you define it, you're essentially creating a specific allowlist for that agent.So you could create a sub-agent that only has access to your Sentry MCP tools, for example:
.claude/agents/sentry-debugger.mdThis is great for locking down the sub-agents, but like you said, it doesn't solve the problem of the main agent's context staying clean. All the MCPs you have configured are still loaded and available to the main agent.
So, I think your original feature request is still totally valid. Being able to specify an allowlist or denylist of MCPs/tools for the main agent would be the other half of the solution. It would give us complete control over the context for both the main agent and its sub-agents.
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
This _is_ a duplicate, but it's because the main issues keep getting auto closed. Yall, figure out a way to ensure an issue doesn't get closed and your duplicate rate will drop to nearly 0.
I can't tell you how many versions of this exact issue I've seen open because the github-actions bot is overzealous in closing out old issues (because they don't get a "bump" comment in time).
EDIT: I love that my comment telling the bot it was a duplicate made the bot keep the issue open. Oh the irony!
Bumping this
That would really be a game changer. I have close to 20 MCPs for various systems that we use, and the context fills in very quickly, so I have to manually turn them on and off depending on what I'm using.
Also the main agent sometimes misses to read the docs on how to use the specific MCP in our specific use-case correctly, often leading to bunch of failed calls in a row, polluting the context even more.
Being able to isolate MCPs to specific sub-agents would greatly improve the context management flexibility and ensure that the sub-agent has just the right context to use specific MCPs efficiently.
Examples of sub-agents related to specific MCPs that I'd like to isolate include:
As you can see there is a huge potential for isolating huge chunks of context (e.g. GraphQL schema, Notion structure, Database schemas) to just specific sub-agents and keep the main agent focused on achieving the high-level goal.
Really looking forward to this feature!
This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
This issue was closed incorrectly despite recent human comments. This behavior of the bot is reported at https://github.com/anthropics/claude-code/issues/16497. Please upvote that issue, so maybe it gets noticed.
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.