Skip to content

feat(mcp): manage user MCP servers per provider and per agent #1143

Closed

Description

@Juliusolsson05

Motivation

Agent Code cannot add, configure, or switch off third-party MCP servers. To use one (for example Beeper Desktop's MCP server), a user has to hand-edit ~/.claude.json / ~/.codex/config.toml or run claude mcp add / codex mcp add outside the app. The server then attaches to every agent of that provider, cannot be turned off for one agent, and never appears in Agent Code.

This is the configuration layer that #244 (Agent Code-hosted extension MCP servers) also needs. It complements provider enablement (#1126): that feature chooses which providers exist, and this one chooses which user MCP servers each provider gets.

Intended behavior

  • Any MCP server: stdio, Streamable HTTP, or SSE (SSE is Claude-only). Configs are entered by pasting the standard mcpServers snippet that server READMEs publish; the VS Code servers/inputs form is also accepted.
  • Secrets: stored with Electron safeStorage and referenced as ${input:id}. They never appear in argv, the renderer, or the stored JSON.
  • Three toggle levels:
    • a master on/off switch per server;
    • a default attachment per provider (Claude, Codex);
    • a per-agent override, which applies on reload.
  • Delivery at launch only: servers are added through the same path as Agent Code's built-in MCP. For Claude that is the private --mcp-config file; for Codex it is -c mcp_servers.* with secrets passed through env. Provider config files are never written.
  • A bad or unready server never fails an agent launch. It is dropped for that launch, and the agent shows a notice.
  • UI:
    • a new Settings → MCP page, which also takes over the existing built-in MCP rows;
    • commands MCP Servers…, Add MCP Server… and Agent MCP Servers….
  • OAuth is handled by each CLI: codex mcp login for Codex, /mcp for Claude.

Design: docs/superpowers/specs/2026-09-22-user-mcp-servers-design.md
Plan: docs/superpowers/plans/2026-09-22-user-mcp-servers.md
(branch feat/user-mcp-servers)

Acceptance criteria

  • Pasting Beeper's official token snippet creates the http server beeper with a secret input. No token is written to disk in plaintext.
  • A new Claude agent's private MCP config contains beeper with a generated-env header, and a new Codex agent's argv contains mcp_servers.beeper.url plus env_http_headers. The token appears in neither argv.
  • A per-agent off override plus a reload removes the server from that agent. The master switch off wins over any per-agent on.
  • A stdio server (npx -y @beeper/mcp-remote) works on both providers. An SSE server offers Claude only, with the reason shown.
  • Reserved names (agent_code, agent-code-control) are rejected.
  • A name that collides with the user's native Codex config is skipped for Codex, with a visible reason.
  • A missing secret, or an invalid server, never blocks an agent from launching.
  • Settings → MCP shows provider columns only for providers enabled in Settings → Providers.

Out of scope (follow-ups)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions