[FEATURE]: Option to deny MCP tools by default #2383

Closed
opened 2026-02-16 17:35:24 -05:00 by yindo · 3 comments
Owner

Originally created by @sroidl-airup on GitHub (Oct 31, 2025).

Originally assigned to: @rekram1-node on GitHub.

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

(hope this wasnt suggested before, but did not find anything)

Context: I'd like to use certain MCP servers only with specific agents. E.g. I'm using the jetbrains mcp, but I don't want all agents to use it's file editing capabilities, since it does not work well with the undo feature.

However, I have created a Jetbrains agent for the purpose of collaborating closely on what I do in my current jetbrains IDE (think implement the open TODO() in my current editor).

Problem:
There seems to be no easy way to deny access to all MCP tools of a defined server globally and override this in only one agent.

I've tried setting "permissions" : { "jetbrains_*" : "deny"} in my global openapi.json to no success.
Also the "tools": { "jetbrains_*": false} was not supported globally.

So currently I'm stuck with disallowing the tools for each agent. This is cumbersome and errorprone, since we don't know which agents are going to be active depending on the project I'm working on.

Request:
Make either "tools" a global configuration, so I can disallow tool usage across all agents (with the expectation, that agent specific entries override this global config), or allow MCP tools to be referenced in the "permissions" (global) config.

Originally created by @sroidl-airup on GitHub (Oct 31, 2025). Originally assigned to: @rekram1-node on GitHub. ### Feature hasn't been suggested before. - [x] I have verified this feature I'm about to request hasn't been suggested before. ### Describe the enhancement you want to request (hope this wasnt suggested before, but did not find anything) **Context**: I'd like to use certain MCP servers only with specific agents. E.g. I'm using the jetbrains mcp, but I don't want all agents to use it's file editing capabilities, since it does not work well with the undo feature. However, I have created a `Jetbrains` agent for the purpose of collaborating closely on what I do in my current jetbrains IDE (think `implement the open TODO() in my current editor`). **Problem:** There seems to be no easy way to deny access to all MCP tools of a defined server globally and override this in only one agent. I've tried setting `"permissions" : { "jetbrains_*" : "deny"}` in my global openapi.json to no success. Also the `"tools": { "jetbrains_*": false}` was not supported globally. So currently I'm stuck with disallowing the tools for each agent. This is cumbersome and errorprone, since we don't know which agents are going to be active depending on the project I'm working on. **Request:** Make either "tools" a global configuration, so I can disallow tool usage across all agents (with the expectation, that agent specific entries override this global config), or allow MCP tools to be referenced in the "permissions" (global) config.
yindo added the discussion label 2026-02-16 17:35:24 -05:00
yindo closed this issue 2026-02-16 17:35:24 -05:00
Author
Owner

@rekram1-node commented on GitHub (Oct 31, 2025):

@sroidl-airup the permissions wildcard support isn't there yet but the tools one should work globally, can u share your config?

Maybe do opencode debug config

@rekram1-node commented on GitHub (Oct 31, 2025): @sroidl-airup the permissions wildcard support isn't there yet but the tools one should work globally, can u share your config? Maybe do `opencode debug config`
Author
Owner

@github-actions[bot] commented on GitHub (Oct 31, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #2953: [feature request]: ability to dynamic turn on mcp server for specific agent - This discusses enabling MCP servers for specific agents, which is the flip side of your request to deny tools globally and allow them per agent
  • #2888: Feature Request: Global default tools configuration for agents - This closed issue requested exactly what you're asking for: a global way to control which tools are available by default to all agents, with the ability to override per agent
  • #2277: Ability to restrict MCP tool use to subagent only - This closed issue specifically requested the ability to disable MCP tools at the top level and restrict them to subagents only

The #2888 issue appears to be the most directly related to your request, as it proposed a 'defaultTools' configuration that would allow setting a baseline of available tools globally with per-agent overrides.

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Oct 31, 2025): This issue might be a duplicate of existing issues. Please check: - #2953: [feature request]: ability to dynamic turn on mcp server for specific agent - This discusses enabling MCP servers for specific agents, which is the flip side of your request to deny tools globally and allow them per agent - #2888: Feature Request: Global default tools configuration for agents - This closed issue requested exactly what you're asking for: a global way to control which tools are available by default to all agents, with the ability to override per agent - #2277: Ability to restrict MCP tool use to subagent only - This closed issue specifically requested the ability to disable MCP tools at the top level and restrict them to subagents only The #2888 issue appears to be the most directly related to your request, as it proposed a 'defaultTools' configuration that would allow setting a baseline of available tools globally with per-agent overrides. Feel free to ignore if none of these address your specific case.
Author
Owner

@sroidl-airup commented on GitHub (Nov 3, 2025):

My bad - I had a typo in the config. sorry to bother you!

@sroidl-airup commented on GitHub (Nov 3, 2025): My bad - I had a typo in the config. sorry to bother you!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2383