Skip to content

Conversation

rekram1-node
Copy link
Collaborator

@rekram1-node rekram1-node commented Aug 17, 2025

I've heard the following a few times: "I want to enable an mcp server only for a particular agent"

currently it is kinda messy to disable a tool for each agent, then only not disable for one, having a top level configuration option can allow someone to disable an mcp server by default and only enable for the particular agent they want.

This follows existing pattern that permissions uses

note

if this isn't wanted feel free to close, ik there was talk of combining tools + permissions

@rekram1-node rekram1-node requested a review from thdxr August 17, 2025 02:45
@thdxr thdxr merged commit daea79c into sst:dev Aug 17, 2025
1 check passed
@arsham
Copy link

arsham commented Aug 19, 2025

Can you provide an example please? I am trying to test this feature but I can't figure out how to use it. I am currently using v0.5.6 so it should be implemented in this version. Here is my setup:

  "mcp": {
    "context7": {
      "type": "local",
      "enabled": false,
      "command": ["npx", "-y", "@upstash/context7-mcp"]
    }
  }

And the sample agent:

---
description: >-
  Use this agent when you need to call a tool.
tools:
  context7: true
---

When asked to access a tool, just check if you can call it. When asked to
access a MCP server, try to interact with it. Do not read from files to
determine what is exposed to you, just use your tools.

I can confirm that removing the "enabled" flag would let the agent access the tool.

@rekram1-node
Copy link
Collaborator Author

@arsham so basically:

  • enabled flag in mcp config means is the mcp server able to be ran at all (not even agent specific it is almost like opencode will ignore the mcp server if it isnt enabled)
  • so you will want to remove the enabled flag there or set it to true either works
  • then set “tools”: { “context7*”: false} << this will disable all context7 tools by default << dont set this within mcp config this is a “top level” option
  • then on a per agent basis you can enable context7*: true

yokowasis pushed a commit to yokowasis/opencode-sst that referenced this pull request Aug 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants