Skip to content

[FR] Bulk-assign local MCP servers across agents (apply-to-all / select-all) #884

Open

Description

@j1749772215-pixel

Problem

Settings → MCP → Local MCP assigns servers one agent at a time. Each server card carries a per-app checkbox row, and every tick is an individual write. The cost scales as O(servers × agents):

  • adding one new agent to an existing setup means ticking every server card once
  • adding one new server means ticking every agent card once

With a double-digit number of local servers and several enabled agents, that is dozens of clicks for what is conceptually a single decision ("this set of servers belongs to my whole toolbox").

Request

Any bulk affordance would help, e.g.:

  • an "Apply to all agents" / "Apply to all enabled agents" action on a server card
  • a "select all / clear" control on the per-app checkbox row
  • the inverse direction: a per-agent "assign all local servers" action on that agent's own settings page

A confirmation step is fine; a preview of which agents would end up unassigned (see below) would be better.

Implementation context — why this is not just a button

Assignments are not stored centrally. The scan in src-tauri/src/commands/mcp.rs merges per-agent readers (local_mcp_readers → scan_local_servers_from_readers), so a server's Enabled Apps row is derived from the presence of that entry in each agent's own config file — ~/.claude.json, ~/.codex/config.toml, ~/.grok/config.toml, $DSH_HOME/mcp.json, … 15 apps in ALL_MCP_APPS, several unrelated file formats (JSON, TOML, YAML, gemini-schema, Cline's private shape).

Two consequences a bulk action has to respect:

  1. mcp_set_server_apps / mcp_upsert_local_server mean "these apps and NO others" — every agent left out of the list gets the server removed. A bulk apply is therefore N upserts plus (M−N) removals, not N upserts.
  2. app_can_host_spec excludes pairs an app cannot represent — e.g. SSE is rejected for Codex, and for DeepSeek the bridge explicitly rejects it (dsh-mcp-client has only stdio and streamable-http, and a rejected server fails session/new rather than being skipped). A blanket "apply to all" that ignores this would break sessions instead of degrading gracefully.

require_complete_scan already guards the analogous case on the single-agent path: if any agent's config cannot be read, the write is refused rather than acting on an incomplete picture. A bulk action must keep that guarantee — it matters more there, since one unreadable file would otherwise turn a bulk apply into a mass-removal.

Related

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions