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

> Connect OpenCode to Lightsage MCP with a remote MCP server entry.

OpenCode can connect to remote MCP servers from `opencode.json` or `opencode.jsonc`. Use this guide to connect OpenCode to the hosted Lightsage MCP endpoint.

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

**2. Add Lightsage MCP to OpenCode**

Add Lightsage MCP to `opencode.json` or `opencode.jsonc`:

```jsonc theme={null}
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "lightsage": {
      "type": "remote",
      "url": "https://mcp.lightsage.com/mcp",
      "enabled": true,
      "oauth": false,
      "headers": {
        "X-Lightsage-Api-Key": "{env:LIGHTSAGE_API_KEY}"
      }
    }
  }
}
```

**3. Verify OpenCode can use Lightsage**

Run OpenCode and ask it to use the `lightsage` MCP server. Use `opencode mcp list` if you need to inspect connection state.

Then run a read-only prompt:

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

See the [OpenCode MCP docs](https://opencode.ai/docs/mcp-servers/) for local and remote server options.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.