Repository navigation
fix(mcp): translate the org-blocked Claude line in the MCP server Agents list - #49243
Conversation
…nts list The Agents row in Settings > MCP servers (desktop and mobile) printed the host's English "Blocked by your organization's Claude settings" sentence in every UI language. Render that line from a locale key when the host reports Claude as blocked; any other problem keeps the host's own wording. Mobile now accepts problem kinds it doesn't know instead of coercing them to 'blocked', so a newer host's line is never replaced by the org-policy one. Fixes #49198
|
No actionable comments were generated in the recent review. Walkthrough
Severity of issue fixed: Low Merge Risk:
|
ELI5
When your company blocks Claude Code, Settings > MCP servers shows a short note under Claude in the Agents list. That note was always English, even when the rest of the page was in Chinese, Japanese, and so on. Now it shows in your app language.
What Changed
problem.detailas-is. For Claude that is a fixed English sentence fromsrc/main/mcp-servers/mcp-agent-problems.ts, so it was English in every language, on desktop and on mobile.kind: 'blocked', the row shows a localized string. Desktop usessettings.mcpServers.agents.blockedthrough a newmcpAgentProblemTexthelper inmcp-server-words.ts. Mobile usesmcpServers.agentBlocked. Other problems, such as theterminal-offreasons with version numbers, still show the host's own words.protected-copy-keys.json.'blocked'(z.enum([...]).catch('blocked')). Now it accepts any string, so a newer host's unknown kind keeps the host's line and doesn't get replaced by the org-policy text. The amber dot still shows for every kind exceptterminal-off, as it did before.Why
Only the blocked line is a fixed sentence the renderer can map from
kind+ agent, so translating it on the client needs no host change and works with older hosts and paired phones. Theterminal-offreasons are built on the host and include versions. Translating those would mean changing the host → renderer contract to send codes, which the issue leaves for a maintainer decision. They are out of scope here.Linked Issue
Fixes #49198
Visual Proof
Desktop Agents group with the UI language set to
zh, Claude blocked by org policy, and Pi interminal-off:Before (English line in a Chinese page):
After (localized line; Pi's host reason stays unchanged):
Testing
blocked. The Agents row showed "Blocked by your organization’s Claude settings" in English.main, after = this branch).vitestonmobile/src/mcp-servers,src/renderer/src/components/settings/mcp-servers, andprotected-copy-keys.test.mjsall pass.verify:localization-catalogs,verify:localization-protected-copy,verify:mobile-localization,verify:localization-runtime-catalog,verify:localization-extraction, mobiletsc --noEmit, oxlint (anti-slop, code-quality native plugins), ast-grep, changed-code-quality gate, oxfmt.Performance
None, because this only runs when the MCP server settings page (desktop or mobile) renders its Agents rows: one string comparison per row, plus one i18n lookup for a blocked Claude row. Microbench: about 5 ns per row before and after, which is noise.
Risk
Level: Low. The riskiest part is mobile's schema loosening
kindfrom an enum to a string. Older and newer hosts still parse. An unknown kind now shows the host's line with an amber dot instead of being treated asblocked. Back out with a plain revert.Reported by @Minidoracat