Repository navigation
Description
Versions: opencode 2.0.25 (Homebrew), 2.0.27 (@opencode/cli-darwin-arm64) and 2.0.28 (@opencode/cli-darwin-x64 under Rosetta — @opencode/[email protected] is referenced by @opencode/[email protected] but not published on npm yet), macOS arm64. Model: Ollama qwen3.5:35b-a3b through the ollama provider; also seen with qwen3.5:9b.
Config ($XDG_CONFIG_HOME/opencode/opencode.json, the only config source; OPENCODE_DISABLE_PROJECT_CONFIG=1):
{
"$schema": "https://opencode.ai/config.json",
"model": "ollama/qwen3.5:35b-a3b",
"providers": { "ollama": { "settings": { "baseURL": "http://<lan-host>:11434/v1" } } },
"mcp": {
"servers": {
"myserver": {
"type": "local",
"command": ["node", "/path/to/server.js"],
"environment": { "EXAMPLE": "1" },
"codemode": false
}
}
},
"permissions": [
{ "action": "*", "resource": "*", "effect": "ask" },
{ "action": "read", "resource": "*", "effect": "allow" },
{ "action": "glob", "resource": "*", "effect": "allow" },
{ "action": "grep", "resource": "*", "effect": "allow" },
{ "action": "myserver_submit_result", "resource": "*", "effect": "allow" }
]
}server.js is a stdio MCP server exposing one tool, submit_result; its tools/list over stdio returns it.
Steps
- Start
opencode acpwith that config through an ACP client;session/newwithmcpServers: [](the server comes from config only). - Prompt: "When done, call the
submit_resulttool of myserver with your answer."
Expected: with codemode: false (docs, MCP servers: "Set codemode to false to expose tools directly instead of through Code Mode"), myserver_submit_result is on the model's native tool list.
Actual
- The model's native tools are only
glob,grep,readandexecute; it reaches the server only by writing JavaScript forexecute("the only callable tools are those explicitly listed in the Code Mode catalog"). - A direct call fails: "No tool named 'submit_result' is currently available".
- Same when the server is passed in ACP
session/newinstead of config. - Adding
{ "action": "execute", "resource": "*", "effect": "deny" }makes the tool unreachable altogether.
opencode debug config with the same XDG dirs shows the key loaded:
"mcp": { "servers": { "myserver": { "type": "local", "command": ["node", "/path/to/server.js"], "environment": { "EXAMPLE": "1" }, "codemode": false } } }Impact: clients that need one MCP tool called reliably (a structured-answer tool) cannot use smaller local models — they don't produce valid Code Mode JavaScript. A larger model (qwen3-coder-next) did manage through execute.
Question: is codemode honoured for servers in opencode acp sessions, or is there another switch (per agent or global) to keep MCP tools native?
Activity
opencode-agent commentedon Oct 13, 2026
Thanks for the detailed report. I wasn't able to reproduce this on 2.0.28 (Linux), but I found one setup that gives the same symptom.
What I tried: I ran
opencode acpwith your config: theollamaprovider pointed at a mock endpoint that records requests, a stdio MCP servermyserverwith one toolsubmit_resultandcodemode: false, the samepermissions,OPENCODE_DISABLE_PROJECT_CONFIG=1, andsession/newwithmcpServers: []. Then I checked the tool list in the actual request sent to the model:myserver_submit_resultwas sent as a direct tool, next toexecute, and it was not in the Code Mode catalog. The request also includedshell,edit,writeand the other built-in tools, not just glob/grep/read/execute. So the list you got may be the model's own description of its tools, not what OpenCode sent.myserverinsession/new: that entry replaces the one from config, and ACP's server format has nocodemodefield. The server then goes back to Code Mode and the tool is reachable only throughexecute. That is exactly what you describe. Could you check what your client actually sends inmcpServers? Some clients forward their own MCP servers even when you don't expect them to.session/new: if the MCP server hasn't finished connecting, its tools are missing from the first request entirely (First prompt after start has no MCP tools: tool list does not wait for pending MCP connections #51812). In that case the tool isn't reachable throughexecuteeither.What would help:
session/newrequest your client sends, especiallymcpServers.opencode acp --print-logs.opencode run "..."using the same config, outside ACP.Related issues:
codemode: falseserver's ownexecutetool gets folded into Code Moderekram1-node commentedon Oct 15, 2026
codemode: falseis honored, I'm unable to reproduce, if you can still reproduce plz provide more info, perhaps checking the outbound network requests to see what's actually happening, ex:proxy opencode --standaloneWhere proxy is something like:
(we rlly need better network debugging --- coming soon)
opencode-agent commentedon Oct 16, 2026
Closing this for now since we haven't heard back. On 2.0.28, with
myserverdefined only in config andcodemode: false,myserver_submit_resultwas sent to the model as a direct tool. I could only get the tool stuck behindexecutewhen the ACP client also passed a server with the same name insession/new. That entry replaces the config one, and ACP has no way to carrycodemode.If you're still seeing this, please reopen or comment with:
mcpServersyour client sends insession/newThat should be enough to tell which case it is. Thanks again for the detailed report.