ADR-0037: Remote MCP servers over HTTP
- **Status:** Accepted - **Date:** 2026-10-03 - **Related:** ADR-0006 (MCP architecture), ADR-0036 (agent-managed MCP servers)
2 min read
This is a migrated reference document from the original Anvio source repo. Content is preserved as-is; canonical documentation lives in the sections above in the sidebar.
Original path: docs/adr/0037-remote-mcp-servers-over-http.md
- Status: Accepted
- Date: 2026-10-03
- Related: ADR-0006 (MCP architecture), ADR-0036 (agent-managed MCP servers)
Context
McpServerSpec.transport was stub | stdio. Hosted MCP servers, which are handed out as a URL (https://…/mcp, …/sse), could not be registered at all, so "add this MCP: <link>" failed for the most common kind of link.
Decision
- Add
transport: httpwithurlandheaders(values may use$\{VAR\}placeholders, resolved at request time).commandbecomes optional; a schema refinement requirescommandfor stdio/stub andurlfor http. - New
McpHttpClient, with the same surface asMcpStdioClientsoMcpBridgepools either:- Streamable HTTP (spec 2025-03-26): JSON-RPC by POST, reply as JSON or as an SSE stream,
Mcp-Session-Idcarried after initialize, and a 404 on a live session re-initialises. - Legacy HTTP+SSE fallback: when the initialize POST gets a 4xx other than 401/403, the client opens a GET event stream, reads the
endpointevent, and posts to it. Replies arrive on the stream.
- Streamable HTTP (spec 2025-03-26): JSON-RPC by POST, reply as JSON or as an SSE stream,
- For http servers, the bridge no longer falls back to the stub
pingtool when listing fails. It returns no tools and logs the error, so a broken remote server is not advertised as working. Stdio behaviour is unchanged. mcp_manage addacceptsurlandheaders. The url must behttps; plainhttpis allowed only for localhost. TheagentAllowedCommandsallow-list does not apply, because nothing runs locally.
Consequences
- An agent can register a hosted MCP server from a link alone. The first-call approval gate still applies to every tool.
- A remote server sees whatever arguments the agent sends. That is data egress to a URL the model chose, which is the remaining risk once
mcp_manageis enabled. - OAuth-protected servers (the MCP auth spec's browser flow) are not supported. Only static headers work, e.g.
Authorization: Bearer $\{TOKEN\}. That is a follow-up. - Server-initiated requests (sampling, elicitation) and resumable streams are not handled. Notifications on a reply stream are skipped.
Last updated on
ADR-0036: Agent-managed skills and MCP servers
- **Status:** Accepted - **Date:** 2026-10-03 - **Related:** ADR-0006 (MCP architecture), ADR-0023 (slash commands / skill promotion), `docs/77-skill-execution-engine.md`
ADR-0038: Position Anvio as an extensible multi-agent platform; keep local-by-default deployment
- **Status:** Accepted - **Date:** 2026-10-25 - **Deciders:** Repository owner (stated in the Phase 5 documentation directive) - **Amends:** [ADR-0007](0007-local-first-architecture.md). Only its prod