Opencode

Developer tools

MCP server for OpenCode AI, 70 tools, 10 resources, 5 prompts. Use npx opencode-mcp with Claude Desktop, Claude Code, Cursor, Windsurf, or any MCP client.

Your AI app calls the Opencode MCP server, which does the developer tools work and sends the result back to the chat.

About Opencode

Opencode is a community MCP server from AlaeddineMessadi, filed in our directory under developer tools. MCP server for OpenCode AI, 70 tools, 10 resources, 5 prompts. Use npx opencode-mcp with Claude Desktop, Claude Code, Cursor, Windsurf, or any MCP client.

Opencode runs on your own machine: your AI app starts it with the command npx -y opencode-mcp and talks to it over standard input and output.

At a glance

Publisher
AlaeddineMessadi (community)
Runs
Locally on your machine
Install from
Node.js package on npm: opencode-mcp
Written in
TypeScript
License
MIT
GitHub stars
168

How to set up Opencode

  1. Install Node.js on the machine that runs your AI app, because Opencode starts with npx and downloads its package on first run.
  2. Check the Opencode README for keys or settings; the registry lists none that Opencode requires.
  3. Add Opencode to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Opencode tools to confirm the connection.
  5. Run one read-only task with Opencode first, and keep your app asking before each tool call until the results look right.

Opencode compared with similar servers

  • Regenerator2000 by ricardoquesada has fewer GitHub stars than Opencode (167 against 168); both are community servers, and both run locally.
  • Forge Orchestrator by nxtg-ai has fewer GitHub stars than Opencode (168 against 168); both are community servers, and both run locally.
  • SuperAssistant G by andrewngcanton-gif has fewer GitHub stars than Opencode (167 against 168); both are community servers, and both run locally.

Before you connect Opencode

  • Give Opencode its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Opencode tool call until you trust what it does with them.
  • Treat text that Opencode fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Opencode on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Opencode

How marketing and sales teams put Opencode to work, by company size. Pick the size closest to yours and start Opencode on one use case.

Small business

  • A small business with a developer can use Opencode to ship site and tracking fixes faster, with the AI reading the code it changes.
  • Technical founders can ask Opencode to explain and fix a marketing site issue without context switching between tools.
  • Opencode runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Growth engineers can use Opencode to build landing pages, tracking and integrations in fewer cycles, with reviews kept in the normal flow.
  • Marketing ops engineers can connect Opencode to keep scripts and automations documented and versioned as they change.
  • Start Opencode on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprise engineering teams can roll out Opencode with repo scopes and audit logs, so agents work only where they are allowed.
  • Platform teams can standardize on Opencode so web and marketing engineering share one reviewed way of working with AI.
  • Opencode is a community server, so have security review the code and pin a version before Opencode touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Opencode README

From AlaeddineMessadi/opencode-mcp on GitHub, shared under its MIT license. Images are left out; the original has them.

README.md

opencode-mcp

Delegate coding work to OpenCode from your MCP client.

opencode-mcp connects Claude, Cursor, VS Code, and other MCP clients to OpenCode's headless API. Ask questions, implement features, monitor background work, respond to questions and permissions, and review changes across projects.

Version 3.x requires Node.js 22 or newer and works with OpenCode 1.x (tested with 1.18.31 and 1.19.3). Support for OpenCode 2.x is planned for 4.0. Upgrading from 2.x? See the migration notes.

Quick Start

Install OpenCode and start its server from your project:

opencode serve --hostname 127.0.0.1 --port 4096

If you use the TUI, start it with opencode --port 4096 and share that server. Set OPENCODE_BASE_URL for another endpoint.

For Claude Code:

claude mcp add opencode -- npx -y opencode-mcp

For clients using an mcpServers configuration:

{
  "mcpServers": {
    "opencode": {
      "command": "npx",
      "args": ["-y", "opencode-mcp"]
    }
  }
}

Restart the client and call opencode_setup. Choose a provider from its configured providers, then use opencode_provider_models to select a model. Set OPENCODE_DEFAULT_PROVIDER and OPENCODE_DEFAULT_MODEL together or pass the selected IDs in each prompt call.

Client-specific configuration includes VS Code, Windsurf, Continue, Zed, and Amazon Q. To test unreleased changes, build from source and configure your client to run node with the absolute path to dist/index.js.

Choose a Workflow

