← Back to directory
O

OpenCode MCP Server

Community
Delegate coding work to OpenCode from an MCP client.
Category
Dev Tools #239 of 751
Stars
★ 168 Popular
Transport
stdio (local process)
Runtime
Node.js 22+
Credentials
No credential needed
License
MIT
Last commit
Tools
15
54FMRS · D

This developer tool server connects MCP clients to the OpenCode headless API. The README provides an npx client configuration example, instructions for starting the OpenCode server, and task workflows. The server manifest was not cached, so the listed tool identifiers come from README workflows and do not represent the complete tool inventory.

Strongest · Setup experience 13/20 Weakest · Reliability 9/20

Reliability
9/20
Security and permissions
10/20
Maintenance
9/20
Documentation
13/20
Setup experience
13/20
Why each score
Reliability 9/20
The README describes initialization, tool workflows, asynchronous job states, timeout semantics, and related limits, and mentions tests and a local smoke check. These are unverified documentation claims; the manifest is unavailable, so the MCP handshake, tool implementations, CI, and test coverage cannot be checked. Points are deducted for that uncertainty.
Security and permissions 10/20
The documentation describes project path scope, server authentication settings, task-record storage, and the fact that parallel sessions do not isolate filesystem changes. It does not provide evidence about permission enforcement, sensitive-data flows, confirmation for dangerous operations, or dependency security; the unavailable manifest prevents verification of those boundaries. No red-line evidence is present.
Maintenance 9/20
An MIT license, Node.js and OpenCode version requirements, and an unarchived status are provided. Commit and release history, maintainer response, a security reporting channel, and dependency update practices are absent. Stars and open issue count do not increase the score.
Documentation 13/20
The README provides installation examples, configuration variables, workflows, path rules, asynchronous status semantics, and links to further documentation. Tool parameter details rely on unavailable references, cost and troubleshooting coverage is limited, and the documented capabilities cannot be checked against the unavailable manifest, so the score is not higher.
Setup experience 13/20
The README gives a Node.js 22+ requirement, OpenCode server startup steps, a Claude Code command, a generic mcpServers configuration, the default endpoint, and links to client-specific instructions. OpenCode must be installed and started first, and model selection and server authentication add configuration steps. There is no verifiable execution evidence, so points are deducted.

Static review · not runReviewed 2026-11-29

Read the FMRS scoring method →

Fit and risk

What it can accessReads local filesWrites / deletes local filesRuns commands or codeUses the network

Best for

  • Developers who want to use OpenCode's headless API from an MCP client.
  • Users who need to delegate coding work in a project and observe its progress.

Not for

  • Users without access to an OpenCode server who are not prepared to start one; the default setup expects a running server.
  • Users who require OpenCode 2.x support; the README says this is planned for 4.0.

Required permissions

  • Requires access to an OpenCode server; project tools use absolute paths on that server.
  • The project initialization tool creates or opens a directory on the MCP host.
  • Tasks may read or modify files in the selected project; independent sessions share filesystem changes.
  • Optional server authentication credentials are supplied through configuration variables.

Risks and side effects

  • Coding tasks can change project files; independent sessions do not isolate filesystem changes.
  • An observation timeout returns current progress and does not mean a task failed or was cancelled.
  • Relative project paths are rejected, and OpenCode checks path existence and access.
  • Automatic startup supports only local loopback HTTP endpoints; custom OpenCode CLI flags require a manually started server.

Setup

Before you start

Runtime:Node.js 22+

OPENCODE_SERVER_PASSWORD optionalsecret HTTP authentication password for the OpenCode server, if enabled.
OPENCODE_SERVER_TOKEN optionalsecret Optional bearer token for the OpenCode server, such as an OpenChamber client token.
OPENCODE_OPENCHAMBER_PASSWORD optionalsecret Password used to sign in to an OpenChamber-fronted server.
Other optional settings (9)
OPENCODE_BASE_URL optional OpenCode server endpoint; defaults to http://127.0.0.1:4096.
OPENCODE_SERVER_USERNAME optional HTTP authentication username for the OpenCode server, if enabled.
OPENCODE_OPENCHAMBER_URL optional URL of the OpenChamber-fronted server.
OPENCODE_OPENCHAMBER_CLIENT_ID optional Overrides the per-process OpenChamber client identifier.
OPENCODE_AUTO_SERVE optional Set to true to opt in to launching a local server.
OPENCODE_DEFAULT_PROVIDER optional Default provider for prompts; set together with OPENCODE_DEFAULT_MODEL.
OPENCODE_DEFAULT_MODEL optional Default model for prompts; set together with OPENCODE_DEFAULT_PROVIDER.
OPENCODE_TOOL_PROFILE optional Tool profile: full (default) or essential.
OPENCODE_TASK_STORE optional Overrides the local directory used for persisted job records.

