## Install Lightsage MCP in Gemini CLI

Gemini CLI can connect to streamable HTTP MCP servers from `settings.json` or through `gemini mcp add`. Use this guide to connect Gemini CLI to the hosted Lightsage MCP endpoint.

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

Add Lightsage MCP with Gemini’s MCP command:

```shell
gemini mcp add --transport http lightsage https://mcp.lightsage.com/mcp \
  --header "X-Lightsage-Api-Key: \\${LIGHTSAGE_API_KEY}" \
  --header "Accept: application/json, text/event-stream"
```

If you edit `~/.gemini/settings.json` or `.gemini/settings.json` directly, use the `httpUrl` transport field:

```json
{
  "mcpServers": {
    "lightsage": {
      "httpUrl": "https://mcp.lightsage.com/mcp",
      "headers": {
        "X-Lightsage-Api-Key": "ls_cli_your_api_key",
        "Accept": "application/json, text/event-stream"
      }
    }
  }
}
```

Keep the `Accept: application/json, text/event-stream` header in both forms. Without it, streamable HTTP MCP initialization can fail. Prefer the command form when possible so the header is expanded from your shell instead of written into project config.

### 3. Verify Gemini CLI tools

List configured MCP servers:

```shell
gemini mcp list
```

Then run a read-only prompt:

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

See the [Gemini CLI MCP docs](https://google-gemini.github.io/gemini-cli/docs/tools/mcp-server.html) for the full `mcpServers` configuration reference.
