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

# OpenCode

> Connect OpenCode to the Sevalla MCP server using OAuth or API key authentication.

Use this guide to connect OpenCode to the Sevalla MCP server at `https://mcp.sevalla.com/mcp`.

After setup, OpenCode can call Sevalla MCP tools like `search` and `execute` from the same session.

## Quick setup (CLI + OAuth)

OAuth is the recommended authentication method.

1. Add a remote MCP server from the OpenCode CLI:

```bash theme={null}
opencode mcp add
```

2. In the interactive prompt, choose:
   * Type: `remote`
   * Name: `sevalla`
   * URL: `https://mcp.sevalla.com/mcp`
3. Authenticate:

```bash theme={null}
opencode mcp auth sevalla
```

4. Verify the server status:

```bash theme={null}
opencode mcp list
```

## Manual configuration (`opencode.json`)

You can configure MCP servers in:

* `opencode.json` in your project root (project scope)
* `~/.config/opencode/opencode.json` (global scope)

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

If you need API key auth instead of OAuth:

```json theme={null}
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "sevalla": {
      "type": "remote",
      "url": "https://mcp.sevalla.com/mcp",
      "oauth": false,
      "headers": {
        "Authorization": "Bearer {env:SEVALLA_API_KEY}"
      }
    }
  }
}
```

## Configuration scope

OpenCode merges config layers. Project config overrides conflicting values from global config.

* Global scope: `~/.config/opencode/opencode.json`
* Project scope: `opencode.json`

## Uninstall

1. Run:

```bash theme={null}
opencode mcp logout sevalla
```

2. Delete the `sevalla` entry from `opencode.json` in your project root.

## Reference

* Sevalla MCP endpoint: `https://mcp.sevalla.com/mcp`
* Sevalla MCP repository: [github.com/sevalla-hosting/mcp](https://github.com/sevalla-hosting/mcp)
