Home / Docs / The API and MCP server
Managing AnroAgents from code and from AI assistants
Managing agents from your own code or from an AI assistant.
AnroAgents can be driven from outside the dashboard in two ways: a REST API for your own code, and an MCP server for AI assistants such as Claude, ChatGPT, Cursor and Gemini. Both are available on the AnroAgents plans that include API access.
The full endpoint list is in the generated AnroAgents API document, and the machine-readable specification is published at https://api.anroagents.com/mcp/openapi.json.
Personal access tokens
Both the AnroAgents API and the MCP server authenticate with a Personal Access Token. Create one in the AnroAgents dashboard under Settings; it is shown once, so store it where you keep other secrets.
An AnroAgents personal access token carries the permissions of the account that created it, and it is sent as Authorization: Bearer pat_.... Tokens can be revoked from the dashboard at any time, which takes effect within a few minutes.
A personal access token is not the same thing as the API key in the widget snippet. The widget key is public and site-facing; the personal access token is a secret that can create and delete agents, and must never appear in front-end code.
What you can do through the API
The AnroAgents API covers the agent lifecycle: list agents, read one, create, update, delete a draft, activate, enable or disable, fetch the embed code, regenerate the widget key, upload a logo, and manage the agent's knowledge base — upload files, add a whole website, read a source again, and remove one.
Creating and updating an agent through the AnroAgents API accepts the same sales-automation settings as the dashboard — proactive triggers, lead qualification and email follow-up — with the same validation and the same plan limits. Lead qualification on the Starter plan is BANT only; MEDDIC and custom fields need Pro or above. A setting your plan does not allow is rejected with an error that names the limit, rather than being dropped. The same goes for the switch that lets visitors send photos in chat (attachmentsEnabled), which needs Starter or above, and for the reply model (chatModel: standard or advanced), where advanced needs Starter or above and each advanced reply counts as 15 messages.
A few AnroAgents agent settings are dashboard-only because they depend on a connection made there: the pre-chat form, webhooks, canned responses, live handoff, HubSpot sync, the in-chat email mailbox and the business description file. Sending one of those through the API returns an error naming the field; a value echoed back unchanged from a previous read is accepted, so a read-edit-write of the whole agent still works.
Adding a website through the AnroAgents API works like the Website button in the dashboard: one call with the address records the site as a single knowledge source, and the pages are read in the background within the plan's page and character budgets. The source shows as pending until reading finishes; listing the knowledge base shows when it is ready, how many pages were read, and whether the plan's budget cut the crawl short. Addresses on internal networks are refused, and a site already in the knowledge base is read again rather than added twice.
The usual reason to use the AnroAgents API is provisioning at scale. An agency onboarding twenty clients creates twenty agents from a script rather than filling in the same form twenty times, and a SaaS embedding AnroAgents for its own customers creates an agent per customer at signup.
The MCP server
The AnroAgents MCP server is published on npm as @anroagents/mcp-server. Add it to the MCP configuration of your assistant with your personal access token, and you can then manage agents by asking in plain language — list them, create one from a description, update prices, upload a logo.
The AnroAgents MCP server is the fastest route for someone who does not want to write code at all: the assistant does the API calls, and the natural-language instruction replaces the script.
Connecting the MCP server to an assistant
Step-by-step instructions are always on the page in the AnroAgents dashboard under Settings → API Tokens → "How to connect an AI assistant", with a copyable config for each client. In short:
- Claude Desktop — open Settings → Developer → Edit Config (the file is
~/Library/Application Support/Claude/claude_desktop_config.jsonon macOS,%APPDATA%\Claude\claude_desktop_config.jsonon Windows), add ananroagentsentry undermcpServerswith"command": "npx","args": ["-y", "@anroagents/mcp-server"]and your token inenv.ANROAGENTS_TOKEN, then quit Claude completely and open it again. - Claude Code — run
claude mcp add anroagents --scope user -e ANROAGENTS_TOKEN=pat_... -- npx -y @anroagents/mcp-server. Claude Code does not read MCP servers from itssettings.json. - Cursor — add the same
mcpServersentry to~/.cursor/mcp.json.
The AnroAgents MCP server runs on your own computer, started by the assistant through npx, so it needs Node.js 18 or newer installed. For the same reason it works in desktop apps and code editors but not in claude.ai or ChatGPT in the browser.
If the assistant shows the AnroAgents server as failed or disconnected, the cause is almost always on the computer, not in the account: Node.js missing or not visible to the app, or the token missing from the config. Claude Desktop writes the reason to ~/Library/Logs/Claude/mcp-server-anroagents.log. A personal access token is shown only once — if it was lost, create a new one and paste it into the config.
Limits and etiquette
The AnroAgents API is a management API, not a chat API: it configures agents rather than carrying conversations. Visitor conversations run over the widget and the platform's own websocket connection.
Treat the AnroAgents API as rate-limited and write your integration to retry on failure rather than hammering. Bulk provisioning should space its calls out; there is no benefit in creating fifty agents in one second.