ADR 0006: wisp is an MCP server over stdio
Date: 2026-09-17. Status: accepted.
Context
Other agent harnesses (Claude Code, Codex, and the like) should be able to delegate self-contained work to the on-device model: running a build or test, summarising or classifying text, and similar tasks that suit local processing. MCP is the boundary those harnesses already speak.
Decision
wisp mcpserves MCP over stdio using the officialmodelcontextprotocol/swift-sdk. No other transport for now.- Tools advertised (
WispMCP.ToolCatalog):respond, which runs a prompt on the on-device model with wisp’s registered tools available to it, and (ADR 0007)close_thread. A directrun_commandMCP tool existed from this ADR until 2026-09-17 and was removed: wisp’s own tools are usable only through the model, so every command carries a turn’s audit trail and the harness’s value is the loop, not a remote shell. Clients learn what the model can do from thewisp://toolsresources (added 2026-09-19). respondwas initially stateless. Superseded by ADR 0007: calls continue a thread identified bythread_id.- Argument validation errors are MCP protocol errors (
invalidParams); execution failures, including an unavailable model, are tool results withisError: true, as the MCP spec prescribes. - The server exits when stdin reaches EOF. Real clients hold the pipe open for the session’s lifetime.
Consequences
- Stdout is the protocol channel while serving; nothing in the process may print to it. Diagnostics go to stderr.
- The tool descriptions tell callers about the roughly 4k-token context window so that a frontier-model client delegates appropriately sized tasks.
- The SDK dispatches requests concurrently, so
respondcalls on different threads run at once. - The SDK pulls in swift-nio and related packages; build time and binary size grow accordingly. Accepted rather than hand-rolling JSON-RPC.