()
| 21 | * same reason (apps/desktop/src/main/local-agent-mode/systemPrompt.ts:314). |
| 22 | */ |
| 23 | export function setupComputerUseMCP(): { |
| 24 | mcpConfig: Record<string, ScopedMcpServerConfig> |
| 25 | allowedTools: string[] |
| 26 | } { |
| 27 | const allowedTools = buildComputerUseTools( |
| 28 | CLI_CU_CAPABILITIES, |
| 29 | getChicagoCoordinateMode(), |
| 30 | ).map(t => buildMcpToolName(COMPUTER_USE_MCP_SERVER_NAME, t.name)) |
| 31 | |
| 32 | // command/args are never spawned — client.ts intercepts by name and |
| 33 | // uses the in-process server. The config just needs to exist with |
| 34 | // type 'stdio' to hit the right branch. Mirrors Chrome's setup. |
| 35 | const args = isInBundledMode() |
| 36 | ? ['--computer-use-mcp'] |
| 37 | : [ |
| 38 | join(fileURLToPath(import.meta.url), '..', 'cli.js'), |
| 39 | '--computer-use-mcp', |
| 40 | ] |
| 41 | |
| 42 | return { |
| 43 | mcpConfig: { |
| 44 | [COMPUTER_USE_MCP_SERVER_NAME]: { |
| 45 | type: 'stdio', |
| 46 | command: process.execPath, |
| 47 | args, |
| 48 | scope: 'dynamic', |
| 49 | } as const, |
| 50 | }, |
| 51 | allowedTools, |
| 52 | } |
| 53 | } |
| 54 |
no test coverage detected