Opencode MCP logo

Opencode MCP

Community
AlaeddineMessadi

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.

PublisherAlaeddineMessadi
Repositoryopencode-mcp
LanguageTypeScript
Forks
25
Stars
141
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    Opencode MCP exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    141 stars and 25 forks from the linked repository.

opencode-mcp

npm version license node

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.0.0 requires Node.js 22 or newer. Upgrading from 2.x? See the migration notes.

Quick Start

Install OpenCode and start its server from your project:

bash
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:

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

For clients using an mcpServers configuration:

json
{
  "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

NeedTools
Setup and orientationopencode_setup, opencode_context, opencode_provider_models
Quick question or follow-upopencode_ask, opencode_reply
Start work and waitopencode_run
Work in the backgroundopencode_fire, then opencode_check or opencode_wait
Recover or control a recorded jobopencode_job_list, opencode_job_get, opencode_job_cancel
Resolve required inputopencode_job_input, permission and question tools
Review the resultopencode_review_changes, opencode_conversation
javascript
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.

VariablePurpose
OPENCODE_BASE_URLServer endpoint; defaults to http://127.0.0.1:4096
OPENCODE_SERVER_USERNAME, OPENCODE_SERVER_PASSWORDOptional server HTTP authentication
OPENCODE_AUTO_SERVESet to true to opt in to launching a local server
OPENCODE_DEFAULT_PROVIDER, OPENCODE_DEFAULT_MODELDefault prompt provider/model pair
OPENCODE_TOOL_PROFILEfull (default) or a smaller essential tool set
OPENCODE_TASK_STOREOverride 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

bash
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:

bash
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

Installation

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

Use Opencode MCP MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Opencode MCP is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Opencode MCP as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Opencode MCP MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "opencode-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "opencode-mcp"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Opencode MCP MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Opencode MCP MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Opencode MCP to help me with this task?
Opencode MCP
Sure. I read it.
Here is what I found using Opencode MCP.

Frequently asked questions

What is the Opencode MCP MCP server used for?

Opencode MCP is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Opencode MCP MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Opencode MCP with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Opencode MCP MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Opencode MCP connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Opencode MCP MCP to TypingMind?

Opencode MCP runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Opencode MCP MCP provide in TypingMind?

Opencode MCP exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Opencode MCP MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Opencode MCP requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