MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / runMcpStdioServer

Function runMcpStdioServer

apps/local/src/mcp.ts:310–339  ·  view source on GitHub ↗
(config: ExecutorMcpServerConfig)

Source from the content-addressed store, hash-verified

308// ---------------------------------------------------------------------------
309
310export const runMcpStdioServer = async (config: ExecutorMcpServerConfig): Promise<void> => {
311 startIntegrationsRefresh();
312
313 const server = await Effect.runPromise(createExecutorMcpServer(config));
314 const transport = new StdioServerTransport();
315
316 const waitForExit = () =>
317 new Promise<void>((resolve) => {
318 const finish = () => {
319 process.off("SIGINT", finish);
320 process.off("SIGTERM", finish);
321 process.stdin.off("end", finish);
322 process.stdin.off("close", finish);
323 resolve();
324 };
325 process.once("SIGINT", finish);
326 process.once("SIGTERM", finish);
327 process.stdin.once("end", finish);
328 process.stdin.once("close", finish);
329 });
330
331 // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: stdio server lifetime uses Promise-based SDK/process APIs and always closes resources
332 try {
333 await server.connect(transport);
334 await waitForExit();
335 } finally {
336 await ignoreClose(() => transport.close());
337 await ignoreClose(() => server.close());
338 }
339};

Callers

nothing calls this directly

Calls 6

startIntegrationsRefreshFunction · 0.90
createExecutorMcpServerFunction · 0.90
waitForExitFunction · 0.85
ignoreCloseFunction · 0.70
connectMethod · 0.65
closeMethod · 0.65

Tested by

no test coverage detected