fix(mcp): use native binary for TRAE on Windows
This commit is contained in:
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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in new issue
Block a user