MCP setup guide
How to configure Model Context Protocol servers in an Anvio workspace.
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/71-mcp-setup-guide.md
How to configure Model Context Protocol servers in an Anvio workspace.
Quick start
- Initialize workspace:
anvio init - List presets:
anvio mcp preset list - Apply a preset:
anvio mcp preset apply spotify - Edit
workspace/mcp/servers.yaml— setenabled: trueand fill env vars - Test:
anvio mcp test spotify - Health:
anvio mcp health
servers.yaml structure
apiVersion: anvio.io/v1
kind: McpConfig
metadata:
name: default
spec:
firstCallApproval: true
servers:
spotify:
command: npx
args: ['-y', '@modelcontextprotocol/server-spotify']
transport: stdio
enabled: true
env:
SPOTIFY_CLIENT_ID: ${SPOTIFY_CLIENT_ID}
SPOTIFY_CLIENT_SECRET: ${SPOTIFY_CLIENT_SECRET}
allowedTools:
- search_tracks
- get_playback_statePer-server tool allowlist
Set allowedTools on a server to expose only named MCP tools to the agent. Omit the field to expose all tools from that server.
Tool names in allowedTools are the MCP tool name (not the full anvio_mcp__server__tool name).
Presets
Example presets live in workspace/mcp/presets/:
| Preset | Purpose |
|---|---|
spotify | Spotify playback/search MCP |
feishu | Feishu/Lark document MCP |
tinker-atropos | Tinker Atropos RL MCP |
Presets merge into mcp/servers.yaml with enabled: false by default.
First-call approval
When firstCallApproval: true, each MCP tool requires human approval once per session (anvio approve <session> <requestId>). Approved tools are stored in session metadata.
Harness MCP-only surface
For channel deployments where the agent should only use MCP + channel output tools:
# harness/defaults.yaml
spec:
toolSurface: mcp_and_channel
suppressRawOutput: trueBuilt-in gateway tools (anvio_tools__*) are hidden; the agent must reply via anvio_channel__reply and call MCP tools for actions.
Troubleshooting
| Symptom | Fix |
|---|---|
Server disabled | Set enabled: true in servers.yaml |
| Empty tool list | Run anvio mcp test <id> — check command and env |
| Tool not visible | Check allowedTools filter |
| Stdio timeout | Verify npx/binary is on PATH |
See 72-observability-langfuse.md. Import dashboard: configs/observability/langfuse-dashboard.json.
Last updated on
Workspace Artifacts — MD-first (Phase J)
Anvio aligns with [Hermes Agent](https://hermes-agent.nousresearch.com/docs) and [slaude](https://github.com/barockok/slaude) conventions: **human artifacts are Markdown**, not heavy Kubernetes-style
Observability — Langfuse + OpenTelemetry
Anvio emits traces and metrics via OpenTelemetry (OTLP). Langfuse can ingest the same pipeline for LLM observability dashboards.