()
| 58 | * server exists only to answer ListTools. |
| 59 | */ |
| 60 | export async function createComputerUseMcpServerForCli(): Promise< |
| 61 | ReturnType<typeof createComputerUseMcpServer> |
| 62 | > { |
| 63 | const adapter = getComputerUseHostAdapter() |
| 64 | const coordinateMode = getChicagoCoordinateMode() |
| 65 | const server = createComputerUseMcpServer(adapter, coordinateMode) |
| 66 | |
| 67 | const installedAppNames = await tryGetInstalledAppNames() |
| 68 | const tools = buildComputerUseTools( |
| 69 | adapter.executor.capabilities, |
| 70 | coordinateMode, |
| 71 | installedAppNames, |
| 72 | ) |
| 73 | server.setRequestHandler(ListToolsRequestSchema, async () => |
| 74 | adapter.isDisabled() ? { tools: [] } : { tools }, |
| 75 | ) |
| 76 | |
| 77 | return server |
| 78 | } |
| 79 | |
| 80 | /** |
| 81 | * Subprocess entrypoint for `--computer-use-mcp`. Mirror of |
no test coverage detected