Back to Articles

Resources · Article

Set up the Anter MCP Server for your agent CLI

July 14, 2026·2 min read·Anter Team
MCPAgent CLIsGetting Started

Agent CLIs like Claude Code, Codex, and OpenCode are great for building in your terminal directly — and with the Anter MCP Server, they can create, read, update, and iterate on Anter agents without leaving the command line.

This guide covers the one-time credential setup you need. Once it is in place, your CLI agent has full access to the Anter Agent Builder API through MCP.


What you need

Before starting, make sure you have:

  • An organization in the Anter Agent Builder platform
  • An API key from the Anter dashboard (generated in the project settings page)

If you do not have these yet, head to the Anter dashboard, create an organization, and generate an API key from the project settings — it takes about two minutes.


Configuration

1. Export your API key

export ANTER_MCP_API_KEY=your-api-key-here

Add this to your shell profile (~/.zshrc, ~/.bashrc, etc.) to make it persistent across sessions.

2. Configure the MCP server

Add the Anter MCP server to your agent CLI's configuration. For OpenCode, add this to ~/.config/opencode/opencode.jsonc:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "anter": {
      "type": "remote",
      "url": "https://api.anter.ai/v1/external/mcp",
      "headers": {
        "x-api-key": "{env:ANTER_MCP_API_KEY}",
      },
      "oauth": false,
    },
  },
}

OpenCode reads the key from your environment at runtime using the {env:ANTER_MCP_API_KEY} syntax — no credential files or local server process required. The oauth: false setting ensures it uses API-key auth directly.

For Claude Code, add the same remote server entry to ~/.claude/claude.json under mcpServers (using ${ANTER_MCP_API_KEY} syntax instead). Any agent CLI that supports remote MCP servers can use this URL and header pattern.

3. Optional — test the connection

opencode mcp auth anter

This verifies your MCP server is reachable and the API key is valid. After configuring, restart your CLI and ask it to list your Anter agents, create a draft agent, or inspect an existing spec.


Next steps

Now that your CLI agent can talk to Anter, try asking it:

  • "Show me the structure of a typical agent in anter"
  • "Show me the list of my projects in anter"
  • "Show me the list of builtin tools in anter"

For a full reference of available tools, check the Anter MCP Server documentation.