# VS Code and GitHub Copilot

URL: https://codepanel.ai/docs/vs-code

Connect GitHub Copilot in VS Code to CodePanel's MCP server with one command, and share it with your team in .vscode/mcp.json.

> [!NOTE]
> Do the [Quickstart](/docs/quickstart) up to adding a provider key first. Copilot cannot add provider keys or change spending limits.

## Setup

### 1. Add the MCP server

```bash tab="Sign in"
code --add-mcp '{"name":"codepanel","type":"http","url":"https://codepanel.ai/mcp"}'
```

```bash tab="Token"
code --add-mcp '{"name":"codepanel","type":"http","url":"https://codepanel.ai/mcp","headers":{"Authorization":"Bearer cpk_..."}}'
```

### 2. Sign in

Skip this step with a token. VS Code asks you to sign in the first time Copilot starts the server. Approve on CodePanel's consent page.

### 3. Teach Copilot the review loop

Copilot reads `AGENTS.md` and `.github/copilot-instructions.md`. Paste the [Repository setup](/docs/agent-setup) prompt into Copilot's agent mode: it writes `.codepanel/rules.md` and adds the review loop to your instructions, in one pull request.

## Verify

Ask Copilot: "Use the CodePanel whoami tool." It answers with your GitHub account and its permissions. Then: "Read CodePanel's review of owner/name#123." If either fails, see [Troubleshooting](/docs/coding-agents#troubleshooting).

## Share with your team

Commit `.vscode/mcp.json` with the URL only. Each person signs in with their own GitHub account.

```json title=".vscode/mcp.json"
{
  "servers": {
    "codepanel": {
      "type": "http",
      "url": "https://codepanel.ai/mcp"
    }
  }
}
```
