fix(mcp): use native binary for TRAE on Windows

This commit is contained in:
t8y2 committed 2026-07-22 13:31:23 +08:00
1 parent 4e68cd84cc
commit 01fde8879f
6 files changed
+124 -10

No files matched your search

@@ -1,5 +1,5 @@
import { describe, expect, it } from "vitest";
import { buildMcpCherryStudioConfig, buildMcpCodexConfig, buildMcpJsonConfig, buildMcpOpenCodeConfig, buildMcpVsCodeConfig, mcpWebBackendUrl } from "@/lib/mcp/mcpConfigTemplates";
import { buildMcpCherryStudioConfig, buildMcpCodexConfig, buildMcpJsonConfig, buildMcpOpenCodeConfig, buildMcpTraeConfig, buildMcpVsCodeConfig, mcpWebBackendUrl } from "@/lib/mcp/mcpConfigTemplates";
describe("MCP config templates", () => {
it("builds the standard mcpServers JSON used by Claude, Cursor, TRAE, and Windsurf", () => {
@@ -27,6 +27,21 @@ describe("MCP config templates", () => {
});
});
it("uses the native binary for TRAE when Windows Node lives under Program Files", () => {
const nodeLaunch = {
command: "C:\\Program Files\\nodejs\\node.exe",
args: ["C:\\Users\\supervisor\\AppData\\Roaming\\npm\\node_modules\\@dbx-app\\mcp-server\\bin\\dbx-mcp-server.js"],
};
const nativeBinPath = "C:\\Users\\supervisor\\AppData\\Roaming\\npm\\node_modules\\@dbx-app\\mcp-win32-x64\\bin\\dbx-mcp.exe";
expect(JSON.parse(buildMcpTraeConfig(nodeLaunch, nativeBinPath))).toEqual({
mcpServers: { dbx: { command: nativeBinPath } },
});
expect(JSON.parse(buildMcpTraeConfig(nodeLaunch))).toEqual({
mcpServers: { dbx: nodeLaunch },
});
});
it("includes Web runtime settings without restoring permission environment variables", () => {
const launch = {
command: "dbx-mcp-server",
+1
View File
@@ -2306,6 +2306,7 @@ export async function checkMcpServerStatus(): Promise<import("@/lib/backend/taur
latest_version: null,
update_available: false,
bin_path: null,
native_bin_path: null,
script_path: null,
install_command: "npm install -g @dbx-app/mcp-server@latest --registry=https://registry.npmjs.org",
update_command: "npm install -g @dbx-app/mcp-server@latest --registry=https://registry.npmjs.org",
+1
View File
@@ -1449,6 +1449,7 @@ export interface McpServerStatus {
latest_version: string | null;
update_available: boolean;
bin_path: string | null;
native_bin_path: string | null;
script_path: string | null;
install_command: string;
update_command: string;
@@ -40,6 +40,10 @@ export function buildMcpJsonConfig(config?: McpLaunchConfig): string {
return JSON.stringify({ mcpServers: { dbx } }, null, 2);
}
export function buildMcpTraeConfig(config?: McpLaunchConfig, nativeBinPath?: string): string {
return buildMcpJsonConfig(nativeBinPath ? { command: nativeBinPath } : config);
}
export function buildMcpVsCodeConfig(config?: McpLaunchConfig): string {
const dbx: Record<string, unknown> = {
type: "stdio",