deerflow / frontend /src /core /mcp /api.ts
pjpjq's picture
Deploy DeerFlow to Hugging Face Space
033ca06 verified
import { getBackendBaseURL } from "@/core/config";
import type { MCPConfig } from "./types";
export async function loadMCPConfig() {
const response = await fetch(`${getBackendBaseURL()}/api/mcp/config`);
return response.json() as Promise<MCPConfig>;
}
export async function updateMCPConfig(config: MCPConfig) {
const response = await fetch(`${getBackendBaseURL()}/api/mcp/config`,
{
method: "PUT",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(config),
},
);
return response.json();
}