> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kameleoon.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Set up MCP clients

> Register the Kameleoon MCP server in Claude Code, Antigravity, Codex, or Cursor.

Each client registers the Kameleoon MCP server in its own configuration, then completes an OAuth login once. Follow the steps for your client, then run a sample prompt to confirm that the tools work.

## Claude Code integration

### Step 1: Register the server

To register the server for your user profile (making it available in all projects), open a terminal and run the following command:

```bash theme={null}
claude mcp add --scope user kameleoon -- npx -y mcp-remote@0.1.37 https://mcp.kameleoon.com/mcp 35535 --static-oauth-client-metadata '{ "scope": "openid" }'
```

To register the server only for the current project (which adds a `.mcp.json` file to your repository for team sharing), run:

```bash theme={null}
claude mcp add --scope project kameleoon -- npx -y mcp-remote@0.1.37 https://mcp.kameleoon.com/mcp 35535 --static-oauth-client-metadata '{ "scope": "openid" }'
```

Verify that Claude added the server:

```bash theme={null}
claude mcp list
```

**Expected output:** `kameleoon: ... - ✗ Failed to connect` (A failed connection here is normal because you haven't completed authentication yet).

### Step 2: Complete OAuth authentication

In the same terminal, trigger the login flow:

```bash theme={null}
npx -y mcp-remote@0.1.37 https://mcp.kameleoon.com/mcp 35535 --static-oauth-client-metadata '{ "scope": "openid" }'
```

1. The command automatically opens a browser tab. If it doesn't, copy the URL printed in the terminal and open it manually.
2. Sign in to your Kameleoon account.
3. Click **Authorize**.
4. When the browser displays a success message, press `Ctrl+C` in your terminal.

Verify the connection:

```bash theme={null}
claude mcp list
```

**Expected output:** `kameleoon: ... - ✓ Connected`

### Step 3: Start a new Claude Code session

Claude Code makes tools from newly added MCP servers available only in sessions that you start after registering the server. Close your current Claude Code chat and open a new one.

### Step 4: Verify the connection

In a new Claude Code conversation, try the following prompts:

* "List the Kameleoon feature flags."
* "What experiments are running on site X?"
* "Show the status of experiment Y."
* "Show the code for variation 1 of experiment Z."

## Antigravity integration

### Quick setup

Paste the following self-starter prompt directly into your Antigravity chat to connect automatically:

```text theme={null}
Connect to the Kameleoon MCP production server. The endpoint is https://mcp.kameleoon.com/mcp, using mcp-remote@0.1.37 on port 35535 with the openid scope. Authenticate by running the npx mcp-remote command to trigger my browser, then verify the connection.
```

### Manual configuration

Edit the configuration file at `~/.gemini/config/mcp_config.json` and add the following JSON block. If the file already has an `mcpServers` object, add only the `kameleoon` entry to it:

```json theme={null}
{
  "mcpServers": {
    "kameleoon": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote@0.1.37",
        "https://mcp.kameleoon.com/mcp",
        "35535",
        "--static-oauth-client-metadata",
        "{ \"scope\": \"openid\" }"
      ]
    }
  }
}
```

## Codex integration

### Quick setup

Paste the following self-starter prompt into your Codex chat:

```text theme={null}
Configure the Kameleoon MCP server at https://mcp.kameleoon.com/mcp. Use port 35535 for callback. Once configured, run the login command to trigger my browser and then list my feature flags.
```

### Manual configuration

Add the following block to `~/.codex/config.toml`. Create the file if it doesn't exist:

```toml theme={null}
[mcp_servers.kameleoon]
command = "npx"
args = ["-y", "mcp-remote@0.1.37", "https://mcp.kameleoon.com/mcp",
        "35535", "--static-oauth-client-metadata",
        "{ \"scope\": \"openid\" }"]
```

## Authenticate the connection

The Kameleoon MCP server uses OAuth. Run the following command in your terminal to start the authorization flow:

```bash theme={null}
npx -y mcp-remote@0.1.37 https://mcp.kameleoon.com/mcp 35535 \
  --static-oauth-client-metadata '{ "scope": "openid" }'
```

**Expected behavior:**

1. The browser automatically opens a window.
2. Click **Authorize** on the Kameleoon login page.
3. Kameleoon completes the local callback on port 35535.
4. The terminal confirms that the proxy connected successfully.

A successful connection outputs text similar to the following:

```text theme={null}
Connected to remote server using StreamableHTTPClientTransport
Local STDIO server running
Proxy established successfully between local STDIO and remote StreamableHTTPClientTransport
```

## Verify tool operations

After you authenticate, run the following checks to confirm the tools work as expected:

1. **List available tools:** Confirm that `tools/list` succeeds and returns the Kameleoon tools. Ensure the output includes the tools listed in the [tool reference](https://docs.kameleoon.com/mcp/mcp-server.md#tool-reference), such as `experiment_code_get`, `feature_flag_list`, and `feature_flag_create`.
2. **Retrieve feature flags:** Run `feature_flag_list(siteCode = "d1alzzxd7k")`. A successful response returns a list of feature flags for the specified site.
3. **Retrieve experiment results:** Run `experiment_results_get(experimentId = 149640)`. A successful response includes the results for each goal attached to the experiment.

## Cursor integration

Cursor integrates MCP tools directly into the IDE Chat sidebar, which makes them available while you code.

### Option 1: Configure via Cursor UI (recommended)

1. Open Cursor Settings (`Cmd+Shift+J` on macOS, `Ctrl+Shift+J` on Windows/Linux).
2. Navigate to **Features > MCP Servers > + Add New MCP Server**.
3. Set the **Name** to `kameleoon`.
4. Set the **Type** to `command`.
5. Enter the following string as the **Command**:
   ```bash theme={null}
   npx -y mcp-remote@0.1.37 https://mcp.kameleoon.com/mcp 35535 --static-oauth-client-metadata '{ "scope": "openid" }'
   ```
6. Save the configuration.

### Option 2: Configure in a JSON file (advanced)

Open `~/.cursor/mcp.json` (create the file if it doesn't exist) and add the following entry to the `mcpServers` object:

```json theme={null}
{
  "mcpServers": {
    "kameleoon": {
      "command": "bash",
      "args": [
        "-lc",
        "npx -y mcp-remote@0.1.37 https://mcp.kameleoon.com/mcp 35535 --static-oauth-client-metadata '{ \"scope\": \"openid\" }'"
      ]
    }
  }
}
```

> [!NOTE]
>
> Restart Cursor after you edit the file manually.

## Sample prompts for developer workflows

After you connect the Kameleoon MCP server, use prompts like the following in your IDE:

* "List the Kameleoon MCP tools available in this session."
* "Show all feature flags for site code `d1alzzxd7k`."
* "Get the details for feature flag new\_search on site `d1alzzxd7k`."
* "Fetch experiment results for experiment `149640` and summarize the current status."
* "Pull the variation code for experiment `<experimentId>` and variation `<variationId>`."

For more advanced workflows, try the following prompts:

* "Inspect feature flag new\_search for site `d1alzzxd7k` and explain what environments and variations it has."
* "Summarize experiment `149640` for an engineer. Include status, site code, winner state, and whether any variation data is available."
* "List the active feature flags for site `d1alzzxd7k` and point out any flags that look like stale candidates."
* "Retrieve the code for variation `<variationId>` in experiment `<experimentId>` and explain what frontend behavior it changes."
* "Create a new feature flag named `<name>` with key `<featureKey>` for site `d1alzzxd7k`."
* "Turn on feature flag `<featureKey>` in the staging environment for site `d1alzzxd7k`."
* "Turn off feature flag `<featureKey>` in the production environment for site `d1alzzxd7k`."
* "How has the checkout experiment performed week by week on phones?"
* "Did new visitors react differently from returning ones in the pricing test? Use Bayesian statistics."
* "Show the daily trend of the checkout test without Safari, counting every purchase, not only buyers."
* "Create a segment of returning visitors from Germany on desktop who already completed the Purchase goal."

## Prompting tips

* Include the site code when you work with feature flags.
* Include the experiment ID when you query experiments or experiment results.
* Include both `experimentId` and `variationId` when you request variation code.
* Explicitly name the target environment when you ask the agent to turn a feature flag on or off.
* Request a plain-English summary if you want your AI agent to interpret the MCP response rather than just retrieving the raw data.
