# Changelog

## [0.1.0] - 2026-05-20

### Initial Release

pi-mcp-bridge is a minimal MCP client extension for [pi](https://github.com/earendil-works/pi-coding-agent). It attaches any MCP server to pi by spawning the server as a persistent subprocess, discovering its tools via the standard MCP handshake, and registering them so the pi agent can call them directly.

#### Features

- **Persistent MCP connection** — spawns the server once and keeps it alive for all tool calls (eliminates subprocess-per-call overhead)
- **Dynamic tool discovery** — issues `tools/list` on startup and registers all discovered tools with pi via `pi.registerTool()`
- **TypeBox schema conversion** — converts MCP `inputSchema` (JSON Schema subset) to TypeBox schemas so the LLM sees proper parameter types
- **Concurrent request support** — JSON-RPC ID-based promise matching handles overlapping tool calls
- **Graceful shutdown** — protocol-level shutdown → SIGTERM → SIGKILL (2s timeout) cleanup
- **Timeout protection** — per-request timeout (default 30s) prevents hanging on unresponsive servers
- **Stderr forwarding** — server diagnostics are buffered and forwarded to pi's stderr
- **JSON buffering** — handles multi-line JSON and interleaved debug output from MCP servers

#### Configuration

- `MCP_SERVER_CMD` — command to run the MCP server (required)
- `MCP_SERVER_DIR` — working directory for the server (optional)
- `MCP_SERVER_ARGS` — JSON array of extra CLI arguments (optional)
