mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-21 21:24:46 +08:00
feat: support settings
This commit is contained in:
24
frontend/src/core/mcp/api.ts
Normal file
24
frontend/src/core/mcp/api.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { env } from "@/env";
|
||||
|
||||
import type { MCPConfig } from "./types";
|
||||
|
||||
export async function loadMCPConfig() {
|
||||
const response = await fetch(
|
||||
`${env.NEXT_PUBLIC_BACKEND_BASE_URL}/api/mcp/config`,
|
||||
);
|
||||
return response.json() as Promise<MCPConfig>;
|
||||
}
|
||||
|
||||
export async function updateMCPConfig(config: MCPConfig) {
|
||||
const response = await fetch(
|
||||
`${env.NEXT_PUBLIC_BACKEND_BASE_URL}/api/mcp/config`,
|
||||
{
|
||||
method: "PUT",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(config),
|
||||
},
|
||||
);
|
||||
return response.json();
|
||||
}
|
||||
Reference in New Issue
Block a user