Ability to restrict MCP tool use to subagent only #1514

Closed
opened 2026-02-16 17:31:20 -05:00 by yindo · 4 comments
Owner

Originally created by @garrett-hopper on GitHub (Aug 27, 2025).

Currently builtin tools (edit, bash, webfetch) can be disabled at the top-level using permissions. It would be useful to have the ability to do the same with MCP tools as well.
The primary use case is to disable large/complex MCP servers (Github MCP for example) from the top-level agent and restrict their use to a subagent.

Side note: permissions and tools seem to have some overlap, specifically for subagents? ("deny" in permissions would be the same as setting the "tools" entry to false, right?)

Originally created by @garrett-hopper on GitHub (Aug 27, 2025). Currently builtin tools (`edit`, `bash`, `webfetch`) can be disabled at the top-level using [permissions](https://opencode.ai/docs/permissions/#tool-permission-support). It would be useful to have the ability to do the same with MCP tools as well. The primary use case is to disable large/complex MCP servers (Github MCP for example) from the top-level agent and restrict their use to a subagent. Side note: permissions and tools seem to have some overlap, specifically for subagents? ("deny" in permissions would be the same as setting the "tools" entry to false, right?)
yindo closed this issue 2026-02-16 17:31:20 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Aug 27, 2025):

This issue might be related to existing issues. Please check:

  • #2172: Feature Request: Limiting number of MCP tools based on configuration (addresses MCP tool restrictions, but focuses on quantity limits rather than scope restriction to subagents)
  • #1961: Unifying tools and permissions (discusses the overlap between permissions and tools configuration that you mentioned in your side note)
  • #514: Option to Enable / Disable MCP Servers (via TUI) (about disabling MCP servers, but at runtime via TUI rather than configuration-based subagent restriction)

Feel free to ignore if none of these address your specific case of restricting MCP tools to subagent-only use.

@github-actions[bot] commented on GitHub (Aug 27, 2025): This issue might be related to existing issues. Please check: - #2172: Feature Request: Limiting number of MCP tools based on configuration (addresses MCP tool restrictions, but focuses on quantity limits rather than scope restriction to subagents) - #1961: Unifying tools and permissions (discusses the overlap between permissions and tools configuration that you mentioned in your side note) - #514: Option to Enable / Disable MCP Servers (via TUI) (about disabling MCP servers, but at runtime via TUI rather than configuration-based subagent restriction) Feel free to ignore if none of these address your specific case of restricting MCP tools to subagent-only use.
Author
Owner

@rekram1-node commented on GitHub (Aug 27, 2025):

@garrett-hopper
You can do this already?

At top level config set

"tools": {
  "context7*": false
}

then for any agent definition set:

"tools": {
  "context7*": true
}
@rekram1-node commented on GitHub (Aug 27, 2025): @garrett-hopper You can do this already? At top level config set ``` "tools": { "context7*": false } ``` then for any agent definition set: ``` "tools": { "context7*": true } ```
Author
Owner

@rekram1-node commented on GitHub (Aug 27, 2025):

Side note: permissions and tools seem to have some overlap, specifically for subagents? ("deny" in permissions would be the same as setting the "tools" entry to false, right?)

yes this is true and that's why they need to get merged soon

@rekram1-node commented on GitHub (Aug 27, 2025): > Side note: permissions and tools seem to have some overlap, specifically for subagents? ("deny" in permissions would be the same as setting the "tools" entry to false, right?) yes this is true and that's why they need to get merged soon
Author
Owner

@garrett-hopper commented on GitHub (Aug 27, 2025):

🤦 Not sure how I missed the ability to use tools at top level; thought it was subagent specific. Sorry for the noise.
(Got it in my head that permissions was the only option and should somehow support MCP I think.)

@garrett-hopper commented on GitHub (Aug 27, 2025): 🤦 Not sure how I missed the ability to use tools at top level; thought it was subagent specific. Sorry for the noise. (Got it in my head that permissions was the only option and should somehow support MCP I think.)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1514