Agents
Use Mezcal with coding agents through the CLI and hosted MCP transport.
Use Mezcal with coding agents through the CLI and hosted MCP transport.
Use the Agents lane when a human or model is operating Mezcal through tools instead of raw REST requests.
Mezcal currently exposes two agent-facing paths:
For most agent users, the shortest path is:
mezcal/api basemezcal mcp serve --transport remoteShared environment:
export MEZCAL_BASE_URL="https://<your-mezcal-host>/api"
export MEZCAL_API_KEY="mzk_test_your_key_here"
export MEZCAL_CHAIN="SN_MAIN"
If your agent client wants a JSON config instead of a one-shot command, this is the minimum useful shape:
{
"mcpServers": {
"mezcal": {
"command": "mezcal",
"args": ["mcp", "serve", "--transport", "remote"],
"env": {
"MEZCAL_BASE_URL": "https://<your-mezcal-host>/api",
"MEZCAL_API_KEY": "${MEZCAL_API_KEY}",
"MEZCAL_CHAIN": "SN_MAIN"
}
}
}
}
That is the practical parent-page answer for Claude Code, Codex-adjacent setups, Cursor-like MCP clients, and other tool-calling environments.
When you are replacing lightweight chain reads with an agent, start with:
statustoken_total_supplytoken_balance_oftoken_transfersThose give the agent a narrow, typed Mezcal surface before it starts guessing at raw chain structure.
They solve different problems:
That separation is intentional. It keeps the local developer flow fast while giving remote agent consumers a safer, more explicit auth and policy boundary.