MCPcopy Index your code
hub / github.com/codeaashu/claude-code / setupComputerUseMCP

Function setupComputerUseMCP

src/utils/computerUse/setup.ts:23–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21 * same reason (apps/desktop/src/main/local-agent-mode/systemPrompt.ts:314).
22 */
23export 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

Callers 1

runFunction · 0.85

Calls 3

getChicagoCoordinateModeFunction · 0.85
buildMcpToolNameFunction · 0.85
isInBundledModeFunction · 0.85

Tested by

no test coverage detected