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

Function runMcpStdioServer

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

Source from the content-addressed store, hash-verified

330// ---------------------------------------------------------------------------
331
332export const runMcpStdioServer = async (config: ExecutorMcpServerConfig): Promise<void> => {
333 startIntegrationsRefresh();
334
335 const server = await Effect.runPromise(createExecutorMcpServer(config));
336 const transport = new StdioServerTransport();
337
338 const waitForExit = () =>
339 new Promise<void>((resolve) => {
340 const finish = () => {
341 process.off("SIGINT", finish);
342 process.off("SIGTERM", finish);
343 process.stdin.off("end", finish);
344 process.stdin.off("close", finish);
345 resolve();
346 };
347 process.once("SIGINT", finish);
348 process.once("SIGTERM", finish);
349 process.stdin.once("end", finish);
350 process.stdin.once("close", finish);
351 });
352
353 // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: stdio server lifetime uses Promise-based SDK/process APIs and always closes resources
354 try {
355 await server.connect(transport);
356 await waitForExit();
357 } finally {
358 await ignoreClose(() => transport.close());
359 await ignoreClose(() => server.close());
360 }
361};

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