Need Tools
Setup and orientation opencode_setup, opencode_context, opencode_provider_models
Quick question or follow-up opencode_ask, opencode_reply
Start work and wait opencode_run
Work in the background opencode_fire, then opencode_check or opencode_wait
Recover or control a recorded job opencode_job_list, opencode_job_get, opencode_job_cancel
Resolve required input opencode_job_input, permission and question tools
Review the result opencode_review_changes, opencode_conversation
opencode_fire({
  directory: "/absolute/path/to/project",
  prompt: "Add input validation to POST /api/users and run the relevant tests",
  providerID: "<configured-provider>",
  modelID: "<available-model>"
})
// Save the returned job and session IDs; use them to monitor or resume observation.

Async results distinguish accepted, running, input_required, completed, failed, cancelled, and unknown. An observation timeout returns current progress; it does not mean the task failed or was cancelled. Follow the returned state and IDs instead of assuming an absent busy status means success.

Modern clients can use the MCP Tasks extension for opencode_run. Clients without that extension use ordinary tools, including opencode_fire and opencode_check. Task status is retrieved by polling; this package does not promise to wake an idle assistant with completion notifications.

Tools retain readable text and provide structured results for clients that consume them. Prompt tools accept optional model variants and OpenCode structured-output formats. See the generated tools reference and examples.

Multi-Project Use

Project-scoped tools accept directory: an absolute path on the OpenCode server. POSIX, Windows drive, and UNC paths are preserved across client operating systems. Relative paths are rejected; OpenCode checks existence and access.

opencode_project_init({path: "/absolute/local/project"}) creates or opens a directory on the MCP host. For remote OpenCode servers, create the project on that server instead. Authentication tools are global. Resources offer both static reads of the default project and explicit project/session templates.

Independent sessions do not isolate filesystem changes. Use separate project directories or Git worktrees when running overlapping coding tasks in parallel.

Configuration

All settings are optional; an OpenCode server must already be running by default.

Variable Purpose
OPENCODE_BASE_URL Server endpoint; defaults to http://127.0.0.1:4096
OPENCODE_SERVER_USERNAME, OPENCODE_SERVER_PASSWORD Optional server HTTP authentication
OPENCODE_SERVER_TOKEN Optional bearer token, e.g. an OpenChamber client token
OPENCODE_OPENCHAMBER_PASSWORD, OPENCODE_OPENCHAMBER_URL Sign in to an OpenChamber-fronted server
OPENCODE_OPENCHAMBER_CLIENT_ID Overrides the per-process OpenChamber client identifier; see configuration
OPENCODE_AUTO_SERVE Set to true to opt in to launching a local server
OPENCODE_DEFAULT_PROVIDER, OPENCODE_DEFAULT_MODEL Default prompt provider/model pair
OPENCODE_TOOL_PROFILE full (default) or a smaller essential tool set
OPENCODE_TASK_STORE Override the local directory for persisted job records

See configuration for storage, permissions, and client setup. Auto-start only supports local loopback HTTP endpoints; custom OpenCode CLI flags require a manually started server.

Development and Verification

npm ci
npm test
npm run test:coverage

Tests use local fixtures and do not require a model subscription. For controlled live checks against a local OpenCode server:

npm run build
node scripts/mcp-smoke-test.mjs

Live smoke checks use a disposable project and owned session. Inference is opt-in with an explicitly selected provider and model. See live verification and releases for scope, skipped capabilities, and publishing checks.

Documentation

MIT license · OpenCode API · Model Context Protocol

Questions about Opencode

What is the Opencode MCP server?

MCP server for OpenCode AI, 70 tools, 10 resources, 5 prompts. Use npx opencode-mcp with Claude Desktop, Claude Code, Cursor, Windsurf, or any MCP client. Opencode is maintained by AlaeddineMessadi on GitHub at AlaeddineMessadi/opencode-mcp, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Opencode MCP server?

Add Opencode to your AI app's MCP config with the command npx -y opencode-mcp. In Claude Code, run claude mcp add --transport stdio opencode -- npx -y opencode-mcp. To run Opencode this way you need Node.js installed.

Does Opencode need an API key?

The registry lists no required keys for Opencode. Check the Opencode README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is Opencode an official MCP server?

No. Opencode is a community server maintained by AlaeddineMessadi. Community servers can be excellent; read the code and the open issues before you give Opencode access to company data.

What license is Opencode under?

Opencode is released under the MIT license, according to its GitHub repository. The license covers the code of Opencode; the service it connects to has its own terms.