{"record":{"id":"24186c9a615da2db","repo":"can1357/oh-my-pi","slug":"only-stdio-transport-is-implemented-in-the-typescr","errorCode":null,"errorMessage":"Only stdio transport is implemented in the TypeScript port","messagePattern":"Only stdio transport is implemented in the TypeScript port","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/mnemopi/src/mcp-server.ts","lineNumber":134,"sourceCode":"\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tconst response = await handleJsonRpc(parsed as JsonRpcRequest);\n\t\t\t\t\tif (response !== null) output.write(`${JSON.stringify(response)}\\n`);\n\t\t\t\t}\n\t\t\t\tnewline = buffer.indexOf(\"\\n\");\n\t\t\t}\n\t\t}\n\t} finally {\n\t\treader.releaseLock();\n\t}\n}\n\nexport function runMcpServer(\n\ttransport = \"stdio\",\n\toptions: { port?: number; bank?: string; host?: string } = {},\n): Promise<void> {\n\tif (options.bank !== undefined && options.bank.length > 0) process.env.MNEMOPI_MCP_BANK = options.bank;\n\tif (transport !== \"stdio\") throw new Error(\"Only stdio transport is implemented in the TypeScript port\");\n\treturn runStdio();\n}\n\nexport function main(argv: readonly string[] = Bun.argv.slice(2)): Promise<void> {\n\tlet transport = \"stdio\";\n\tlet port: number | undefined;\n\tlet bank: string | undefined;\n\tlet host: string | undefined;\n\tfor (let i = 0; i < argv.length; i++) {\n\t\tconst arg = argv[i];\n\t\tif (arg === \"--transport\") transport = argv[++i] ?? \"stdio\";\n\t\telse if (arg === \"--port\") {\n\t\t\tconst parsed = Number(argv[++i] ?? \"\");\n\t\t\tif (Number.isFinite(parsed)) port = parsed;\n\t\t} else if (arg === \"--bank\") bank = argv[++i] ?? \"\";\n\t\telse if (arg === \"--host\") host = argv[++i] ?? \"\";\n\t}\n\treturn runMcpServer(transport, { port, bank, host });","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/mnemopi/src/mcp-server.ts#L116-L152","documentation":"runMcpServer() only supports the stdio transport in the TypeScript port; any other transport value (e.g. 'http', 'sse', 'tcp') throws this error immediately. The port/host options exist in the signature for API compatibility but are unused until another transport is implemented.","triggerScenarios":"Calling runMcpServer('http') / runMcpServer('sse') or invoking main() with --transport http (or equivalent CLI flag), or passing a port expecting an HTTP server to start.","commonSituations":"Porting configs from the Python implementation that used an HTTP/SSE transport, following docs or examples written for the original version, or wiring the MCP server into a network-based client instead of spawning it over stdio.","solutions":["Use the default stdio transport: runMcpServer() or runMcpServer('stdio') and have the client spawn the process.","Remove --transport/--port flags from the launch command so defaults apply.","If a network transport is required, keep the Python server or implement/contribute an HTTP transport in the TS port."],"exampleFix":"// before\nawait runMcpServer('http', { port: 8080 });\n// after\nawait runMcpServer('stdio'); // client spawns: omp-mcp | your-mcp-client","handlingStrategy":"validation","validationCode":"const transport = process.env.MNEMOPI_TRANSPORT ?? 'stdio';\nif (transport !== 'stdio') {\n  throw new Error(`Transport '${transport}' not supported by TS port; use stdio`);\n}\nawait runMcpServer(transport);","typeGuard":"function isSupportedTransport(t) {\n  return t === 'stdio';\n}","tryCatchPattern":"try {\n  await runMcpServer(transport);\n} catch (err) {\n  if (err instanceof Error && err.message.includes('Only stdio transport')) {\n    console.error('TS port supports stdio only; spawn the server as a subprocess');\n    process.exitCode = 2;\n  } else throw err;\n}","preventionTips":["Launch the MCP server as a stdio subprocess from the client, never over TCP/HTTP","Remove --transport/--port flags migrated from Python configs","Read current server docs — the TS port's supported surface is stdio only","Validate transport config at startup with a clear error before spawning"],"tags":["mcp","transport","stdio","unsupported-feature"],"backgroundTag":"unsupported-transport","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}