MCP server available to primary agent despite disabling as a tool #1696

Closed
opened 2026-02-16 17:32:14 -05:00 by yindo · 2 comments
Owner

Originally created by @lbug on GitHub (Sep 12, 2025).

Originally assigned to: @rekram1-node on GitHub.

According to https://opencode.ai/docs/mcp-servers/#per-agent we can disable a specific mcp server like following:

{
  "$schema": "https://opencode.ai/config.json",
  "agent": {
    "research": {
      "mode": "subagent",
      "description": "Research the topic using the exa.ai search engine. Primarily use the search functionality.",
      "tools": {
        "exa": true
        },
        "model": "openrouter/moonshotai/kimi-k2-0905"
        }
      },
  "mcp": {
    "exa": {
      "type": "remote",
      "enabled": true,
      "url": "https://mcp.exa.ai/mcp?exaApiKey=****"
    }
  },
  "tools": {
    "exa": false
  }
}

Using this configuration, the primary agents still see the exa mcp server in their context and can call them.

Originally created by @lbug on GitHub (Sep 12, 2025). Originally assigned to: @rekram1-node on GitHub. According to https://opencode.ai/docs/mcp-servers/#per-agent we can disable a specific mcp server like following: ``` { "$schema": "https://opencode.ai/config.json", "agent": { "research": { "mode": "subagent", "description": "Research the topic using the exa.ai search engine. Primarily use the search functionality.", "tools": { "exa": true }, "model": "openrouter/moonshotai/kimi-k2-0905" } }, "mcp": { "exa": { "type": "remote", "enabled": true, "url": "https://mcp.exa.ai/mcp?exaApiKey=****" } }, "tools": { "exa": false } } ``` Using this configuration, the primary agents still see the exa mcp server in their context and can call them.
yindo closed this issue 2026-02-16 17:32:14 -05:00
Author
Owner

@rekram1-node commented on GitHub (Sep 12, 2025):

You need to do:
"tools": {
"exa*": false
}

note the missing "*" in your example @lbug

@rekram1-node commented on GitHub (Sep 12, 2025): You need to do: "tools": { "exa*": false } note the missing "*" in your example @lbug
Author
Owner

@lbug commented on GitHub (Sep 12, 2025):

Thank you, and this fixed it. For some reason I thought this was a wildcard.

@lbug commented on GitHub (Sep 12, 2025): Thank you, and this fixed it. For some reason I thought this was a wildcard.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1696