Skip to content

[Story] Per-server onlyAllow field in MCP config #571

Open

Description

@edelauna

Context

Some MCP servers expose 100+ tools, but a user typically wants only a handful. Today the only way to limit them is `disabledTools`, which becomes an unwieldy 97-entry denylist when you want to enable just 3 tools.

Closes: RooCodeInc/Roo-Code#11971.

This is also the first scoping primitive that the dynamic tool loading work depends on — it shrinks the candidate pool the ranker has to search.

Developer Notes

  • Add `onlyAllow?: string[]` to the per-server MCP config schema (`packages/types/src/mcp.ts`).
  • When `onlyAllow` is set and non-empty: enable only the listed tools (`enabledForPrompt: true`); disable all other tools on that server. Takes precedence over `disabledTools` on the same server.
  • When unset or empty: existing `disabledTools` behavior is unchanged.
  • Apply the filter in `McpHub.fetchToolsList()` (`src/services/mcp/McpHub.ts`) where `enabledForPrompt` is set.
  • Update the MCP settings UI (`webview-ui/src/components/mcp/McpView.tsx`) to surface the field.

Acceptance Criteria

  • `onlyAllow` field added to MCP server config schema
  • Unit test: `onlyAllow: [a, b]` with `disabledTools: [a]` → `a` is enabled (onlyAllow wins), `b` is enabled, all others disabled
  • Unit test: `onlyAllow` unset → `disabledTools` behavior unchanged
  • MCP settings UI exposes the field

Activity

  1. changed the title [-][Story] W0.1 — Per-server onlyAllow field in MCP config[/-] [+][Story] Per-server onlyAllow field in MCP config[/+] on Jun 11, 2026
  2. thigger commented on Oct 13, 2026

    @thigger

    I came to add a feature request for exactly this. I added the Forgejo mcp server ("@ric_/forgejo-mcp") and it's just updated itself and added even more tools; I've only just finished clicking through and manually disabling approximately 440 tools in order to get the few that I actually want the model to use. There doesn't appear to be a better way than this via json or UI.
    Even a button in the UI for "disable all", that would then let me click the few I want, would be better than the current state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions