CLI and MCP Server

Manage Agentkit agents from your terminal, or connect Claude Code, Codex and Cursor to your agents with the Agentkit MCP server.

The Agentkit CLI lets you manage your agents from a terminal. The same package includes an MCP server, so Claude Code, Codex, Cursor and other coding assistants can read your agents, settings, knowledge and conversations.

Both are open source under the MIT license: github.com/agikits/agentkit-cli. The current release is a beta.

Note: The CLI and MCP server use the REST API, which requires a Hobby plan or above. Compare plans →

What you can do

  • List agents and read their AI, design, security and training settings
  • Read conversations from the widget, API, Playground and Instagram
  • List knowledge sources, add text and Q&A, and re-crawl web pages
  • Test an agent's answers from the terminal without opening the dashboard
  • Ask your coding assistant questions like "what did visitors ask about pricing this week?"

1. Install

You need Node.js 22 or newer.

npm install -g @agikits/agentkit
agentkit --version

This installs two commands: agentkit (the CLI) and agentkit-mcp (the MCP server).

If your shell can't find agentkit afterwards, npm's global folder isn't on your PATH. Run npm prefix -g and add its bin folder (on Windows, that folder itself) to your PATH, or skip the global install and use npx -p @agikits/agentkit agentkit --version.

2. Add your API key

  1. In your workspace dashboard, open API Keys and click Create API Key.
  2. Copy the key.
  3. Save it for the CLI. The key is read from standard input, so it stays out of your shell history:

On macOS:

pbpaste | agentkit init --with-token

In Windows PowerShell:

Get-Clipboard | agentkit init --with-token

On Linux, run this, paste the key when the cursor waits, and press Enter:

read -rs KEY && printf '%s' "$KEY" | agentkit init --with-token; unset KEY

You can also set AGENTKIT_API_KEY in your environment instead of saving the key.

Check that it worked with agentkit agents list.

The key is saved to ~/.config/agentkit/config.json. On macOS and Linux only your user can read the file. On Windows it inherits your user folder's permissions. A key can reach every agent in the workspace, so treat it like a password. To stop using a key, revoke it on the API Keys page. agentkit logout only removes the local copy.

3. Run your first commands

# List the agents in your workspace
agentkit agents list

# Give one a short name (commands accept the name or the agent ID)
agentkit projects --add support <agent-id>

# Inspect it
agentkit train support --status
agentkit sources list support
agentkit conversations list support --source widget

# Ask it a question (uses the Playground channel and spends credits like any chat)
agentkit chat support "What are your opening hours?"

Add --json to any command for machine-readable output. Run agentkit <command> --help for every option, and agentkit capabilities for the full list of supported operations.

Commands that change an agent, such as settings instructions or sources add-text, take effect immediately: new text and Q&A sources are used right away. train re-crawls the agent's web-page sources and uses training credits; train --status only reads progress. Deleting anything requires --yes.

4. Connect your coding assistant

The MCP server starts in read-only mode. It can list agents, read settings, sources and conversations, and check training status. It cannot change anything unless you start it with --allow-writes.

It uses the key you saved with agentkit init, so the client configuration doesn't need to contain the key.

Claude Code

claude mcp add -s user agentkit -- agentkit-mcp

-s user makes the server available in every project. Leave it out to add it to the current project only.

Codex

codex mcp add agentkit -- agentkit-mcp

Cursor and other clients

Add this to your client's MCP configuration (in Cursor, ~/.cursor/mcp.json):

{
  "mcpServers": {
    "agentkit": {
      "command": "agentkit-mcp"
    }
  }
}

Then ask your assistant something like:

List my Agentkit agents and summarize the last five conversations for the support agent.

Limit access to one agent

By default the server can read every agent the key can reach. Pass --agent to restrict it. Repeat the flag for several agents.

claude mcp add -s user agentkit -- agentkit-mcp --agent <agent-id>

Allow changes

Start the server with --allow-writes to let the assistant add text knowledge sources and update an agent's instructions. Without --agent, it can also create new agents. Instruction changes go live immediately, so keep your client's tool-approval prompts on.

claude mcp add -s user agentkit -- agentkit-mcp --agent <agent-id> --allow-writes

Even with writes allowed, the MCP server never starts training, sends messages or emails, deletes anything, reads secrets, or runs commands.

Privacy

Conversations and instructions can contain customer data. When you connect the MCP server, your coding assistant's provider receives whatever the tools return. Restrict the server to the agents you need with --agent.

Limitations in the beta

  • Widgets, Center Stage, Backstage, email inbox setup, and changes to custom actions and secrets need a short-lived dashboard session token instead of an API key. These commands are experimental. An API key can read the email inbox and send reviewed drafts.
  • Instagram connection and other channel sign-ins stay in the dashboard.
  • The MCP server runs locally over stdio. A hosted connector for ChatGPT and Claude.ai is not available yet.

Report issues on GitHub.