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

# OpenCode

> Add Octen to OpenCode with the Octen plugin.

For AI agents: [docs.octen.ai/integrations/opencode.md](https://docs.octen.ai/integrations/opencode.md)

The plugin connects to the hosted [Octen MCP Server](https://docs.octen.ai/integrations/octen-mcp-server.md) and adds the `octen-search-guide` skill, which tells OpenCode which Octen tool fits a request.

> [card] [Get API Key](https://octen.ai/platform/api-keys)
>
> Create a key from the API Platform.

> [card] [npm](https://www.npmjs.com/package/@octen.ai/opencode-plugin)
>
> The `@octen.ai/opencode-plugin` package.

> [card] [GitHub](https://github.com/Octen-Team/octen-js/tree/main/integrations/opencode-plugin)
>
> View the plugin source.

## Install

> [!NOTE]
>
> You'll need an Octen API key first. Create one from the [API Platform](https://octen.ai/platform/api-keys).

Requires OpenCode 1.18.29 or later (below 2.0).

**1. Add the plugin**

Add the plugin to `~/.config/opencode/opencode.json` for every project, or to `opencode.json` at a project root for that project only:

```json theme={null}
{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["@octen.ai/opencode-plugin"]
}
```

OpenCode installs the plugin the next time it starts. The first time OpenCode loads any plugin, it also installs its plugin runtime, which can take a few minutes.

**2. Sign in to Octen**

Run `opencode mcp auth octen` to open the Octen sign-in in your browser. On the Octen consent page, choose the account and API key the connection uses, then click **Allow**.

**3. Confirm the connection**

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

The output shows `✓ octen connected`. Until you sign in, it shows `⚠ octen needs authentication`.

The plugin exposes every [Octen MCP tool](https://docs.octen.ai/integrations/octen-mcp-server.md#tools).

To use an API key instead of signing in, export it in your shell profile (`~/.zshrc` or `~/.bashrc`):

```bash theme={null}
export OCTEN_API_KEY="your-api-key"
```

***

Last modified on November 24, 2026


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