> 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-vs-code.md).

# Connect VS Code

Connect VS Code and GitHub Copilot agent mode to Elevate A/B Testing with an API key in .vscode/mcp.json, then ask about your Shopify experiments.

VS Code connects to Elevate A/B Testing through an MCP configuration file in your project. GitHub Copilot in agent mode can then answer questions about your Shopify experiments from your live data.

The connection is read-only unless you allow changes: VS Code can see your tests and results, and it can't change anything in your store. To let VS Code 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).

The setup keeps your API key out of the file. VS Code asks for the key when the server starts and stores it securely.

***

### Step 1: Copy the setup

1. In Elevate A/B Testing, open **MCP** in the sidebar, and under **Coding tools** select **VS Code**.
2. Copy the setup:

```json
{
  "inputs": [
    {
      "type": "promptString",
      "id": "elevate-key",
      "description": "Elevate API key",
      "password": true
    }
  ],
  "servers": {
    "elevate": {
      "type": "http",
      "url": "https://elevateab.app/api/mcp",
      "headers": { "Authorization": "Bearer ${input:elevate-key}" }
    }
  }
}
```

### Step 2: Create an API key

On the same screen, click **Create key**, and copy the key straight away. For your security, the full key is only shown once. If you lose it, disconnect it under **Connections** and create a new one.

The key is read-only. To let the client make changes, tick **Can make changes** when you create it.

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

### Step 3: Add the setup to your project

1. Paste the setup into `.vscode/mcp.json` in your project.
2. Start the server when VS Code offers to, and paste your API key when it asks. VS Code stores it securely, so it stays out of the file.

### Step 4: Confirm Copilot can read your data

Ask Copilot in agent mode: What tests am I running?

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

***

### Troubleshooting

#### Copilot doesn't use Elevate

**Likely cause:** Copilot is not in agent mode, or the server was not started.

**Fix:** Switch Copilot to agent mode, and start the elevate server from `.vscode/mcp.json`.

#### The server starts but returns nothing

**Likely cause:** The key was disconnected, or a wrong key was pasted.

**Fix:** Create a new key in Elevate A/B Testing, restart the server, and paste the new key when VS Code asks.

***

### 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
