MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / setupComputerUseMCP

Function setupComputerUseMCP

source code/utils/computerUse/setup.ts:25–55  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 1

runFunction · 0.85

Calls 3

getChicagoCoordinateModeFunction · 0.85
buildMcpToolNameFunction · 0.85
isInBundledModeFunction · 0.85

Tested by

no test coverage detected