Documentation v0.30.0

MCP Client

Agenvoy's MCP client lets agents call tools exposed by any MCP server. Client and server share one package (internal/runtime/mcp) built on the official modelcontextprotocol/go-sdk.

Configuration layout

Two layers — the session layer overrides the global layer:

~/.config/agenvoy/mcp.json                        <- global
~/.config/agenvoy/sessions/<sid>/mcp.json         <- session-scoped

JSON format

{
  "servers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": { "GITHUB_TOKEN": "${GITHUB_TOKEN}" }
    },
    "remote-api": {
      "url": "https://api.example.com/mcp",
      "headers": { "Authorization": "Bearer ${TOKEN}" }
    }
  }
}

command and url are mutually exclusive. ${VAR} / $VAR placeholders inside env, headers, and args are expanded with os.Expand at startup.

Transport types

Type Config keys SDK transport Use case
stdio command + args + env CommandTransport Local CLIs (npx, native binaries)
Streamable HTTP url + headers StreamableClientTransport Remote services, long-running MCP servers

Both transports are handled by the SDK; Agenvoy only supplies the command or the endpoint plus a header-injecting HTTP client.

Management

Task TUI HTTP
List servers /mcp GET /v1/mcp
Add a server /mcp POST /v1/mcp
Remove a server /mcp POST /v1/mcp/remove
Connection status /mcp GET /v1/mcp/status
Health probe /mcp GET /v1/mcp/health
Reconnect all and re-register tools /mcp POST /v1/mcp/reconnect

The add flow asks for the server name, transport (Local stdio / Remote HTTP), the type-specific fields, and the scope. Scope writes one file only — global writes ~/.config/agenvoy/mcp.json, session writes the corresponding ~/.config/agenvoy/sessions/<sid>/mcp.json. There are no agen mcp CLI subcommands.

Tool naming

MCP-exposed tools are auto-registered with the format:

mcp__<server_name>__<tool_name>

Example: mcp__github__create_issue, mcp__sqlite-notes__read_query.

Result size cap

Each MCP tool result is capped at 1 MiB. When exceeded, the result is truncated with the marker:

[mcp output truncated: <total> bytes total, <kept> kept]

This avoids OpenAI Responses API's 10 MB single-tool-output limit triggering a same-signature retry storm. SQLite SELECT * on a large table will hit this — add LIMIT / WHERE.

Confirm behavior

MCP tools route through the most conservative defaults:

For batch operation, use agen run. For ad-hoc usage, accept the per-call confirm cost.

Lifecycle

Zero-auth, locally executed (no API key required):

Server Purpose
mcp-server-sqlite Run SQL on local .db files
@modelcontextprotocol/server-memory Persistent knowledge graph
@playwright/mcp Browser automation (downloads chromium)
@modelcontextprotocol/server-postgres Local Postgres connection
mcp-server-time Timezone conversion / relative time

Avoid registering MCP servers whose capabilities overlap with built-in tools (e.g., filesystem, git, fetch, shell) — duplicates only inflate the LLM tool list.

中文