OpenCode

v1.0.0Coding Agentsstable

An MCP server that enables discovery and interaction with multiple OpenCode instances across different machines using SSH reverse tunnels. It provides tools for listing instances, managing chat sessions, and sending messages to remote coding environm

agentsagentskillsclaude-codeclaude-skillsconfiguration
Share:
128
Stars
0
Downloads
0
Weekly
0/5

What is OpenCode?

OpenCode is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to mcp server that enables discovery and interaction with multiple opencode instances across different machines using ssh reverse tunnels. it provides tools for listing instances, managing chat sessions,...

An MCP server that enables discovery and interaction with multiple OpenCode instances across different machines using SSH reverse tunnels. It provides tools for listing instances, managing chat sessions, and sending messages to remote coding environm

This server falls under the Coding Agents category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • An MCP server that enables discovery and interaction with mu

Use Cases

Discover multiple OpenCode instances via SSH
Manage remote coding environments
Send messages to remote AI agents
klutometis

Maintainer

LicenseMIT License
Languagepython
Versionv1.0.0
UpdatedMay 19, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx opencode

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use OpenCode

The opencode-mcp server lets a single AI agent discover and communicate with multiple OpenCode instances running across different machines, using SSH reverse tunnels as a relay. It exposes three MCP tools — list instances, send a message to a session, and read recent messages — enabling multi-machine AI coding workflows where one orchestrator agent can delegate tasks to remote OpenCode processes. It is particularly useful for distributed development setups, CI machines, or cloud VMs where you want centralized AI control over several concurrent coding environments.

Prerequisites

  • Node.js and npm installed on the machine running the MCP server
  • OpenCode installed on each remote machine you want to control
  • SSH access (and optionally gcloud CLI) for the relay tunnel if using remote instances
  • An MCP client such as Claude Desktop or Claude Code
  • The `opencode-connected` helper script placed in your PATH
1

Clone and build the repository

Clone the opencode-mcp repository and compile the TypeScript source.

git clone https://github.com/klutometis/opencode-mcp.git && cd opencode-mcp && npm install && npm run build
2

Install the opencode-connected helper script

Symlink the helper script into a directory on your PATH so each OpenCode instance can register itself with the relay.

ln -s ~/path/to/opencode-mcp/scripts/opencode-connected ~/bin/opencode-connected
3

Start an OpenCode instance and register it

On each machine where OpenCode is running, call opencode-connected to register the instance with the local relay directory. Set INSTANCE_NAME to give it a memorable label.

INSTANCE_NAME=my-laptop opencode-connected
4

Configure a remote relay with SSH (optional)

For instances on remote machines, set RELAY_SSH_CMD to the SSH command that reaches your relay host. The script will tunnel the registration through SSH.

export RELAY_SSH_CMD="gcloud compute ssh mcp-gateway --zone=us-central1-a --project=my-project --"
INSTANCE_NAME=cloud-vm opencode-connected
5

Configure your MCP client to start the opencode-mcp server

Add the opencode-mcp server to your MCP client so it can use the instances, send, and read tools.

{
  "mcpServers": {
    "opencode": {
      "command": "node",
      "args": ["/path/to/opencode-mcp/dist/index.js"],
      "env": {
        "RELAY_REGISTRY_DIR": "/tmp/opencode-relay"
      }
    }
  }
}

OpenCode Examples

Client configuration (stdio transport)

Configure Claude Desktop to launch the opencode-mcp server and connect to the local relay registry.

{
  "mcpServers": {
    "opencode": {
      "command": "node",
      "args": ["/path/to/opencode-mcp/dist/index.js"],
      "env": {
        "RELAY_REGISTRY_DIR": "/tmp/opencode-relay",
        "DISCOVERY_INTERVAL_MS": "30000"
      }
    }
  }
}

Prompts to try

Use these prompts with an AI assistant connected to the opencode-mcp server to orchestrate remote coding sessions.

- "List all available OpenCode instances and their current status."
- "Send a message to the 'cloud-vm' instance: refactor the authentication module to use JWT."
- "Read the last 20 messages from the 'my-laptop' OpenCode session."
- "Check which instances are currently idle and delegate the test-writing task to one of them."
- "Abort the current task running on the 'cloud-vm' instance."

Troubleshooting OpenCode

The instances tool returns an empty list

Make sure opencode-connected has been run on each machine with a unique INSTANCE_NAME. Check that RELAY_REGISTRY_DIR points to the same directory used by opencode-connected (default: /tmp/opencode-relay). Registrations expire, so re-run opencode-connected if needed.

send tool times out when messaging a remote instance

SEND_TIMEOUT_MS defaults to 300000ms (5 minutes). For long-running tasks this may still time out — increase it via the environment variable. Also verify the SSH relay tunnel is active and the remote instance is reachable.

opencode-connected exits immediately without registering

Check that RELAY_SSH_CMD (if set) is a valid SSH command that you can run manually. For local-only mode, leave RELAY_SSH_CMD unset. Ensure the RELAY_REGISTRY_DIR directory is writable.

Frequently Asked Questions about OpenCode

What is OpenCode?

OpenCode is a Model Context Protocol (MCP) server that mcp server that enables discovery and interaction with multiple opencode instances across different machines using ssh reverse tunnels. it provides tools for listing instances, managing chat sessions, and sending messages to remote coding environm It connects AI assistants to external tools and data sources through a standardized interface.

How do I install OpenCode?

Follow the installation instructions on the OpenCode GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with OpenCode?

OpenCode works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is OpenCode free to use?

Yes, OpenCode is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.

Browse More Coding Agents MCP Servers

Explore all coding agents servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

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

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use OpenCode?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides