Developer

Install and configure the Apex MCP server

Connect Claude Desktop, Claude Code, or Cursor to Apex experiments with the Drip MCP server.

The Apex MCP server lets model clients read and manage Apex experiments through the Model Context Protocol. Use it when you want Claude Desktop, Claude Code, Cursor, or another MCP client to list tests, inspect a draft, start or pause an experiment, read goals, pull brand context, or generate QA preview URLs.

Prerequisites

  • Node.js 18 or newer.
  • An Apex API key with the permissions needed for the tools you plan to call.
  • Either APEX_API_KEY in the MCP process environment or a saved user/shop CLI credential at ~/.drip/credentials.json. User keys minted by apex login are supported.

The server reads configuration in this order. Legacy DRIP_API_KEY and DRIP_BASE_URL names remain working fallbacks:

SettingRequiredDefaultNotes
APEX_API_KEYYes, unless CLI credentials existNoneTakes priority over saved credentials; apx_uk_… is treated as a user key.
APEX_BASE_URLNohttps://app.drip-apex.comUse only for non-production Apex environments.
DRIP_ORG / DRIP_SHOPFor user-key contextSaved contextOverride the org/shop selected by apex use.
~/.drip/credentials.jsonFallbackNoneShared with apex login; the saved user key is preferred over a saved shop key.

Install

Run the packaged server with npx:

bash
npx -y @drip-apex/mcp-server

For local monorepo development, build the package and run the compiled server:

bash
npm --prefix packages/mcp-server install
npm --prefix packages/mcp-server run build
node packages/mcp-server/dist/server.js

Claude Desktop

Add this to claude_desktop_config.json:

json
{
  "mcpServers": {
    "drip-ab-testing": {
      "command": "npx",
      "args": ["-y", "@drip-apex/mcp-server"],
      "env": {
        "APEX_API_KEY": "apx_your_key_here",
        "APEX_BASE_URL": "https://app.drip-apex.com"
      }
    }
  }
}

If you already authenticated with apex login on the same machine, you can omit env and let the server read ~/.drip/credentials.json: Resolution is APEX_API_KEY (with DRIP_API_KEY fallback), saved user key, then saved shop key. Set DRIP_ORG/DRIP_SHOP to override saved user-key context.

json
{
  "mcpServers": {
    "drip-ab-testing": {
      "command": "npx",
      "args": ["-y", "@drip-apex/mcp-server"]
    }
  }
}

Claude Code

Use a project .mcp.json or user-level MCP config with the same server block:

json
{
  "mcpServers": {
    "drip-ab-testing": {
      "command": "npx",
      "args": ["-y", "@drip-apex/mcp-server"],
      "env": {
        "APEX_API_KEY": "apx_your_key_here",
        "APEX_BASE_URL": "https://app.drip-apex.com"
      }
    }
  }
}

For a local checkout:

json
{
  "mcpServers": {
    "drip-ab-testing": {
      "command": "node",
      "args": ["./packages/mcp-server/dist/server.js"],
      "env": {
        "APEX_API_KEY": "apx_your_key_here",
        "APEX_BASE_URL": "https://app.drip-apex.com"
      }
    }
  }
}

Cursor

Add this to .cursor/mcp.json or Cursor's global MCP config:

json
{
  "mcpServers": {
    "drip-ab-testing": {
      "command": "npx",
      "args": ["-y", "@drip-apex/mcp-server"],
      "env": {
        "APEX_API_KEY": "apx_your_key_here",
        "APEX_BASE_URL": "https://app.drip-apex.com"
      }
    }
  }
}

Verify

Restart the MCP client, then ask it to list Apex experiments. A valid setup can call list_experiments. If the server exits immediately with "No API key found", set APEX_API_KEY for that MCP client or run:

bash
apex login

Troubleshooting

  • No API key found: set APEX_API_KEY in the MCP config or create ~/.drip/credentials.json with apex login.
  • HTTP 401: the key is missing, expired, revoked, or not in the apx_ key family.
  • HTTP 403: the key exists but does not have permission for the requested API endpoint.
  • Non-production testing: set APEX_BASE_URL to the target Apex base URL and keep production credentials out of that config.