fix: get backend url dynamically for mcp (#7878)

added check to use backend URL if baseURL is set (desktop)
This commit is contained in:
Lucas Oliveira 2025-05-02 17:27:36 -03:00 committed by GitHub
commit 940b1100ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3,6 +3,7 @@ import ShadTooltip from "@/components/common/shadTooltipComponent";
import ToolsComponent from "@/components/core/parameterRenderComponent/components/ToolsComponent";
import { Button } from "@/components/ui/button";
import { createApiKey } from "@/controllers/API";
import { api } from "@/controllers/API/api";
import {
useGetFlowsMCP,
usePatchFlowsMCP,
@ -61,7 +62,9 @@ const McpServerTab = ({ folderName }: { folderName: string }) => {
},
};
const apiUrl = `${PROXY_TARGET}/api/v1/mcp/project/${projectId}/sse`;
const apiHost = api.defaults.baseURL || window.location.origin;
const apiUrl = `${apiHost}/api/v1/mcp/project/${projectId}/sse`;
const MCP_SERVER_JSON = `{
"mcpServers": {