#!/usr/bin/env node /** * mcp/server.ts -- GoldenPipe MCP server (stdio transport, JSON-RPC 2.0). * * Node-only: uses node:path, node:readline. NOT edge-safe. * * Exposes 4 tools (`list_stages`, `validate_pipeline`, `run_pipeline`, * `explain_pipeline`) wired to the GoldenPipe TS core/node APIs -- byte-parity * with the Python sibling at `packages/python/goldenpipe/goldenpipe/mcp/server.py`. * * Every tool dispatch is wrapped in try/catch so a single failure never crashes * the JSON-RPC loop; errors come back as `{ error: "" }`. * * Mirrors the hand-rolled JSON-RPC pattern in the sibling InferMap / GoldenFlow * TS servers (no MCP SDK dep). */ interface Tool { readonly name: string; readonly description: string; readonly inputSchema: Readonly>; } declare const TOOLS: readonly Tool[]; declare function handleTool(name: string, args: Record): Promise; /** * Start the MCP server reading JSON-RPC messages one per line from stdin and * writing responses to stdout. Intended for Claude Desktop / any MCP client * using stdio transport. */ declare function startMcpServer(): void; export { TOOLS, handleTool, startMcpServer };