AAnvio
Reference ArchiveSource Docs

MCP Architecture

Anvio is an **MCP client**. It connects agents to external MCP servers and exposes their tools through the tool loop. Anvio does not run an MCP server itself.

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/07-mcp.md

Anvio is an MCP client. It connects agents to external MCP servers and exposes their tools through the tool loop. Anvio does not run an MCP server itself.

Components

ComponentLocationResponsibility
Integration registrypackages/integrations/src/integration-registry.tsLoads workspace/mcp/servers.yaml; add, enable, disable and remove servers at runtime
McpBridgepackages/integrations/src/mcp-bridge.tsPools one client per server; listTools, callTool, invalidate, close
stdio clientpackages/integrations/src/mcp-stdio-client.tsSpawns the server process. Newline-delimited JSON-RPC (MCP stdio transport); Content-Length frames are still accepted from older servers. 30 s request timeout; respawn on crash
HTTP clientpackages/integrations/src/mcp-http-client.tsRemote servers by URL (ADR-0037)
Tool catalog / portpackages/platformMCP tools appear to agents as anvio_mcp__<server>__<tool>
First-call gatepackages/platform (mcpFirstCallGate)The first call to each MCP tool in a session requires human approval; the run pauses and resumes after the decision

The clients are in-house and are not built on the official SDK. The de facto decision is recorded in ADR-0039 (Proposed). Conformance is checked by an end-to-end test against a server built with @modelcontextprotocol/sdk (tests/integration/e2e/mcp-approval.e2e.integration.spec.ts).

Behaviour

  • Agent-managed servers. With the mcp_manage tool enabled (off by default), agents can register and toggle servers without a restart (ADR-0036).
  • Failure handling.
    • A server binary that is missing or crashes is logged and does not stop the platform.
    • A failed request rejects its pending calls.
    • Server processes are terminated on platform.shutdown().
  • Environment. stdio servers currently inherit the full process environment, including every API key (ROADMAP T-047). Only run MCP servers you trust.

Configuration

See 71 — MCP setup guide. CLI: anvio mcp list|test|health|preset.

Edit on GitHub

Last updated on

On this page