opencode-router-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@opencode-router-mcp Check the status of my last delegated task."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
opencode-router-mcp
Cost-aware, multimodal OpenCode task router and sub-agent MCP server for Claude Code.
This is a Windows-first optional OpenCode execution channel for Claude Code, based on the intended refactoring of AlaeddineMessadi/opencode-mcp. Claude remains the primary agent and may work natively or use Claude subagents; this MCP only manages OpenCode after Claude has selected that path. It exposes only seven compact high-level tools: opencode_delegate, opencode_status, opencode_review, opencode_revise, opencode_abort, opencode_models, and opencode_usage.
Run
Requires Node.js 20+ and an OpenCode installation on PATH. Start over stdio with node src/server.mjs. The repository includes .mcp.json for Claude Code; update its absolute paths if the project is moved.
Run npm run models:refresh after OpenCode Go is configured. Model IDs are read from opencode models; this project never guesses IDs from display names. The registry remains empty when OpenCode is unavailable. npm run models:probe-vision reports whether a real probe was possible; it never fabricates success.
The router defaults to run for cheap/balanced tasks and session for powerful tasks after Claude has already selected OpenCode. mode: auto only chooses one-shot versus persistent OpenCode execution; it never chooses Claude or a Claude subagent. It retries/fails over transient model errors within a tier, disables a provider after shared quota errors, and only upgrades capability when explicitly allowed. Provider remaining quota is always reported as unknown; local usage is estimated only.
Related MCP server: Clanker
Security
Directories and attachments must be absolute and existing. System roots, secrets, credential files, unsupported MIME extensions, oversized files, and more than five attachments are rejected. OpenCode should be configured to listen on localhost only. No global unrestricted permissions, raw shell tool, session sharing, or secret-bearing configuration is provided.
Development
npm run build, npm test, npm run test:skill, npm run test:security, npm run test:failover, npm run test:smoke, npm run test:e2e, and npm run test:closed-loop are the local verification commands. npm run test:opencode-free performs a real, read-only smoke test using a discovered model whose ID is explicitly marked free; it never selects an unmarked model. npm run test:vision reports SKIPPED when no verified image model exists. See docs/ and .claude/skills/opencode-use/ for routing guidance. No commits or pushes are performed automatically.
Available Tools
7 toolsopencode_abortBDestructiveIdempotent
Abort an existing OpenCode session.
Inputs: sessionId.
opencode_delegateBDestructive
Execute a task only after Claude has chosen the OpenCode path; mode auto chooses run or session inside OpenCode and never chooses Claude or a Claude subagent.
Inputs: mode, task, tests, maxTier, +10 more.
opencode_modelsBRead-onlyIdempotent
List discovered verified OpenCode models.
Inputs: tier, modality, provider, availability.
opencode_reviewBRead-onlyIdempotent
Get compact file/test review for an existing OpenCode session.
Inputs: detailed, sessionId.
opencode_reviseBDestructive
Continue an existing OpenCode session with a revision instruction.
Inputs: sessionId, acceptance, instruction, allowTierUpgrade, +1 more.
opencode_statusARead-onlyIdempotent
Get compact status for an existing OpenCode session.
Inputs: detailed, directory, sessionId.
opencode_usageARead-onlyIdempotent
Get compact local OpenCode usage estimates.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool has a clearly distinct purpose: delegate starts a task, status/review/revise/abort manage sessions, models lists models, and usage reports usage. No two tools overlap in function, making selection unambiguous.
All tools share the 'opencode_' prefix, creating a predictable pattern. However, the second part mixes verbs (delegate, revise, abort) with nouns (status, models, usage), which is a minor inconsistency but still readable and navigable.
With 7 tools, the server is well-scoped for its purpose of routing tasks to OpenCode and managing sessions. Each tool fills a necessary role without redundancy.
The tool surface covers the full session lifecycle: create (delegate), read (status, review), update (revise), and delete (abort). It also includes auxiliary queries (models, usage) that round out the domain without leaving obvious dead ends.
Maintenance
Related MCP Connectors
A paid remote MCP for OpenAI Codex agent coordination MCP, built to return verdicts, receipts, usage
LLM cost optimization gateway, repo token-waste auditor & model arbitrage MCP server.
Hosted MCP server for LLM cost estimation, model comparison, and budget-aware routing.
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Related MCP Servers
- AlicenseAqualityDmaintenanceMCP server that lets any agent or MCP host delegate tasks to Claude Code running headless, with tools for review, validation, analysis, and autonomous work.42MIT
- AlicenseAqualityFmaintenanceMCP server for running external coding agents as background tasks inside Claude Code. Supports multiple backends including Codex, Grok, GLM, DeepSeek, and more.7MIT
- AlicenseNot gradedqualityAmaintenanceA 68-tool MCP server providing persistent memory, error tracking, decision logging, task orchestration, and multi-modal AI generation for coding agents like OpenCode and Claude Code.MIT
- AlicenseAqualityDmaintenanceA thin MCP server that delegates lightweight tasks from Claude Code or any MCP-compatible client to local or cloud LLMs via LiteLLM, supporting models like Ollama and cloud APIs as subagents.1MIT