consult-opencode
Click on "Install 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., "@consult-opencodeSummarize what src/utils.ts does and suggest improvements"
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.
consult-opencode
Delegate a self-contained task to opencode as a one-shot subagent, from any coding agent (or human) that can run a shell command — or, more directly, straight from inside an AI chat client via MCP.
Listed on the official MCP Registry as io.github.jayden99236/consult-opencode, with a one-click .mcpb bundle attached to each release for Claude Desktop and other MCPB-compatible clients.
Demo

Related MCP server: peer-cli-mcp
Why
If you're driving an expensive/primary coding agent (Claude, GPT, etc.) through a session, it's often wasteful to spend one of its own turns on something small and self-contained: summarizing a file, drafting a regex, writing a boilerplate test, getting a second opinion. opencode ships its own free-tier models under the opencode/ provider namespace — zero config, no API key required. This repo gives you two ways to reach it:
MCP server (
mcp-server.mjs) — the easiest path. Add it once to your AI chat client's config and the model gets a nativeconsult_opencodetool, no shell commands involved. See Direct integration below.CLI script (
consult-opencode.mjs) — zero dependencies, for agents/scripts that can only run shell commands, or for calling it yourself from a terminal.
Both wrap the same core logic in lib.mjs.
Requirements
The CLI script itself (consult-opencode.mjs + lib.mjs) has no dependencies beyond Node built-ins. The MCP server additionally needs @modelcontextprotocol/sdk and zod — run npm install in this repo to get those (see below).
Direct integration (MCP server)
MCP is the standard way to give an AI chat client a native tool without it having to shell out to anything. Once configured, the model just sees a consult_opencode tool it can call directly.
git clone https://github.com/jayden99236/consult-opencode.git
cd consult-opencode
npm installClaude Desktop
Add to your claude_desktop_config.json (find it here):
{
"mcpServers": {
"consult-opencode": {
"command": "node",
"args": ["/absolute/path/to/consult-opencode/mcp-server.mjs"]
}
}
}Restart Claude Desktop and consult_opencode shows up as an available tool.
Claude Code
claude mcp add consult-opencode -- node /absolute/path/to/consult-opencode/mcp-server.mjsOr add it to a project's .mcp.json directly using the same mcpServers block shown above.
Other MCP clients (Cursor, Windsurf, etc.)
Any MCP-compatible client takes the same shape: a command (node) and args (the absolute path to mcp-server.mjs), configured as a stdio server. Check your client's docs for where that config lives — the mcpServers entry above is portable as-is.
The tool takes task (required) and an optional model (defaults to opencode/big-pickle, opencode's free tier), and returns the subagent's response as text.
CLI usage
node consult-opencode.mjs "Summarize what this function does: ..."Or install it globally to get a consult-opencode command:
npm install -g .
consult-opencode "Write a regex for US zip codes"Pipe a task in instead of passing it as an argument:
cat some-file.js | consult-opencode "Explain what this file does"Options
Flag | Description |
| Model to use (default: |
| Print |
| Show usage. |
From another agent
Most coding agents can just run this as a shell command and read its stdout:
node /path/to/consult-opencode.mjs "task description here"Exit code is non-zero on failure, with the error on stderr; stdout carries only the result text (or the JSON blob with --json), so it composes cleanly in scripts and pipelines.
The Windows gotcha this script works around
opencode's compiled Windows binary (opencode.exe) has been observed to hang indefinitely when its stdout is an anonymous pipe — which is exactly what Node's child_process gives you by default when you capture a child process's output. This reproduced consistently (6/6 runs) across both a direct .exe spawn and a shell-wrapped one.
The fix: redirect the child's stdout/stderr to a real temp file on disk, then read the file back once the process exits, instead of piping. This works reliably on Windows and is harmless on other platforms, so consult-opencode always does it this way regardless of OS.
If you're integrating with opencode from your own Node tooling and see a hang with zero output, this is almost certainly why.
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
- QuallaaOAuthcom.quallaa
Talk to your public-facing AI from any MCP client — Claude, ChatGPT, Cursor, Cline, Windsurf.
A paid remote MCP for OpenAI Codex agent coordination MCP, built to return verdicts, receipts, usage
The OpenRouter MCP server plugs OpenRouter into the AI tools you already use. Once connected, your assistant can pull live OpenRouter data (models, prices, your credits, rankings, and docs) and send quick test messages, all without leaving your editor.
Real-time chat for AI agents. Claude Code, Cursor, Cline and Codex join channels over MCP.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceBridges MCP clients to OpenCode's headless API, enabling AI to delegate autonomous coding tasks like building features, debugging, and refactoring across multiple projects.23,488127MIT
- AlicenseNot gradedqualityCmaintenanceMCP bridge for calling local coding-agent CLIs (Codex, Claude) from another agent, enabling bounded tasks like code review, verification, and bug hunting.MIT
- AlicenseBqualityCmaintenanceAn MCP server that lets any AI tool delegate tasks to the OpenCode CLI as a subagent, with multi-session orchestration, event tracking, and task contracts.28181MIT
- AlicenseAqualityBmaintenanceEnables MCP clients like Claude Code and Codex to delegate coding tasks to Cursor's CLI agent, which implements changes in the workspace and returns clean, structured results for review.31574MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jayden99236/consult-opencode'
If you have feedback or need assistance with the MCP directory API, please join our Discord server