From 2fee435b3308b6c98e9a1f3341a98f3e05fe1035 Mon Sep 17 00:00:00 2001 From: t8y2 <1156263951@qq.com> Date: Sat, 22 Aug 2026 11:11:17 +0000 Subject: [PATCH] feat(mcp): add ZCode configuration guidance Closes #6763 --- .../components/editor/EditorSettingsDialog.vue | 18 +++++++++++++++++- apps/desktop/src/i18n/locales/en.ts | 1 + apps/desktop/src/i18n/locales/es.ts | 1 + apps/desktop/src/i18n/locales/it.ts | 1 + apps/desktop/src/i18n/locales/ja.ts | 1 + apps/desktop/src/i18n/locales/ko.ts | 1 + apps/desktop/src/i18n/locales/pt-BR.ts | 1 + apps/desktop/src/i18n/locales/zh-CN.ts | 1 + apps/desktop/src/i18n/locales/zh-TW.ts | 1 + .../__tests__/mcp/mcpConfigTemplates.spec.ts | 12 ++++++++++++ .../__tests__/mcp/mcpPolicySelection.spec.ts | 13 ++++++++++++- 11 files changed, 49 insertions(+), 2 deletions(-) diff --git a/apps/desktop/src/components/editor/EditorSettingsDialog.vue b/apps/desktop/src/components/editor/EditorSettingsDialog.vue index 673c772ea1..ca0251bbe0 100644 --- a/apps/desktop/src/components/editor/EditorSettingsDialog.vue +++ b/apps/desktop/src/components/editor/EditorSettingsDialog.vue @@ -1825,7 +1825,7 @@ async function exportDebugLogs() { } // ---------- MCP Server ---------- -type McpConfigTab = "claude" | "cursor" | "codebuddy" | "trae" | "vscode" | "windsurf" | "codex" | "deepseek-harness" | "opencode" | "pi" | "cherry-studio"; +type McpConfigTab = "claude" | "cursor" | "codebuddy" | "zcode" | "trae" | "vscode" | "windsurf" | "codex" | "deepseek-harness" | "opencode" | "pi" | "cherry-studio"; type McpCopyKind = "install" | "uninstall" | `${McpConfigTab}-config`; const mcpStatus = ref(null); @@ -6673,6 +6673,7 @@ onUnmounted(() => { Claude Code Cursor CodeBuddy Code + ZCode TRAE VS Code Windsurf @@ -6723,6 +6724,21 @@ onUnmounted(() => { + +
+
+ {{ t("settings.mcpZCodeConfigPath") }} +
+
+
{{ mcpJsonRecommendedConfig }}
+ +
+
+
+
diff --git a/apps/desktop/src/i18n/locales/en.ts b/apps/desktop/src/i18n/locales/en.ts index f897a5e161..98c6c4648f 100644 --- a/apps/desktop/src/i18n/locales/en.ts +++ b/apps/desktop/src/i18n/locales/en.ts @@ -6565,6 +6565,7 @@ export default { mcpDeepSeekHarnessConfigPath: "For dsh web, merge this insert entry into $DSH_HOME/profiles/web/cordis.patch.yml; replace web for another profile. Do not overwrite existing patch entries. Verify with dsh web --dump-config or let HMR reload the change.", mcpCursorConfigPath: "Cursor can use .cursor/mcp.json in the project or ~/.cursor/mcp.json globally.", mcpCodeBuddyConfigPath: "CodeBuddy Code can use ~/.codebuddy/.mcp.json globally or .mcp.json in the project.", + mcpZCodeConfigPath: "ZCode: Settings > MCP Servers > New MCP Server > Full configuration; choose the User or Workspace scope, then paste the JSON configuration.", mcpTraeConfigPath: "TRAE: Settings > MCP > Add > Add Manually, then paste the JSON configuration.", mcpCherryStudioConfigPath: "Cherry Studio: Settings > MCP Servers > Add Server > Import JSON, then paste the configuration.", mcpVsCodeConfigPath: "VS Code/Copilot can use .vscode/mcp.json in the workspace or mcp.json in the user profile.", diff --git a/apps/desktop/src/i18n/locales/es.ts b/apps/desktop/src/i18n/locales/es.ts index 08bbef154a..6af0ba820d 100644 --- a/apps/desktop/src/i18n/locales/es.ts +++ b/apps/desktop/src/i18n/locales/es.ts @@ -6239,6 +6239,7 @@ export default withEnglishFallback({ mcpDeepSeekHarnessConfigPath: "Para dsh web, combina esta entrada insert con $DSH_HOME/profiles/web/cordis.patch.yml; sustituye web para otro perfil. No sobrescribas las entradas patch existentes. Verifica con dsh web --dump-config o deja que HMR recargue el cambio.", mcpCursorConfigPath: "Cursor puede usar .cursor/mcp.json en el proyecto o ~/.cursor/mcp.json globalmente.", mcpCodeBuddyConfigPath: "CodeBuddy Code puede usar ~/.codebuddy/.mcp.json globalmente o .mcp.json en el proyecto.", + mcpZCodeConfigPath: "ZCode: Configuración > Servidores MCP > Nuevo servidor MCP > Configuración completa; elige el ámbito Usuario o Espacio de trabajo y pega la configuración JSON.", mcpTraeConfigPath: "TRAE: Configuración > MCP > Agregar > Agregar manualmente; luego pega la configuración JSON.", mcpCherryStudioConfigPath: "Cherry Studio: Configuración > Servidores MCP > Agregar servidor > Importar JSON; luego pega la configuración.", mcpVsCodeConfigPath: "VS Code/Copilot puede usar .vscode/mcp.json en el espacio de trabajo o mcp.json en el perfil de usuario.", diff --git a/apps/desktop/src/i18n/locales/it.ts b/apps/desktop/src/i18n/locales/it.ts index b15f8604c5..ba24e0fcc3 100644 --- a/apps/desktop/src/i18n/locales/it.ts +++ b/apps/desktop/src/i18n/locales/it.ts @@ -6239,6 +6239,7 @@ export default withEnglishFallback({ mcpDeepSeekHarnessConfigPath: "Per dsh web, unisci questa voce insert a $DSH_HOME/profiles/web/cordis.patch.yml; sostituisci web per un altro profilo. Non sovrascrivere le voci patch esistenti. Verifica con dsh web --dump-config oppure lascia che HMR ricarichi la modifica.", mcpCursorConfigPath: "Cursor può usare .cursor/mcp.json nel progetto o ~/.cursor/mcp.json globalmente.", mcpCodeBuddyConfigPath: "CodeBuddy Code può usare ~/.codebuddy/.mcp.json globalmente oppure .mcp.json a livello di progetto.", + mcpZCodeConfigPath: "ZCode: Impostazioni > Server MCP > Nuovo server MCP > Configurazione completa; scegli l'ambito Utente o Area di lavoro, quindi incolla la configurazione JSON.", mcpTraeConfigPath: "TRAE: Impostazioni > MCP > Aggiungi > Aggiungi manualmente, poi incolla la configurazione JSON.", mcpCherryStudioConfigPath: "Cherry Studio: Impostazioni > Server MCP > Aggiungi server > Importa JSON, quindi incolla la configurazione.", mcpVsCodeConfigPath: "VS Code/Copilot può usare .vscode/mcp.json nell'area di lavoro o mcp.json nel profilo utente.", diff --git a/apps/desktop/src/i18n/locales/ja.ts b/apps/desktop/src/i18n/locales/ja.ts index dd9436bd16..a2097b00bd 100644 --- a/apps/desktop/src/i18n/locales/ja.ts +++ b/apps/desktop/src/i18n/locales/ja.ts @@ -6253,6 +6253,7 @@ export default withEnglishFallback({ mcpDeepSeekHarnessConfigPath: "dsh web では、この insert エントリを $DSH_HOME/profiles/web/cordis.patch.yml に追加します。別の profile では web を置き換えてください。既存の patch エントリは上書きしないでください。dsh web --dump-config で確認するか、HMR で変更を再読み込みできます。", mcpCursorConfigPath: "Cursorはプロジェクトの .cursor/mcp.json またはグローバル ~/.cursor/mcp.json を使用できます。", mcpCodeBuddyConfigPath: "CodeBuddy Codeはグローバル ~/.codebuddy/.mcp.json またはプロジェクトレベルの .mcp.json を使用できます。", + mcpZCodeConfigPath: "ZCode:設定 > MCP サーバー > 新しい MCP サーバー > 完全な設定を開き、ユーザーまたはワークスペースのスコープを選択して JSON 設定を貼り付けます。", mcpTraeConfigPath: "TRAE: 設定 > MCP > 追加 > 手動で追加 からJSON設定を貼り付けます。", mcpCherryStudioConfigPath: "Cherry Studio: 設定 > MCPサーバー > サーバーを追加 > JSONをインポート から設定を貼り付けます。", mcpVsCodeConfigPath: "VS Code/Copilotはワークスペースの .vscode/mcp.json またはユーザープロファイルの mcp.json を使用できます。", diff --git a/apps/desktop/src/i18n/locales/ko.ts b/apps/desktop/src/i18n/locales/ko.ts index 19c4be5af4..3f1174ec4e 100644 --- a/apps/desktop/src/i18n/locales/ko.ts +++ b/apps/desktop/src/i18n/locales/ko.ts @@ -5973,6 +5973,7 @@ export default withEnglishFallback({ mcpDeepSeekHarnessConfigPath: "dsh web에서는 이 insert 항목을 $DSH_HOME/profiles/web/cordis.patch.yml에 병합하세요. 다른 profile은 web을 바꾸면 됩니다. 기존 patch 항목을 덮어쓰지 마세요. dsh web --dump-config로 확인하거나 HMR로 변경 사항을 다시 불러올 수 있습니다.", mcpCursorConfigPath: "Cursor는 프로젝트의 .cursor/mcp.json 또는 전역 ~/.cursor/mcp.json을 사용할 수 있습니다.", mcpCodeBuddyConfigPath: "CodeBuddy Code는 전역 ~/.codebuddy/.mcp.json 또는 프로젝트의 .mcp.json을 사용할 수 있습니다.", + mcpZCodeConfigPath: "ZCode: 설정 > MCP 서버 > 새 MCP 서버 > 전체 구성에서 사용자 또는 작업 영역 범위를 선택한 다음 JSON 구성을 붙여넣으세요.", mcpTraeConfigPath: "TRAE: 설정 > MCP > 추가 > 수동 추가 후 JSON 설정을 붙여넣으세요.", mcpCherryStudioConfigPath: "Cherry Studio: 설정 > MCP 서버 > 서버 추가 > JSON 가져오기 후 설정을 붙여넣으세요.", mcpVsCodeConfigPath: "VS Code/Copilot은 작업 영역의 .vscode/mcp.json 또는 사용자 프로필의 mcp.json을 사용할 수 있습니다.", diff --git a/apps/desktop/src/i18n/locales/pt-BR.ts b/apps/desktop/src/i18n/locales/pt-BR.ts index 0f1c39f0d4..7d7efb8282 100644 --- a/apps/desktop/src/i18n/locales/pt-BR.ts +++ b/apps/desktop/src/i18n/locales/pt-BR.ts @@ -6241,6 +6241,7 @@ export default withEnglishFallback({ mcpDeepSeekHarnessConfigPath: "No dsh web, mescle esta entrada insert em $DSH_HOME/profiles/web/cordis.patch.yml; substitua web para outro perfil. Não sobrescreva as entradas patch existentes. Verifique com dsh web --dump-config ou deixe o HMR recarregar a alteração.", mcpCursorConfigPath: "O Cursor pode usar .cursor/mcp.json no projeto ou ~/.cursor/mcp.json globalmente.", mcpCodeBuddyConfigPath: "O CodeBuddy Code pode usar ~/.codebuddy/.mcp.json globalmente ou .mcp.json no nível do projeto.", + mcpZCodeConfigPath: "ZCode: Configurações > Servidores MCP > Novo servidor MCP > Configuração completa; escolha o escopo Usuário ou Espaço de trabalho e cole a configuração JSON.", mcpTraeConfigPath: "TRAE: Configurações > MCP > Adicionar > Adicionar manualmente; depois cole a configuração JSON.", mcpCherryStudioConfigPath: "Cherry Studio: Configurações > Servidores MCP > Adicionar servidor > Importar JSON; depois cole a configuração.", mcpVsCodeConfigPath: "O VS Code/Copilot pode usar .vscode/mcp.json no workspace ou mcp.json no perfil do usuário.", diff --git a/apps/desktop/src/i18n/locales/zh-CN.ts b/apps/desktop/src/i18n/locales/zh-CN.ts index 33c96e7b2f..150d82fa3c 100644 --- a/apps/desktop/src/i18n/locales/zh-CN.ts +++ b/apps/desktop/src/i18n/locales/zh-CN.ts @@ -6553,6 +6553,7 @@ export default withEnglishFallback({ mcpDeepSeekHarnessConfigPath: "dsh web:将此 insert 条目合并到 $DSH_HOME/profiles/web/cordis.patch.yml;其他 profile 请替换 web。不要覆盖已有 patch 条目。可用 dsh web --dump-config 验证,或等待 HMR 热加载。", mcpCursorConfigPath: "Cursor 可放在项目级 .cursor/mcp.json 或全局 ~/.cursor/mcp.json。", mcpCodeBuddyConfigPath: "CodeBuddy Code 可使用全局 ~/.codebuddy/.mcp.json 或项目级 .mcp.json。", + mcpZCodeConfigPath: "ZCode:设置 > MCP 服务器 > 新建 MCP 服务器 > 完整配置,选择用户或工作区作用域后粘贴 JSON 配置。", mcpTraeConfigPath: "TRAE:设置 > MCP > 添加 > 手动添加,然后粘贴 JSON 配置。", mcpCherryStudioConfigPath: "Cherry Studio:设置 > MCP 服务器 > 添加服务器 > 导入 JSON,然后粘贴配置。", mcpVsCodeConfigPath: "VS Code/Copilot 可放在工作区 .vscode/mcp.json 或用户配置文件 mcp.json。", diff --git a/apps/desktop/src/i18n/locales/zh-TW.ts b/apps/desktop/src/i18n/locales/zh-TW.ts index 7222579e11..70df83358e 100644 --- a/apps/desktop/src/i18n/locales/zh-TW.ts +++ b/apps/desktop/src/i18n/locales/zh-TW.ts @@ -5584,6 +5584,7 @@ export default withEnglishFallback({ mcpDeepSeekHarnessConfigPath: "dsh web:將此 insert 條目合併到 $DSH_HOME/profiles/web/cordis.patch.yml;其他 profile 請替換 web。不要覆蓋現有 patch 條目。可用 dsh web --dump-config 驗證,或等待 HMR 熱載入。", mcpCursorConfigPath: "Cursor 可放在專案級 .cursor/mcp.json 或全域 ~/.cursor/mcp.json。", mcpCodeBuddyConfigPath: "CodeBuddy Code 可使用全域 ~/.codebuddy/.mcp.json 或專案級 .mcp.json。", + mcpZCodeConfigPath: "ZCode:設定 > MCP 伺服器 > 新增 MCP 伺服器 > 完整設定,選擇使用者或工作區範圍後貼上 JSON 設定。", mcpTraeConfigPath: "TRAE:設定 > MCP > 新增 > 手動新增,然後貼上 JSON 設定。", mcpCherryStudioConfigPath: "Cherry Studio:設定 > MCP 伺服器 > 新增伺服器 > 匯入 JSON,然後貼上設定。", mcpVsCodeConfigPath: "VS Code/Copilot 可放在工作區 .vscode/mcp.json 或使用者設定檔 mcp.json。", diff --git a/apps/desktop/src/lib/__tests__/mcp/mcpConfigTemplates.spec.ts b/apps/desktop/src/lib/__tests__/mcp/mcpConfigTemplates.spec.ts index 450227c0bb..3a7e8bc28d 100644 --- a/apps/desktop/src/lib/__tests__/mcp/mcpConfigTemplates.spec.ts +++ b/apps/desktop/src/lib/__tests__/mcp/mcpConfigTemplates.spec.ts @@ -14,6 +14,18 @@ describe("MCP config templates", () => { }); }); + it("preserves the standard mcpServers launch config for ZCode full configuration", () => { + const launch = { + command: "node", + args: ["C:\\dbx\\mcp\\dist\\index.js"], + env: { DBX_DATA_DIR: "D:\\DBX Data" }, + }; + const config = JSON.parse(buildMcpJsonConfig(launch)); + + expect(config).toEqual({ mcpServers: { dbx: launch } }); + expect(config).not.toHaveProperty("mcp"); + }); + it("builds the standard mcpServers JSON used by the Pi agent", () => { expect(JSON.parse(buildMcpPiConfig())).toEqual({ mcpServers: { diff --git a/apps/desktop/src/lib/__tests__/mcp/mcpPolicySelection.spec.ts b/apps/desktop/src/lib/__tests__/mcp/mcpPolicySelection.spec.ts index 95f3f4c27f..5aecb8b431 100644 --- a/apps/desktop/src/lib/__tests__/mcp/mcpPolicySelection.spec.ts +++ b/apps/desktop/src/lib/__tests__/mcp/mcpPolicySelection.spec.ts @@ -123,9 +123,10 @@ describe("MCP policy settings state", () => { expect(tabsSource).toContain("overscroll-x-contain"); expect(tabsSource).not.toContain("flex-wrap"); expect(tabsSource).not.toContain("grid-cols-"); - expect(tabsSource.match(/flex-none shrink-0/g)).toHaveLength(11); + expect(tabsSource.match(/flex-none shrink-0/g)).toHaveLength(12); expect(tabsSource).toContain(' { expect(codeBuddySource).toContain("settings.mcpCodeBuddyConfigPath"); expect(codeBuddySource).toContain("mcpJsonRecommendedConfig"); expect(codeBuddySource).toContain("copyMcpText('codebuddy-config', mcpJsonRecommendedConfig)"); + + const zCodeStart = settingsDialogSource.indexOf('", zCodeStart); + const zCodeSource = settingsDialogSource.slice(zCodeStart, zCodeEnd); + + expect(zCodeStart).toBeGreaterThan(tabsEnd); + expect(zCodeEnd).toBeGreaterThan(zCodeStart); + expect(zCodeSource).toContain("settings.mcpZCodeConfigPath"); + expect(zCodeSource).toContain("mcpJsonRecommendedConfig"); + expect(zCodeSource).toContain("copyMcpText('zcode-config', mcpJsonRecommendedConfig)"); }); });