#!/usr/bin/env node
/**
 * Minimal MCP stdio server that bridges tool calls to a parent process.
 *
 * Spawned by the Claude CLI via --mcp-config. Advertises tool definitions
 * and delegates execution to the parent process through a Unix domain socket.
 *
 * Environment:
 *   FW_TOOL_SOCKET - Unix socket path for tool execution RPC
 *   FW_TOOL_DEFS   - Path to JSON file with tool definitions
 *
 * Protocol over Unix socket (newline-delimited JSON):
 *   Request:  {"name":"fw_run_command","args":{"command":"ls"}}
 *   Response: {"result":"...","isError":false}
 *
 * IMPORTANT — Transport compatibility:
 *   Claude Code CLI v2.1.76+ uses NDJSON (newline-delimited JSON) for MCP
 *   stdio, NOT the Content-Length framing from the MCP SDK spec. This server
 *   auto-detects the transport on the first stdin chunk: if the first
 *   non-whitespace character is '{', it uses NDJSON; otherwise Content-Length.
 *   Responses match the detected format.
 *
 *   The CLI also sends protocolVersion "2025-11-25" (not the spec's
 *   "2024-11-05"). We echo back whatever version the client requests.
 *
 *   If these behaviors change in a future CLI version, the auto-detect
 *   and version echo should adapt automatically.
 */
export {};
//# sourceMappingURL=mcp-tool-server.d.ts.map