## Install Lightsage MCP in Cursor

Cursor supports remote MCP servers with OAuth. Add the hosted Lightsage server from Cursor's MCP settings, then sign in and select the Lightsage organization the connection can access.

**1. Open Cursor's MCP settings**

Press `Cmd+Shift+P` on macOS or `Ctrl+Shift+P` on Windows and Linux. Run **View: Open MCP Settings**.

**2. Add the Lightsage server**

Click **Add New MCP Server**. Cursor opens its `mcp.json` configuration file instead of showing a setup form.

Add Lightsage under `mcpServers`:

```json
theme={null}
{
  "mcpServers": {
    "lightsage": {
      "url": "https://mcp.lightsage.com/mcp"
    }
  }
}
```

If the file already contains other servers, add only the `lightsage` property inside the existing `mcpServers` object. Do not replace the other entries.

Save the file, return to **MCP settings**, and make sure `lightsage` is enabled.

**3. Sign in with OAuth**

Start the sign-in action for Lightsage in Cursor. When your browser opens, sign in, select your Lightsage organization, and approve access.

**4. Verify the connection**

Return to Cursor and confirm that Lightsage shows as connected. Then run a read-only prompt:

```text
theme={null}
Use the Lightsage MCP server to check my Lightsage auth status.
```

## Use Lightsage from the Agent CLI

The Agent CLI reads the same MCP configuration as Cursor. It uses `.cursor/mcp.json` in the current project or `~/.cursor/mcp.json` for all projects. If you completed the Cursor steps above, do not add the server again.

Authenticate and verify the server:

```bash
theme={null}
agent mcp login lightsage
agent mcp list
agent mcp list-tools lightsage
```

## Use an API key instead

For automation or another environment where interactive OAuth is unavailable, configure a Lightsage API key in `~/.cursor/mcp.json` for global access or `.cursor/mcp.json` inside one project:

```json
theme={null}
{
  "mcpServers": {
    "lightsage": {
      "url": "https://mcp.lightsage.com/mcp",
      "headers": {
        "X-Lightsage-Api-Key": "${env:LIGHTSAGE_API_KEY}"
      }
    }
  }
}
```

Set `LIGHTSAGE_API_KEY` before starting Cursor:

```bash
theme={null}
export LIGHTSAGE_API_KEY="ls_cli_your_api_key"
```

Create and revoke API keys from the [Lightsage dashboard](https://app.lightsage.com/settings/api). Do not put API keys in shared project config or commit them to a repository.

See the [Cursor MCP docs](https://cursor.com/docs/mcp) for config locations and remote server authentication.
