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

**1. 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.

**2. Install the Pi MCP extension**  
Install the MCP extension package:

```bash
pi install npm:pi-mcp-extension
```

**3. 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
{
  "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
Use the Lightsage MCP server to check my Lightsage auth status.
```

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