Explainer

OpenCode

OpenCode is the free, open-source, model-agnostic terminal AI coding agent — 75+ providers, your own keys, native MCP. This is the hub: a short overview, then everything you need in one place — install steps, the Claude Code comparison, MCP setup, and the best alternatives.

By DK, Editor  ·  Last verified: 2026-06-20  ·  How we test  ·  Facts only — no hands-on score

01 / Definition

OpenCode runs in your terminal and lets you bring your own model keys across 75+ providers, with native MCP for adding tools. It is free software (npm package opencode-ai, v1.17.8 as of 2026-06-20, maintained by SST); you pay only your own model usage. For the full definition and how it differs from Claude Code, see the deep-dive linked below — this page is the jumping-off point to the rest.

02 / What it does

  • New here? What OpenCode is

    Start with the plain-English explainer: what OpenCode does, its 75+ providers and BYO-key model, and how it differs from Claude Code in one line.

  • Install OpenCode

    The step-by-step install for macOS, Linux, and Windows (curl, npm, or Homebrew), provider authentication, and fixes for common PATH errors — verified against v1.17.8.

  • OpenCode vs Claude Code

    The head-to-head: free/open-source/75+ providers vs Anthropic's proprietary terminal agent — pricing, models, MCP, and who each suits.

  • Add MCP servers

    How to connect MCP servers (GitHub, search, Figma, more) to OpenCode with the opencode mcp add / auth surface, verified first-hand.

  • Alternatives

    If OpenCode is not the fit, see the open-source alternatives (Aider, Cline, Codex CLI) and where each one wins.

04 / Who it's for

  • Developers who want a free, open-source terminal agent without vendor lock-in.
  • Anyone who wants to switch model providers per task or keep API costs in their own hands.
  • Teams standardizing on an auditable, self-hostable coding agent.

05 / Getting started

Pick your entry point: read what OpenCode is, follow the install guide, see how it compares to Claude Code, wire up MCP servers, or weigh the alternatives. The links below take you to each.

FAQ

Where should I start with OpenCode?
If you are new, read "What Is OpenCode?" for the overview, then follow the install guide to get it running. If you are deciding between tools, start with the OpenCode vs Claude Code comparison. All three are linked on this page.
How do I install OpenCode?
Install it with the official curl script, with npm (npm i -g opencode-ai), or with Homebrew (brew install sst/tap/opencode). The npm method works on macOS, Linux, and Windows. Our install guide covers each OS plus provider auth and PATH fixes.
Is OpenCode better than Claude Code?
Neither is universally better. OpenCode is free, open-source, and works with 75+ providers using your own keys; Claude Code is Anthropic's proprietary agent with a deeper subagent layer. See the full comparison linked here to pick by workflow.
What are the best OpenCode alternatives?
The strongest open-source alternatives are Aider (git-first), Cline (VS Code), and Codex CLI (OpenAI's open-source client). Our alternatives and best open-source AI agents pages compare them on the facts.