One JSON block, one command.

## 1 · Add the server

Add this to your `opencode.json`:

```json
{
  "mcp": {
    "brain": { "type": "remote", "url": "https://brain.levirge.com/mcp", "enabled": true }
  }
}
```

## 2 · Sign in

Run this and sign in when the browser opens:

```bash
opencode mcp auth brain
```

## 3 · Verify

Ask for a read-only call: `kb_overview` returns your workspace's knowledge
summary.

## Using a token instead

For machines that cannot open a browser (CI, a server). Get a
[token](/brain/docs/install/mcp#auth) first, add a `headers` line to the block,
and skip `opencode mcp auth`:

```json
{
  "mcp": {
    "brain": {
      "type": "remote",
      "url": "https://brain.levirge.com/mcp",
      "enabled": true,
      "headers": { "Authorization": "Bearer <your-token>" }
    }
  }
}
```

## Troubleshooting

**It did not ask me to sign in.** Run `opencode mcp auth brain`. Check the state
with `opencode mcp list`; `opencode mcp debug brain` shows what failed.

**"401" or "Unauthorized" with a token.** Check the header is exactly
`Authorization: Bearer <your-token>`, and that the token has not been revoked on
[Profile → MCP Tokens](https://brain.levirge.com/profile).

**I connected, but there are no Brain tools.** Clients read the tool list once,
when they connect. Restart OpenCode so it reconnects.

## Other clients

Every guide is listed under [any MCP client](/brain/docs/install/mcp). No
workspace yet? [Request access](/contact).
