-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Description
Problem (one or two sentences)
Currently, Roo Code lacks the ability to restrict which MCP servers are loaded on a per-mode basis. If a custom mode includes the "mcp" permission in its tool groups, Roo Code injects the descriptions and schemas for all globally and project-enabled MCP servers directly into the system prompt.
This brute-force approach causes severe issues:
Context Bloat: Dumping massive tool schemas into the prompt wastes thousands of tokens per request and degrades the model's reasoning capabilities.
Hard Tool Limits: Strict tool limits on modern models (e.g., the 128-tool limit) are easily exhausted when running multiple robust MCP servers simultaneously, causing API calls to outright fail.
Lack of Isolation: Specialized modes (e.g., a pure "Database Mode" or "Documentation Mode") get polluted with unrelated development tools, breaking the single-responsibility principle of Custom Modes.
Context (who is affected and when)
Happens for me when I want to use GPT5.4 which has a tool limit of 128.
Desired behavior (conceptual, not technical)
I would like the ability to explicitly whitelist or blacklist specific MCP servers within a custom mode's configuration (via .roomodes or the Custom Mode UI).
For example, adding an allowed_mcps or blocked_mcps array to the mode definition:
JSON
{
"customModes": [
{
"slug": "database-architect",
"name": "Database Architect",
"roleDefinition": "You manage the database schema...",
"groups": ["read", "edit", "mcp"],
"allowed_mcps": ["postgres-mcp", "redis-mcp"]
}
]
}
If allowed_mcps is defined, Roo Code should only inject the schemas for those specific servers into the system prompt for that mode, ignoring all other enabled MCPs.
Constraints / preferences (optional)
No response
Request checklist
- I've searched existing Issues and Discussions for duplicates
- This describes a specific problem with clear context and impact
Roo Code Task Links (optional)
No response
Acceptance criteria (optional)
No response
Proposed approach (optional)
No response
Trade-offs / risks (optional)
No response