Skip to content

refactor(extension): remove dead MCP toggle plumbing#336

Open
FlyM1ss wants to merge 1 commit into
security/extension-post-ssefrom
refactor/remove-mcp-toggle
Open

refactor(extension): remove dead MCP toggle plumbing#336
FlyM1ss wants to merge 1 commit into
security/extension-post-ssefrom
refactor/remove-mcp-toggle

Conversation

@FlyM1ss

@FlyM1ss FlyM1ss commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

What

MCP is now the default for every agent, so the client-side "MCP Mode" toggle is obsolete. Its UI was already disabled (commented out) in an earlier cleanup, which meant useMCP was hardwired to false at every call site. This PR removes the resulting dead plumbing.

Why now

The toggle predates MCP being always-on. Because document.getElementById('mcpModeSwitch') returns null (the control is commented out), useMCP could never be true. The leftover code was actively misleading:

  • an unreachable if (useMCP) branch in getChatResponseStream that routed to the non-streaming path — i.e. it would have disabled streaming if the toggle ever came back;
  • a "MCP mode doesn't support streaming yet" comment describing code that can never run;
  • a !useMCP term in the streaming gate and a 'MCP mode' status label that can never show.

Changes

  • api.js — drop the useMCP param from getChatResponse / getChatResponseStream; delete the unreachable if (useMCP) non-streaming branch; correct the endpoint comment.
  • handlers.js — drop the mcpModeSwitch read, the !useMCP term in canStream, the 'MCP mode' detail label, and the useMCP argument at all call sites (including createActionButtons).
  • settings_window.js — delete the commented-out MCP toggle tombstone.

Scope / safety

Verification

  • bun test — 55 pass, no new failures.
  • bun run build:full — webpack compiles clean; dist/main.js contains zero useMCP / mcpModeSwitch references.

⚠️ Note (pre-existing, out of scope): 2 markdownRenderer DOMPurify XSS-sanitizer tests fail identically on the base branch security/extension-post-sse with this diff stashed. They live in code this PR never touches. Flagging so it isn't mistaken for a regression here.

🤖 Generated with Claude Code

The MCP mode toggle UI was disabled (commented out) in an earlier
cleanup, so `document.getElementById('mcpModeSwitch')` always returned
null and `useMCP` was hardwired to false at every call site. MCP is now
the default for all agents: the LLM runs with the MCP tools server-side
on the standard chat endpoints, so there is no client-side mode to pick.

Remove the now-dead plumbing:
- api.js: drop the `useMCP` param from getChatResponse /
  getChatResponseStream and the unreachable `if (useMCP)` branch, which
  also silently disabled streaming whenever the toggle was set.
- handlers.js: drop the mcpModeSwitch read, the `!useMCP` term in the
  streaming gate, the 'MCP mode' status label, and the useMCP argument
  at every call site.
- settings_window.js: delete the commented-out MCP toggle tombstone.

RAG is left untouched (a separately parked feature). No behavior change:
useMCP was always false, so no reachable code path is altered.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant