opencode-mcp

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.

121
Stars
24
Forks
TypeScript
Language
8/23/2026
Added
View on GitHubDownload ZIP

⚠️ Third-Party Software Notice

This skill is third-party open-source software developed and hosted independently on GitHub. SkillTip is an informational directory and does not control or maintain the underlying repository. Any security checks displayed are automated and limited in scope. Review the source code before installing.

Read the Terms of Service

Installation

Add to your Claude Code skills directory:

# Add to your Claude Code skills
git clone https://github.com/AlaeddineMessadi/opencode-mcp

Getting Started

Guides for using skills like opencode-mcp.

Security Report

Verified

Last scanned: —

{
  "status": "PASSED",
  "issues": []
}

README.md

opencode-mcp

npm version license node npm downloads

Give any MCP client the power of OpenCode.

opencode-mcp is an MCP server that bridges your AI tools (Claude, Cursor, Windsurf, VS Code, etc.) to OpenCode's headless API. It lets your AI delegate real coding work — building features, debugging, refactoring, running tests — to OpenCode sessions that autonomously read, write, and execute code in your project.

80 tools | 10 resources | 6 prompts | Multi-project | Auto-start

Why Use This?

  • Delegate coding tasks — Tell Claude "build me a REST API" and it delegates to OpenCode, which creates files, installs packages, writes tests, and reports back.
  • Parallel work — Fire off multiple tasks to OpenCode while your primary AI keeps working on something else.
  • Any MCP client — Works with Claude Desktop, Claude Code, Cursor, Windsurf, VS Code Copilot, Cline, Continue, Zed, Amazon Q, and any other MCP-compatible tool.
  • Zero setup — The server auto-starts the OpenCode HTTP server in-process via the official @opencode-ai/sdk if one isn't already running. No manual steps.

Quick Start

Prerequisite: OpenCode must be installed. curl -fsSL https://opencode.ai/install | bash or npm i -g opencode-ai or brew install sst/tap/opencode

Claude Code:

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

Claude Desktop / Cursor / Windsurf / Cline / Continue (add to your MCP config):

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

That's it. Restart your client and OpenCode's tools will be available.

See Configuration for all client configs (VS Code Copilot, Zed, Amazon Q, etc.) and environment variables.

How It Works

MCP Client  <--stdio-->  opencode-mcp  <--HTTP-->  OpenCode Server
(Claude, Cursor, etc.)   (this package)            (in-process via @opencode-ai/sdk,
                                                    or external opencode serve)

Your MCP client calls tools over stdio. This server translates them into HTTP requests to the OpenCode headless API. If no OpenCode server is reachable at OPENCODE_BASE_URL, one is started in-process via the official @opencode-ai/sdk. The directory parameter on every tool routes that request to a specific project via the x-opencode-directory header, so a single MCP instance can fan out across many project roots.

Key Tools

The 80 tools are organized into tiers. Start with the workflow tools — they handle the common patterns in a single call.

Workflow Tools (13) — Start Here

ToolWhat it does
opencode_setupCheck server health, providers, and project status. Use first.
opencode_askCreate session + send prompt + get answer. One call.
opencode_replyFollow-up message in an existing session
opencode_runSend a task and wait for completion (session + async send + polling)
opencode_fireFire-and-forget: dispatch a task, return immediately
opencode_checkCompact progress report for a running session (status, todos, files changed)
opencode_conversationGet formatted conversation history
opencode_sessions_overviewQuick overview of all sessions
opencode_contextProject + VCS + config + agents in one call
opencode_review_changesFormatted diff summary for a session
opencode_waitPoll an async session until it finishes
opencode_provider_testQuick-test whether a provider is working
opencode_statusHealth + providers + sessions + VCS dashboard

Recommended Patterns

Quick question:

opencode_ask({ prompt: "Explain the auth flow in this project" })

Build something and wait:

opencode_run({ prompt: "Add input validation to POST /api/users", maxDurationSeconds: 300 })

Parallel background tasks:

opencode_fire({ prompt: "Refactor the auth module to use JWT" })
→ returns sessionId immediately
opencode_check({ sessionId: "..." })
→ check progress anytime

All Tool Categories

