> ## 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 Pi

> Connect Pi to Lightsage MCP with pi-mcp-extension.

Pi uses the `pi-mcp-extension` package to connect to MCP servers. Use this guide to connect Pi to the hosted Lightsage MCP endpoint.

<Steps>
  <Step title="Get your Lightsage API key">
    Open the [Lightsage dashboard](https://app.lightsage.com/settings/api) and copy your API key.

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

  <Step title="Install the Pi MCP extension">
    Install the MCP extension package:

    ```bash theme={null}
    pi install npm:pi-mcp-extension
    ```
  </Step>

  <Step title="Add Lightsage MCP and verify">
    Add Lightsage MCP to `~/.pi/agent/mcp.json` or `.pi/mcp.json`. `pi-mcp-extension` does not expand `${VAR}` references in config, so put the API key directly in the `headers` value:

    ```jsonc theme={null}
    {
      "mcpServers": {
        "lightsage": {
          "transport": "streamable-http",
          "url": "https://mcp.lightsage.com/mcp",
          "lifecycle": "eager",
          "headers": {
            "X-Lightsage-Api-Key": "ls_cli_your_api_key"
          }
        }
      }
    }
    ```

    Because the key is stored literally, keep this config on a private machine and out of shared repositories.

    Start Pi and use `/mcp` to check server status.

    Then run a read-only prompt:

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

See the [`pi-mcp-extension` package page](https://pi.dev/packages/pi-mcp-extension) for supported transports and config locations.