Install OpenCode and start its server from your project, for example with opencode serve --hostname 127.0.0.1 --port 4096. Configure the MCP client to run npx with arguments -y and opencode-mcp; Claude Code can use claude mcp add opencode -- npx -y opencode-mcp. Restart the client and call opencode_setup, choose a provider, then select a model with opencode_provider_models.

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

Shown for Claude Code. Other clients may use a different file or key (VS Code uses "servers") — the configurator below converts it.

.vscode/mcp.json
{
  "servers": {
    "opencode": {
      "command": "npx",
      "args": [
        "-y",
        "opencode-mcp"
      ]
    }
  }
}

Goes in your project's .vscode/mcp.json (VS Code uses a "servers" key).

~/.codex/config.toml
[mcp_servers.opencode]
command = "npx"
args = ["-y", "opencode-mcp"]

Append to ~/.codex/config.toml (OpenAI Codex CLI uses TOML).

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

Run it in a terminal; replace any <…> placeholders with your own values first.

Check that it works

Restart the MCP client, confirm opencode_setup appears in its tool list, and call it to verify the connection to the OpenCode server.

Troubleshooting

  1. Confirm the OpenCode server is running and check `http://127.0.0.1:4096` or the configured `OPENCODE_BASE_URL`.
  2. Confirm Node.js is version 22 or newer and OpenCode is 1.x.
  3. Restart the MCP client, call `opencode_setup`, and check provider and model configuration.
  4. Ensure the project directory is an absolute path on the OpenCode server and is accessible to it.
  5. After a background task times out, use its returned state and ID with the check or wait tools to continue observing it.

Things to try

Once connected, you can ask your AI assistant things like:

  • Explain the current project structure and suggest a code issue to fix.
  • Add input validation to the user creation endpoint and run the relevant tests.
  • Start a background coding task to update the project, then check its progress.
  • Review the recent changes and summarize the result.

Tools 15

opencode_setup read-only
Check and configure the OpenCode connection.
opencode_context read-only
Inspect OpenCode context information.
opencode_provider_models read-only
List models available from configured providers.
opencode_ask writes
Ask OpenCode a question or follow up in a conversation.
opencode_reply writes
Reply to a question in an OpenCode conversation.
opencode_run writes
Start work and wait for the result.
opencode_fire writes
Start work in the background.
opencode_check read-only
Check background task progress.
Show 7 more tools
opencode_wait read-only
Wait for background task progress.
opencode_job_list read-only
List recorded jobs.
opencode_job_get read-only
Get details for a recorded job.
opencode_job_cancel writes
Cancel a recorded job.
opencode_job_input writes
Provide input to a job that requires it.
opencode_review_changes read-only
Review changes produced by a task.
opencode_conversation read-only
Inspect an OpenCode conversation.

Use cases

Ask questions or delegate coding work from an MCP client.
Run coding tasks in the background and track their status.
Respond to questions or permission input requested by OpenCode.
Review conversations and changes from coding tasks.

Supported clients

Claude Code
Claude DesktopPartial support
CursorPartial support
VS CodePartial support
WindsurfPartial support
ContinuePartial support
ZedPartial support
Amazon QPartial support

Listed from the project's documentation, not tested by this site.

Overview

OpenCode MCP Server connects MCP clients such as Claude, Cursor, and VS Code to OpenCode's headless API. It supports asking questions, implementing features, monitoring background work, responding to questions and permission requests, and reviewing project changes. Version 3.x requires Node.js 22 or newer and works with OpenCode 1.x. The README describes 70 tools, 10 resources, and 5 prompts; the tool profile can be full or the smaller essential set.

Similar servers

Source revision 609560d4e08b Data synced 2026-12-05 Read the FMRS scoring method Markdown

Maintainer badge: embed FMRS score

Paste this Markdown into your repository README to display a live score badge:

README.md
[![FollowMCP](https://followmcp.com/badges/opencode-mcp.svg)](https://followmcp.com/en/servers/opencode-mcp)