You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: Filter which tools are loaded from MCP servers (includeTools/excludeTools) #7399
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Problem
MCP servers often expose many tools, but agents typically need only a subset. Currently, enabling an MCP loads all its tools into the context window, adding significant token overhead.
Example: The chrome-devtools MCP provides 26 tools (~17k tokens). A UI preview agent might only need 4 of them (~1.5k tokens).
Proposed Solution
Add includeTools and/or excludeTools to MCP configuration:
Their implementation uses a companion mcp.json file per skill. The approach proposed here integrates with OpenCode's existing centralized config pattern.
Benefits
Token savings: Load only needed tools (17k → 1.5k in the chrome-devtools example)
Reduced confusion: LLM sees only relevant tools
Backward compatible: No includeTools = all tools (current behavior)
Happy to submit a PR for this if the approach is acceptable. We're tracking this in aidevops and can implement a workaround in the meantime, but native OpenCode support would be cleaner.
Thanks @Nindaleth — I hadn't seen that land. The tools config with glob patterns does cover the core use case.
The one ergonomic difference: the current approach requires two config blocks (disable globally in tools, re-enable per agent), whereas includeTools on the MCP definition itself would be a single declaration of intent. But that's a minor DX preference, not a missing capability.
Activity
github-actions commentedon Jan 9, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
docs(build-agent): add mcp_requirements frontmatter convention
marcusquinn commentedon Jan 9, 2026
Thanks for flagging these! After reviewing:
The gap this issue fills:
All existing issues address enabling/disabling entire MCP servers. None address filtering which tools within an MCP are loaded.
Example: chrome-devtools MCP has 26 tools. With existing features, I can:
With
includeTools, I could load only 4 specific tools (~1.5k tokens) - a 91% token reduction while keeping the functionality I need.This is complementary to per-agent MCP enabling (#2953, #5373) - you'd use both together for maximum control.
docs(build-agent): add mcp_requirements frontmatter convention (#16)
docs(build-agent): add mcp_requirements frontmatter convention (#51)
Nindaleth commentedon Feb 28, 2026
Per-MCP per-tool toggling is already available, is there anything you're still missing?
marcusquinn commentedon Mar 1, 2026
Thanks @Nindaleth — I hadn't seen that land. The
toolsconfig with glob patterns does cover the core use case.The one ergonomic difference: the current approach requires two config blocks (disable globally in
tools, re-enable per agent), whereasincludeToolson the MCP definition itself would be a single declaration of intent. But that's a minor DX preference, not a missing capability.Happy to close this — the functionality is there.
github-actions commentedon May 1, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.