
Consult Opencode
io.github.jayden99236Published by GitHub account jayden99236v0.1.1Updated Oct 24, 2026
Delegate a self-contained task to opencode's free-tier models as a one-shot subagent.
Overview
Lets an assistant hand a small, self-contained task to opencode's free-tier models as a one-shot subagent and get the answer back as text.
- What you can do
- Delegate a task: send a required task description, plus an optional model, to opencode and receive the subagent's reply as text.
- Offload small jobs such as summarizing a file, drafting a regex, writing boilerplate tests or getting a second opinion, instead of spending the main agent's own turn.
- Use opencode's free-tier default model, or point at another provider already authenticated in opencode.
- When to use it
- Useful when a primary coding agent is expensive or busy and a small, self-contained request could be answered by a cheaper free-tier model. Also handy for getting an independent second opinion inside a chat client without leaving it.
- Requirements
- Runs as a local stdio process: Node.js 18 or newer, the opencode CLI installed and on PATH (npm install -g opencode-ai), and the MCP server's own dependencies installed. Configured with a node command and the absolute path to the server script; no API key is needed for the free tier.
Installation
In SourceWeft
- Open Consult Opencode in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
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
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.
Claude Desktop
Add to your claude_desktop_config.json (find it here):
Restart Claude Desktop and consult_opencode shows up as an available tool.
Claude Code
Or 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
Or install it globally to get a consult-opencode command:
Pipe a task in instead of passing it as an argument:
Options
From another agent
Most coding agents can just run this as a shell command and read its stdout:
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
Source: README.md at commit 3da72aa
Tools
0Version history
1- v0.1.1LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts