aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/ipc
diff options
context:
space:
mode:
authorClawd <ai@clawd.bot>2026-03-01 10:15:14 -0800
committerClawd <ai@clawd.bot>2026-03-01 10:15:14 -0800
commit044d628a47f063bcbbd9adba7860542156a0c66e (patch)
tree9796fa37fc048a9613710e13bdb6b0ea29caa6b1 /src/main/ipc
parent66a73c463468bfcaad5627ca26fb25215f47d256 (diff)
feat(mcp): add tool discovery and per-tool permissions
- Add MCP protocol client for tool discovery (initialize + tools/list) - Show discovered tools in settings UI with enable/disable checkboxes - Build explicit allowedTools list from enabled MCP tools - Remove bypassPermissions hack - now uses proper tool allowlisting - Format: mcp__servername__toolname for SDK allowedTools
Diffstat (limited to 'src/main/ipc')
-rw-r--r--src/main/ipc/handlers.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/ipc/handlers.ts b/src/main/ipc/handlers.ts
index e0863f3..4894e1d 100644
--- a/src/main/ipc/handlers.ts
+++ b/src/main/ipc/handlers.ts
@@ -4,6 +4,7 @@ import * as sessions from "../db/sessions";
4import * as claude from "../claude"; 4import * as claude from "../claude";
5import * as settingsDb from "../db/settings"; 5import * as settingsDb from "../db/settings";
6import { createSessionBranch, ensureGitIgnore, ensureGitRepo, getCurrentBranch } from "../git"; 6import { createSessionBranch, ensureGitIgnore, ensureGitRepo, getCurrentBranch } from "../git";
7import { discoverMcpTools } from "../mcp";
7import type { UserPermissionMode } from "../claude/phases"; 8import type { UserPermissionMode } from "../claude/phases";
8import { getDefaultSystemPromptTemplate } from "../claude/phases"; 9import { getDefaultSystemPromptTemplate } from "../claude/phases";
9 10
@@ -199,4 +200,15 @@ export function registerIpcHandlers(mainWindow: BrowserWindow): void {
199 }); 200 });
200 return result.canceled ? null : result.filePaths[0]; 201 return result.canceled ? null : result.filePaths[0];
201 }); 202 });
203
204 // MCP
205 ipcMain.handle("mcp:discoverTools", async (_, config: {
206 type: "stdio" | "sse" | "http";
207 command?: string;
208 args?: string[];
209 env?: Record<string, string>;
210 url?: string;
211 }) => {
212 return discoverMcpTools(config);
213 });
202} 214}