gemini cli.md

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, copy your API key, and store it as LIGHTSAGE_API_KEY:

echo "export LIGHTSAGE_API_KEY=\"ls_cli_your_api_key\"" >> ~/.bashrc
source ~/.bashrc

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:

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:

{
  "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:

gemini mcp list

Then run a read-only prompt:

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

See the Gemini CLI MCP docs for the full mcpServers configuration reference.