opencode-executor-mcp

opencode-executor-mcp

Enables Claude Code to delegate prompts to an OpenCode agent session for cheaper executor-role work, supporting different providers and session persistence.

Category
Visit Server

README

opencode-executor-mcp

MCP server exposing an ask_opencode tool that delegates a prompt to an OpenCode agent session. Lets a Claude Code orchestrator hand off executor-role / bulk work to a cheaper backend instead of spawning another Claude subagent.

Not tied to any specific provider: by default it uses OpenCode's own bundled Zen free models (only needs opencode auth login, no company gateway required). If you have a company/paid gateway configured in OpenCode, pass it explicitly per-call — see docs/ais-switch-setup.md for that as one example, not a requirement.

Claude Code (orchestrator)
   -> MCP tool call: ask_opencode(prompt, provider?, model?, sessionId?)
   -> this server
   -> opencode serve (localhost:4096) REST API
   -> whichever provider is selected (default: OpenCode Zen free tier)

Prerequisites

  • Node.js 18+ (global fetch required)
  • OpenCode CLI installed
  • opencode auth login run once (sets up the bundled Zen free-tier credentials used as the default)
  • Optional: any additional provider configured in OpenCode (company gateway, other API key, etc.) if you want to target something other than the default free models

Setup

  1. Install dependencies:

    npm install
    
  2. Authenticate OpenCode's default (Zen) provider, if you haven't:

    opencode auth login
    
  3. Start the OpenCode server (must stay running while you use the tool):

    opencode serve --port 4096
    
  4. Verify at least one provider is live:

    curl -s http://127.0.0.1:4096/config/providers | jq
    

    You should see a provider with id opencode (the bundled Zen models). Any additional provider you've configured (e.g. ais-switch) will show up alongside it.

  5. Register this server with Claude Code. Add to ~/.claude.json under mcpServers (see docs/claude-code-integration.md for the exact block):

    "opencode-executor": {
      "type": "stdio",
      "command": "node",
      "args": ["/absolute/path/to/opencode-mcp/index.js"]
    }
    
  6. Restart Claude Code. The ask_opencode and list_opencode_models tools are now available.

Usage

list_opencode_models()
# -> [{ providerID: "opencode", modelID: "big-pickle", name: "Big Pickle", bundled: true }, ...]

ask_opencode({ prompt: "summarize this log file" })
# uses the default bundled Zen model

ask_opencode({ prompt: "...", provider: "ais-switch", model: "llm-gateway--deepseek-v4-flash" })
# targets a specific configured provider instead

Omit sessionId for a fresh one-off session (no memory of prior calls). Pass the sessionId returned by a previous ask_opencode call to continue that same conversation — OpenCode retains the history, so the model sees prior turns. This is still call-and-response driven by Claude Code calling the tool each turn; OpenCode never initiates on its own.

Calls can be issued concurrently (fan-out / swarm) since each session is independent unless you deliberately reuse a sessionId; see docs/architecture.md.

Configuration

Env var Default Purpose
OPENCODE_URL http://127.0.0.1:4096 Base URL of the running opencode serve instance
OPENCODE_PROVIDER / OPENCODE_MODEL unset Pin a default provider/model for every call that doesn't specify one, instead of auto-picking the bundled Zen provider

Troubleshooting

See docs/troubleshooting.md.

Docs

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured