## Install Lightsage MCP in GitHub Copilot

Use this guide for GitHub Copilot in VS Code and GitHub Copilot CLI. Both can connect to remote HTTP MCP servers.

### 1. Get your Lightsage API key
Open the [Lightsage dashboard](https://app.lightsage.com/settings/api), copy your API key, and store it as `LIGHTSAGE_API_KEY`:

```shell
export LIGHTSAGE_API_KEY="ls_cli_your_api_key"
```

Do not put your API key in shared project config, screenshots, issue reports, or public repositories.

### 2. Add Lightsage MCP to GitHub Copilot in VS Code
Open the command palette and run **MCP: Open User Configuration**. Add Lightsage to your user `mcp.json`:

```json
{
  "inputs": [
    {
      "id": "lightsage-api-key",
      "type": "promptString",
      "description": "Lightsage API key",
      "password": true
    }
  ],
  "servers": {
    "lightsage": {
      "type": "http",
      "url": "https://mcp.lightsage.com/mcp",
      "headers": {
        "X-Lightsage-Api-Key": "${input:lightsage-api-key}"
      }
    }
  }
}
```

Keep this in user configuration unless your team has a shared secret-management pattern for workspace MCP config.

### 3. Optional: add Lightsage MCP to Copilot CLI
For Copilot CLI, add Lightsage with the MCP command:

```shell
copilot mcp add --transport http \
  --header "X-Lightsage-Api-Key: ${LIGHTSAGE_API_KEY}" \
  lightsage https://mcp.lightsage.com/mcp
```

You can also add Lightsage to `~/.copilot/mcp-config.json`:

```json
{
  "mcpServers": {
    "lightsage": {
      "type": "http",
      "url": "https://mcp.lightsage.com/mcp",
      "headers": {
        "X-Lightsage-Api-Key": "ls_cli_your_api_key"
      },
      "tools": ["*"]
    }
  }
}
```

Use this only for private user config. Do not commit static API keys.

### 4. Verify GitHub Copilot tools
In VS Code, run **MCP: List Servers** and start the `lightsage` server if it is not already running. In Copilot CLI, run:

```shell
copilot mcp list
```

Then run a read-only prompt:

```text
Use the Lightsage MCP server to check my Lightsage auth status.
```

See the [VS Code MCP configuration reference](https://code.visualstudio.com/docs/agents/reference/mcp-configuration) and [GitHub Copilot CLI MCP docs](https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-mcp-servers).
