> For the complete documentation index, see [llms.txt](https://docs.elevateab.com/elevate-helpcenter/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.elevateab.com/elevate-helpcenter/mcp/connect-gemini-cli.md).

# Connect Gemini CLI

Connect Gemini CLI to Elevate A/B Testing with an API key in settings.json, then ask Gemini about your Shopify experiments and their results.

Gemini CLI connects to Elevate A/B Testing with an MCP API key in its settings file. Once connected, you can ask Gemini about your Shopify experiments from your terminal.

The connection is read-only unless you allow changes: Gemini can see your tests and results, and it can't change anything in your store. To let Gemini create, launch, pause, resume and end experiments, see [Let Your AI Assistant Make Changes](https://docs.elevateab.com/elevate-helpcenter/mcp/let-your-ai-assistant-make-changes.md).

***

### Step 1: Create an API key

1. In Elevate A/B Testing, open **MCP** in the sidebar, and under **Coding tools** select **Gemini CLI**.
2. Click **Create key**. Elevate A/B Testing adds the key to the setup on the same screen. The key is read-only. To let the client make changes, tick **Can make changes** when you create it.
3. Copy the setup now. For your security, the full key is only shown once. If you lose it, disconnect it under **Connections** and create a new one.

Each key belongs to one connection and appears in the **Connections** list.

### Step 2: Add the setup to settings.json

Paste the setup into `~/.gemini/settings.json`:

```json
{
  "mcpServers": {
    "elevate": {
      "httpUrl": "https://elevateab.app/api/mcp",
      "headers": { "Authorization": "Bearer YOUR_API_KEY" }
    }
  }
}
```

Gemini CLI uses `httpUrl`, not `url`. If the file already contains other MCP servers, add the `elevate` entry inside the existing `mcpServers` object.

### Step 3: Confirm Gemini can read your data

1. Run `/mcp list`. Elevate should show its tools.
2. Ask Gemini: What tests am I running?

The status box on the Gemini CLI setup screen in Elevate A/B Testing changes from **Waiting for Gemini** to **Connected** once Gemini makes its first request.

### Gemini CLI and Antigravity CLI

Google is moving free and personal accounts from Gemini CLI to Antigravity CLI. The server details are the same, but the settings file may be in a different place.

***

### Troubleshooting

#### /mcp list doesn't show Elevate

**Likely cause:** The entry uses `url` instead of `httpUrl`, or the file is in the wrong place.

**Fix:** Use `httpUrl`, check the file is `~/.gemini/settings.json`, then restart Gemini CLI.

#### Gemini connects but returns nothing

**Likely cause:** The key was disconnected, or `YOUR_API_KEY` was not replaced.

**Fix:** Check the `Authorization` value reads `Bearer` followed by a space and the key. If the key was disconnected under **Connections**, create a new one and update the file.

***

### Next steps

* [MCP Overview](https://docs.elevateab.com/elevate-helpcenter/mcp/mcp-overview.md): every client, and what the assistant can read
* [Manage MCP Connections](https://docs.elevateab.com/elevate-helpcenter/mcp/manage-mcp-connections.md): see and disconnect connections
