chore(mcp): remove helpers and strings left unused by staged setup

Merged
DE
2d ago
+26-79

Description

Remove code that the staged MCP setup stack (#16419, #16413) left with no production callers:

  • mcpOAuthReturnHref in web/src/lib/plugins/routes.ts. Its only caller, the old admin OAuth start in MCPAuthenticationPage.tsx, was removed.
  • consumeMcpChatEnableIntent in web/src/sections/actions/mcpChatEnableIntent.ts. Its only caller, the onTriggerFetchTools handler in MCPPluginSetupModal.tsx, was removed. The private checkIntent helper is now inlined into verifyMcpChatEnableIntent. Behavior does not change.
  • The actions.mcpAuthModal.errors.oauthStage and discoveryStage strings in all 9 locale files. They were read only through t(`mcpAuthModal.errors.${connectionError.stage}`), and that call was removed.

Tests that used consumeMcpChatEnableIntent to check stored intent state now use verifyMcpChatEnableIntent.

How Has This Been Tested?

  • jest for mcpChatEnableIntent, plugin routes, MCPServerDetailPage, sections/actions/modals, and src/i18n: 214 tests passed.
  • bun run types:check, oxlint, oxfmt, and pre-commit hooks passed.

Additional Options

  • [Optional] Please cherry-pick this PR to the latest release version.

Link to Devin session: https://app.devin.ai/sessions/55fba60b72e94e1282b8d8caad16b371
Open in Devin Desktop: https://app.devin.ai/desktop/session/55fba60b72e94e1282b8d8caad16b371?variant=devin


Summary by cubic

Removes MCP helpers and locale strings left unused by the staged MCP setup stack.

  • consumeMcpChatEnableIntent becomes verifyMcpChatEnableIntent, which no longer deletes the stored proof after checking; callers clear it explicitly with clearMcpChatEnableIntent.
  • mcpOAuthReturnHref and the oauthStage/discoveryStage strings in all nine locale files had no remaining callers and are removed.
  • Tests that relied on consuming to expire proof now verify and clear separately.

Summary by CodeRabbit

  • Changes
    • MCP chat authorization checks can now be performed repeatedly during an authentication flow and remain valid until the flow is cancelled.
    • Cancelled or invalid authorization attempts continue to be rejected.
    • Removed obsolete MCP authentication error messages from supported language translations.
    • Removed the previous OAuth return-route behavior for automatically triggering plugin fetches and enabling chat.