OpenAI Codex CLI + AgenticBI MCP Setup

Connect OpenAI's Codex CLI to AgenticBI's MCP server. Once connected, you can query data, manage dashboards, and automate AgenticBI operations from Codex.

Prerequisites

  • Codex CLI installed (npm install -g @openai/codex)
  • AgenticBI account with AI Agents enabled

Option A: OAuth Browser Auth (Recommended)

The easiest way to connect - no token copy/paste needed.

Edit ~/.codex/config.json:

{
  "mcpServers": {
    "agenticbi": {
      "type": "http",
      "url": "https://app.agenticbi.com/api/2.0/mcp"
    }
  }
}

The first time Codex uses the connection, it will open your browser to sign in to AgenticBI and authorize access.

Instance URL: https://app.agenticbi.com

Option B: Manual Token

If you prefer to manage the token manually:

  1. Log into AgenticBI. Navigate to Settings > AI Settings.
  2. Under MCP Token, select a token expiry and click Generate Token. Copy the token.
  3. Edit ~/.codex/config.json:

    {
      "mcpServers": {
        "agenticbi": {
          "type": "http",
          "url": "https://app.agenticbi.com/api/2.0/mcp",
          "headers": {
            "Authorization": "Bearer YOUR_MCP_TOKEN"
          }
        }
      }
    }
    

Verify

Start a new Codex session and ask:

"What AgenticBI tools are available?"

You should see the full list of AgenticBI tools including do, ask, list_dashboards, and others.

Usage

Interact with AgenticBI using natural language from Codex:

"Show me my AgenticBI dashboards"
"Ask AgenticBI: what is our monthly recurring revenue trend?"
"Export AgenticBI dashboard 67890 to CSV"

Troubleshooting

Tools not appearing

  1. Verify your config file path and JSON syntax.
  2. Check that the AgenticBI instance is reachable: curl https://app.agenticbi.com/api/2.0/mcp/health
  3. Verify your token: curl -H "Authorization: Bearer YOUR_MCP_TOKEN" https://app.agenticbi.com/api/2.0/mcp/tools

Token expired

Generate a new token from Settings > AI Settings > MCP Token, then update ~/.codex/config.json.

For full tool documentation, see MCP Server.