()
| 84 | * flush analytics before exit. |
| 85 | */ |
| 86 | export async function runComputerUseMcpServer(): Promise<void> { |
| 87 | enableConfigs() |
| 88 | initializeAnalyticsSink() |
| 89 | |
| 90 | const server = await createComputerUseMcpServerForCli() |
| 91 | const transport = new StdioServerTransport() |
| 92 | |
| 93 | let exiting = false |
| 94 | const shutdownAndExit = async (): Promise<void> => { |
| 95 | if (exiting) return |
| 96 | exiting = true |
| 97 | await Promise.all([shutdown1PEventLogging(), shutdownDatadog()]) |
| 98 | // eslint-disable-next-line custom-rules/no-process-exit |
| 99 | process.exit(0) |
| 100 | } |
| 101 | process.stdin.on('end', () => void shutdownAndExit()) |
| 102 | process.stdin.on('error', () => void shutdownAndExit()) |
| 103 | |
| 104 | logForDebugging('[Computer Use MCP] Starting MCP server') |
| 105 | await server.connect(transport) |
| 106 | logForDebugging('[Computer Use MCP] MCP server started') |
| 107 | } |
no test coverage detected