feat(mcp): centralize connection access policies

This commit is contained in:
二丫讲梵 authored and GitHub committed 2026-07-20 22:47:40 +08:00
1 parent 29f493f7da
commit d642d01eac
56 files changed
+6393 -617

No files matched your search

+14
View File
@@ -54,6 +54,7 @@ import type {
UpgradeAllAgentDriversResult,
AgentUpdateBlocker,
DesktopSettings,
McpGlobalPolicy,
SavedSqlSyncRequest,
DriverInstallProgress,
JavaRuntimeConfig,
@@ -1167,6 +1168,19 @@ export async function saveDesktopSettings(settings: DesktopSettings): Promise<vo
safeLocalStorageSet(DESKTOP_SETTINGS_STORAGE_KEY, JSON.stringify({ ...DEFAULT_DESKTOP_SETTINGS, ...settings }));
}
export async function loadMcpGlobalPolicy(): Promise<McpGlobalPolicy> {
return get("/api/app-settings/mcp-policy");
}
export async function saveMcpGlobalPolicy(policy: Omit<McpGlobalPolicy, "configured">): Promise<void> {
const res = await fetch(apiUrl("/api/app-settings/mcp-policy"), {
method: "PUT",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(policy),
});
if (!res.ok) throw new Error(await res.text());
}
export interface OpenTabsStatePayload {
tabs: unknown[];
activeTabId: string | null;