# OpenCode — OpenGen Setup

> Configure a remote MCP server and complete the client’s OAuth flow.

- **Client kind:** Local agent
- **Integration approach:** Remote MCP OAuth or OpenGen CLI
- **Verification status:** DOCUMENTED ONLY (LIVE INTEROPERABILITY UNVERIFIED)
- **Reviewed:** 2026-11-03
- **Canonical HTML:** https://opengen.dev/docs/clients/opencode
- **Source reference:** [OpenCode MCP documentation](https://opencode.ai/docs/mcp-servers/)

## Agent Prompt

```text
Walk the user through connecting OpenCode to OpenGen (https://opengen.dev/mcp for authenticated read+generate OAuth, https://opengen.dev/mcp/readonly for zero-auth catalog discovery, or @opengen-dev/cli for shell workflows) following https://opengen.dev/docs/clients/opencode.md. Review configuration commands before running them, keep credentials out of prompts and version control, and verify read-only access (balance / find_models / opengen doctor) before proposing any paid generation.
```

## Setup Steps

1. Review a change to opencode.json. Merge the remote entry below into your existing mcp object.
2. Run opencode mcp auth opengen to open authorization in your browser.
3. Use opencode mcp list to inspect auth status and test discovery before any paid request.

## Configuration & Commands

### Entry to merge into your existing settings

```json
{
  "mcp": {
    "opengen": {
      "type": "remote",
      "url": "https://opengen.dev/mcp"
    }
  }
}
```

## Verification Evidence & Cautions

**Important boundaries:** OpenCode documents automatic OAuth and dynamic registration. No OpenCode version, callback, refresh or OpenGen tool call has been verified end to end.

## Related Links

- [All Agent Clients & Support Matrix](https://opengen.dev/docs/clients.md)
- [MCP Integration Guide](https://opengen.dev/docs/mcp.md)
- [Quickstart Guide](https://opengen.dev/docs/quickstart.md)
- [Installable Skill (skill.md)](https://opengen.dev/skill.md)
- [AI Index (llms.txt)](https://opengen.dev/llms.txt)
