mcp: fix tests changing new default mcp endpoint

This commit is contained in:
dswbx
2025-08-30 14:08:20 +02:00
parent 24eefa5357
commit 5a27c41516
2 changed files with 4 additions and 1 deletions

View File

@@ -15,6 +15,7 @@ describe("AppServer", () => {
}, },
mcp: { mcp: {
enabled: false, enabled: false,
path: "/api/system/mcp",
}, },
}); });
} }
@@ -36,6 +37,7 @@ describe("AppServer", () => {
}, },
mcp: { mcp: {
enabled: false, enabled: false,
path: "/api/system/mcp",
}, },
}); });
} }

View File

@@ -293,9 +293,10 @@ export class App<C extends Connection = Connection, Options extends AppOptions =
if (!this.mcp) { if (!this.mcp) {
throw new Error("MCP is not enabled"); throw new Error("MCP is not enabled");
} }
const mcpPath = this.modules.get("server").config.mcp.path;
return new McpClient({ return new McpClient({
url: "http://localhost/mcp", url: "http://localhost" + mcpPath,
fetch: this.server.request, fetch: this.server.request,
}); });
} }