# opencode (/docs/agents/opencode)

[opencode](https://opencode.ai) connects to conciv as an MCP server. In the panel it chats with the models
opencode can use.

## Connect opencode [#connect-opencode]

Run this once, in any folder:

```bash title="Terminal"
npx @conciv/cli mcp connect opencode
```

It adds conciv's MCP server, named conciv-hub, to opencode. Under the hood it runs `opencode mcp add`. On success
it prints:

```json title="Output"
{"ok": true, "data": {"connected": "opencode"}}
```

Then drive the tab you have open from opencode in your terminal. The walkthrough, from the first prompt to
picking a tab and troubleshooting, is in [Outside agent](/docs/usage/outside-agent).

## What conciv runs in the chat [#what-conciv-runs-in-the-chat]

When opencode is the session's harness, conciv runs it on your machine, in your project, with your own login:

```text title="What conciv passes opencode"
model   opencode/claude-sonnet-4-5   <- the default, unless you pick another
```

The model menu lists the models opencode reports as usable, newest first. Past opencode sessions in this project
show in the session list.

## Disconnect [#disconnect]

```bash title="Terminal"
npx @conciv/cli mcp disconnect opencode
```

This stops conciv answering opencode. The `conciv-hub` entry stays in `opencode.json`. conciv
refuses it until you connect again.

<Accordions type="single">
  <Accordion title="opencode asks for permission and no card shows">
    opencode asks in its own way, and those asks do not reach conciv yet. No Permission card shows in the chat.
  </Accordion>
</Accordions>

## Next steps [#next-steps]

- **[Harnesses](/docs/harnesses):** compare what each harness can do.
- **[Approvals](/docs/usage/approvals):** what asks before the agent acts.
- **[Pi](/docs/agents/pi):** the same for Pi.
