ADR-0002: Adopt the official rmcp SDK for networked MCP serving

StateAccepted
Architectural SignificanceMEDIUM
DomainDeveloper Tooling
Document version1.0

Reference

Amends the MCP-server decision in ADR-0001 (Stage 7). Stage 7 first shipped a dependency-free, hand-rolled JSON-RPC-over-stdio MCP server, chosen to honour ADR-0001's offline-by-default and lean-dependency principles. This ADR records the decision to replace it with the official Rust MCP SDK once networked serving became a near-term goal.

Summary

Adopt rmcp (the official Rust MCP SDK, v3.x) for roteiro serve, behind the existing mcp feature. This brings an async (tokio) dependency and roughly 77 transitive crates into the feature-gated build, in exchange for protocol correctness maintained upstream, future MCP capabilities (resources, prompts, cancellation, progress), and — the deciding factor — the streamable-HTTP transport, enabling a networked, multi-client MCP service. The default build (no mcp feature) is unchanged.

Context

Stage 7's hand-rolled server is correct and lean, but its ceiling is the stdio transport: a local subprocess an agent spawns, communicating over pipes. Pipes cannot carry TLS, so "TLS support" is not a property of the stdio server — it only becomes meaningful for a networked HTTP transport.

The project now wants networked MCP serving (multiple clients, remote access). Hand-rolling HTTP + SSE + session management + TLS termination would be a poor use of effort and error-prone; that is exactly what the SDK provides. We verified rmcp 3.1.2 builds on the 1.94 MSRV and that its stdio/server dependency tree passes the strict cargo deny licence allow-list.

Decision makers

Adopt rmcp behind the mcp feature, exposing the existing query surface (explain, list_kind) as MCP tools over both the stdio transport (default; for local agents) and the streamable-HTTP transport (for networked serving). TLS for the HTTP transport is terminated at a reverse proxy in the standard way; in-app TLS (rustls) can be added later as a further option.

Options considered + consequences

Option 1: Keep the hand-rolled stdio server

Consequences

Advice Received

Decision taken by the project team after weighing the dependency cost against the networked-serving requirement; the hand-rolled server was validated as a viable lean alternative but does not meet the networked goal.

Document version history

VersionDateNotes
1.02026-08-08Accepted. Adopt rmcp for stdio + streamable-HTTP MCP serving, feature-gated; amends ADR-0001 Stage 7.