> ## Documentation Index
> Fetch the complete documentation index at: https://docs.keupera.com/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenCode

> Connect Keupera to OpenCode as a remote MCP server.

[OpenCode](https://opencode.ai) connects to the Keupera MCP server as a
**remote** server. Authorize with OAuth (browser sign-in) or an API key.

## Option A — OAuth (sign in)

<Steps>
  <Step title="Add the server">
    Add Keupera to `opencode.json` (in your project) or
    `~/.config/opencode/opencode.json` (global):

    ```json theme={null}
    {
      "$schema": "https://opencode.ai/config.json",
      "mcp": {
        "keupera": { "type": "remote", "url": "https://mcp.keupera.com/mcp", "enabled": true }
      }
    }
    ```
  </Step>

  <Step title="Authorize">
    Start OpenCode and sign in to Keupera in the browser when prompted.
  </Step>
</Steps>

## Option B — API key

```json theme={null}
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "keupera": {
      "type": "remote",
      "url": "https://mcp.keupera.com/mcp",
      "enabled": true,
      "headers": { "Authorization": "Bearer sk_live_your_key" }
    }
  }
}
```

Get your key from **Settings → API Keys** in the
[dashboard](https://app.keupera.com).

## Verify and use

Confirm the `keupera` tools are available, then ask, for example:
*"Show my top keyword opportunities and outline an article for the best one."*

[OpenCode MCP docs →](https://opencode.ai/docs/mcp-servers)

## Troubleshooting

<AccordionGroup>
  <Accordion title="Server not loaded">
    Ensure `opencode.json` is valid, `"type"` is `"remote"`, and
    `"enabled": true`. Restart OpenCode to reload the config.
  </Accordion>

  <Accordion title="401 or 'unauthorized' errors">
    For OAuth, restart and sign in again. For an API key, confirm the
    `sk_live_…` value and that your plan includes API access.
  </Accordion>
</AccordionGroup>