CategoryCountDescription
Workflow13High-level composite operations
Session20Create, list, fork, share, abort, revert, permissions
Message6Send prompts, execute commands, run shell
File & Search6Search text/regex, find files/symbols, read files
System13Health, VCS, LSP, MCP servers, agents, logging
TUI Control9Remote-control the OpenCode terminal UI
Provider & Auth6List providers/models, set API keys, OAuth
Config3Get/update configuration
Project3List, inspect, and initialize projects
Events1Poll real-time SSE events

Resources (10)

Browseable data endpoints — your client can read these without tool calls:

URIDescription
opencode://project/currentCurrent active project
opencode://configCurrent configuration
opencode://providersProviders with models
opencode://agentsAvailable agents
opencode://commandsAvailable commands
opencode://healthServer health and version
opencode://vcsVersion control info
opencode://sessionsAll sessions
opencode://mcp-serversMCP server status
opencode://file-statusVCS file status

Prompts (6)

Guided workflow templates your client can offer as selectable actions:

PromptDescription
opencode-code-reviewReview diffs from a session
opencode-debugStep-by-step debugging workflow
opencode-project-setupGet oriented in a new project
opencode-implementHave OpenCode build a feature
opencode-best-practicesSetup, tool selection, monitoring, and pitfalls
opencode-session-summarySummarize what happened in a session

Multi-Project Support

Every tool accepts an optional directory parameter to target a different project. No restarts needed.

opencode_ask({ directory: "/home/user/mobile-app", prompt: "Add navigation" })
opencode_ask({ directory: "/home/user/web-app", prompt: "Add auth" })

Use opencode_project_init to scaffold a new project directory (or open a preexisting one) before the first call, so the OpenCode server registers it as a project:

opencode_project_init({ path: "/home/user/new-project" })
// → "Successfully initialized project directory at: /home/user/new-project"

opencode_run({ directory: "/home/user/new-project", prompt: "Set up a Vite + React app" })

Environment Variables

All optional. Only needed if you've changed defaults on the OpenCode server.

VariableDefaultDescription
OPENCODE_BASE_URLhttp://127.0.0.1:4096OpenCode server URL
OPENCODE_SERVER_USERNAMEopencodeHTTP basic auth username
OPENCODE_SERVER_PASSWORD(none)HTTP basic auth password (enables auth when set)
OPENCODE_AUTO_SERVEtrueAuto-start an in-process OpenCode server (via @opencode-ai/sdk) if none is reachable at OPENCODE_BASE_URL
OPENCODE_DEFAULT_PROVIDER(none)Default provider ID when not specified per-tool (e.g. anthropic)
OPENCODE_DEFAULT_MODEL(none)Default model ID when not specified per-tool (e.g. claude-sonnet-4-5)

Development

git clone https://github.com/AlaeddineMessadi/opencode-mcp.git
cd opencode-mcp
npm install
npm run build
npm start        # run the MCP server
npm run dev      # watch mode
npm test         # 328 tests

Smoke Testing

End-to-end test against a running OpenCode server:

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

Documentation

References

License

MIT

Frequently Asked Questions

What is opencode-mcp?

opencode-mcp is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by 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. It has 121 GitHub stars.

Is opencode-mcp safe to use?

opencode-mcp failed SkillsLLM's automated security scan, which flagged one or more high-severity issues. Review the Security Report section carefully before using it.

How do I install opencode-mcp?

Clone the repository with "git clone https://github.com/AlaeddineMessadi/opencode-mcp" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is opencode-mcp written in?

opencode-mcp is primarily written in TypeScript. It is open-source under AlaeddineMessadi on GitHub, so you can review or fork the full source.

Are there alternatives to opencode-mcp?

Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh opencode-mcp against similar tools.

Comments (0)

No comments yet. Be the first to share your thoughts!

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI Agentsai-agentsanthropicclaude-code
View details
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI Agentsai-agentsbrainstorming
View details

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI Agentsai-agentsanthropicclaude-code
View details

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI Agentsclaude-codeai-tools
View details

claude-code

by anthropics

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

120,03119,897Shell
AI Agents
View details

Developers Also Liked

Based on votes and bookmarks from developers who liked this skill

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI Agentsai-agentsanthropicclaude-code
View details
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI Agentsai-agentsbrainstorming
View details

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP Serversapisai-tools
View details

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI Agentsai-agentsanthropicclaude-code
View details

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI Agentsclaude-codeai-tools
View details