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",