feat: support settings

This commit is contained in:
Henry Li
2026-01-20 23:43:21 +08:00
parent 7ead7c93f8
commit 1b70e00642
25 changed files with 1355 additions and 217 deletions

View 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();
}