DEV Community

CAI
CAI

Posted on

Wiring CAI into OpenClaw, Hermes, Codex, and Cursor: the exact MCP config for each host

Wiring CAI into OpenClaw, Hermes, Codex, and Cursor: the exact MCP config for each host

The general install is one command, npm i -g @cailab/mcp, and the contract lives at cai.com/skill.md. This post is the host-specific deep-dive: the exact config block for OpenClaw, Hermes, Codex, and Cursor, with the path to the config file, the env var handling, and the restart command.

Before you start

You need:

  1. A CAI account (cai.com/app). The signup is four steps, about 2 minutes.
  2. An API key from the account dashboard. The key has a scope. Start with the read scopes and add pay when you need transfers.
  3. The MCP server installed (npm i -g @cailab/mcp).
  4. The MCP host of your choice installed and running.

OpenClaw

OpenClaw's MCP config lives at ~/.openclaw/mcp.json. Add the CAI server to the mcpServers object:

{
  "mcpServers": {
    "cai": {
      "command": "cai-mcp",
      "env": {
        "CAI_API_KEY": "your-api-key-from-the-dashboard"
      }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Restart OpenClaw. The CAI tools appear in the agent's tool surface. Verify with openclaw mcp list. The cai server should show as running.

If the server doesn't appear: check the cai-mcp binary is on the PATH (which cai-mcp). If the binary is missing, re-run the install. If the binary is on the PATH but the server still doesn't start, check the API key is valid with curl -H "Authorization: Bearer ***" https://api.cai.com/functions/v1/get-identity.

Hermes

Hermes uses a CLI to add MCP servers:

hermes mcp add cai -- cai-mcp
hermes mcp env-set cai CAI_API_KEY=your-api-key-from-the-dashboard
Enter fullscreen mode Exit fullscreen mode

The env var is stored in the Hermes MCP config. Restart Hermes with hermes restart. Verify with hermes mcp list. The cai server should show as running with the env var set.

Hermes-specific note: Hermes reads MCP env vars at startup, not at request time. If you rotate your CAI API key, you need to update the env var and restart Hermes.

Codex

Codex reads MCP config from ~/.codex/mcp_servers.json. The format is the standard MCP config:

{
  "mcpServers": {
    "cai": {
      "command": "cai-mcp",
      "env": {
        "CAI_API_KEY": "your-api-key-from-the-dashboard"
      }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Restart Codex. The CAI tools appear in the agent's tool surface. Verify by running a test request. codex mcp test cai should return a successful handshake.

Codex-specific note: Codex's MCP support is newer than OpenClaw's. If you see "MCP server not found" on startup, check the Codex version is up to date. The CAI MCP server requires Codex ≥ 0.x.y (the specific version is in cai.com/developers.html).

Cursor

Cursor's MCP settings are in the UI: Cursor → Settings → MCP → Add new MCP server. The form fields:

  • Name: cai
  • Command: cai-mcp
  • Env: CAI_API_KEY=your-api-key-from-the-dashboard

Click "Add" and Cursor restarts the MCP server. The CAI tools appear in the agent's tool surface. Verify with Cursor → Settings → MCP → cai → Test. The test should return a successful handshake.

Cursor-specific note: Cursor stores the env var in its own keychain, not in a config file. If you rotate your CAI API key, update the env var in the MCP settings UI and click "Save."

A generic host (any MCP-compatible framework)

If the host isn't on the list, the config is the same shape:

{
  "mcpServers": {
    "cai": {
      "command": "cai-mcp",
      "env": {
        "CAI_API_KEY": "your-api-key-from-the-dashboard"
      }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

The MCP server is generic. The contract is in cai.com/skill.md. The tool names are stable. Any host that supports MCP can use the server.

Verifying the install

Once the server is running in your host, run a quick test:

  1. Identity check - get_identity should return your @cai.com address, your wallet bindings, and your linked subwallets.
  2. Balance check - get_wallet_balances should return your balances (or an empty list with a gap_id if you haven't deposited yet).
  3. Transfer test - wallet_custodial_transfer with a tiny amount (0.01 USDC) should return a hosted-action URL. Open the URL, tap once, and the transfer completes.

A few things to keep in mind about the wallet. There is a $200/day auto-limit while the security audit completes. New recipients and new devices always require confirmation. Think of it like cash in your pocket. It works for daily spending without exposing a private key in chat. The vault product (multi-sig, time-locks) is coming for larger balances.

The hosted-action flow

The part of CAI that the user sees most often is the hosted-action flow. When the agent calls wallet_custodial_transfer, the API returns a hosted-action URL. The user opens it, confirms with one tap, and the payment goes through. The agent polls GET /transfer-status for the receipt. No private key in chat, no signature to copy, no browser extension to connect. That single-tap confirmation page is the user's control point for every agent-initiated payment.

If any step fails, the comment section below is the right place to file the bug.

The contract is cai.com/skill.md. The install command is npm i -g @cailab/mcp. The dashboard is at cai.com/app.


If you wired CAI into OpenClaw / Hermes / Codex / Cursor and the tool surface didn't appear

Comment below with:

  1. What you ran - the install command, the request, the MCP host config. Copy the actual command or request.
  2. What you expected - one sentence.
  3. What you got - the error message, the empty response, the unexpected behavior. Paste it verbatim.
  4. Your environment - OS, Node version, the MCP host (OpenClaw / Hermes / Codex / Cursor / other), the CAI account tier if relevant.

Every comment on this article gets read. Bug reports will be replied to within 24 hours. Friction points shape what we document next.

Documentation: cai.com/skill.md · cai.com/developers.html · cai.com/app to sign up.

Top comments (0)