feature request: mcp config at agent level #1207

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

Originally created by @vanhtuan0409 on GitHub (Aug 10, 2025).

Originally assigned to: @thdxr on GitHub.

Hi, I want to enable some mcp only for specific agent
For example: i have a local vector db storing document for a specific tech. I want to provide this mcp to only document agent

Originally created by @vanhtuan0409 on GitHub (Aug 10, 2025). Originally assigned to: @thdxr on GitHub. Hi, I want to enable some mcp only for specific agent For example: i have a local vector db storing document for a specific tech. I want to provide this mcp to only document agent
yindo closed this issue 2026-02-16 17:30:01 -05:00
Author
Owner

@thdxr commented on GitHub (Aug 11, 2025):

you can actually configure this right now by doing <mcp-name>_<tool_name> in the tools list - wildcards are probably needed to make this less annoying

@thdxr commented on GitHub (Aug 11, 2025): you can actually configure this right now by doing `<mcp-name>_<tool_name>` in the tools list - wildcards are probably needed to make this less annoying
Author
Owner

@msmirnyagin commented on GitHub (Aug 11, 2025):

@thdxr can you tell me if they are enabled by default? That is, the primary agent needs to set _<tool_name> false, and the subagent needs to set true tools

@msmirnyagin commented on GitHub (Aug 11, 2025): @thdxr can you tell me if they are enabled by default? That is, the primary agent needs to set <mcp-name>_<tool_name> false, and the subagent needs to set true [tools](https://opencode.ai/docs/agents/)
Author
Owner

@thdxr commented on GitHub (Aug 11, 2025):

they are enabled by default yes

@thdxr commented on GitHub (Aug 11, 2025): they are enabled by default yes
Author
Owner

@thdxr commented on GitHub (Aug 11, 2025):

Fixed this in the latest commit - you can now use wildcards in the tools config to disable groups of tools. For example, to disable all tools from an MCP server named 'mymcp', use:

{
  "agent": {
    "readonly": {
      "tools": {
        "mymcp_*": false
      }
    }
  }
}

This uses the wildcard pattern matching implemented in packages/opencode/src/util/wildcard.ts.

@thdxr commented on GitHub (Aug 11, 2025): Fixed this in the latest commit - you can now use wildcards in the tools config to disable groups of tools. For example, to disable all tools from an MCP server named 'mymcp', use: ```json { "agent": { "readonly": { "tools": { "mymcp_*": false } } } } ``` This uses the wildcard pattern matching implemented in `packages/opencode/src/util/wildcard.ts`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1207