> ## Documentation Index
> Fetch the complete documentation index at: https://lightsage.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Install Lightsage MCP in Gemini CLI

> Connect Gemini CLI to Lightsage MCP with a streamable HTTP MCP server.

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.

<Steps>
  <Step title="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`:

    ```bash theme={null}
    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.
  </Step>

  <Step title="Add Lightsage MCP to Gemini CLI">
    Add Lightsage MCP with Gemini's MCP command:

    ```bash theme={null}
    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 theme={null}
    {
      "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.
  </Step>

  <Step title="Verify Gemini CLI tools">
    List configured MCP servers:

    ```bash theme={null}
    gemini mcp list
    ```

    Then run a read-only prompt:

    ```text theme={null}
    Use the Lightsage MCP server to check my Lightsage auth status.
    ```
  </Step>
</Steps>

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