You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: ACP - allow disabling codemode for MCP servers passed via session/new #58476
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
MCP servers configured in the opencode config JSON can opt out of codemode with codemode: false. MCP servers that an ACP client registers through session/new (mcpServers) have no equivalent. They are always exposed through codemode. Please add a way to disable codemode for those servers.
Problem
An ACP client registers an HTTP MCP server like this:
Your request: let ACP clients turn off Code Mode for MCP servers they register through session/new (for example with a _meta field on the mcpServers entry), the way codemode: false already works for servers in the config. Then clients would get one tool call per MCP tool with a proper title, kind and rawInput, instead of a generic execute call. Right now the ACP layer creates these servers without a codemode setting, so they always get the default (Code Mode on). Maintainers will consider adding a per-server option.
Workaround with a plugin
Servers registered through ACP go through the same MCP config pipeline as config-declared ones, and plugins can edit that pipeline. This plugin turns off Code Mode for the server names you list. If you leave out servers, it applies to every server that doesn't set codemode explicitly. I haven't been able to test it, so please let me know if it doesn't work.
Save it as .opencode/plugins/acp-mcp-direct.ts in the project, or as ~/.config/opencode/plugins/acp-mcp-direct.ts to use it everywhere:
import{Plugin}from"@opencode/plugin"// Turns Code Mode off for MCP servers by name, including ones an ACP client// registers through session/new. Servers with `codemode` set explicitly are left alone.exportdefaultPlugin.define({id: "acp-mcp-direct",setup: async(ctx)=>{constnames=Array.isArray(ctx.options.servers) ? ctx.options.servers.map(String) : undefinedawaitctx.mcp.transform((editor)=>{for(const[name,server]ofeditor.list()){if(server.codemode!==undefined)continueif(names&&!names.includes(name))continueserver.codemode=false}})},})
To restrict it to specific servers, put the plugin in a directory (for example ./plugins/acp-mcp-direct/index.ts) and set options in opencode.json:
Thanks for suggesting the workaround. An ACP client typically doesn't ship or manage agent-specific plugins, so this would require users to configure OpenCode separately. A per-server option in session/new, for example via _meta, would let the client request this behavior without additional user setup.
Confirmed: plugin workaround works with Obsidian Copilot (Windows, OpenCode 2.2.6)
I encountered this exact issue using Obsidian Copilot with its OpenCode ACP integration.
Environment:
Windows 11
Obsidian Copilot 4.0.18
OpenCode 2.2.6
Miyo 0.4.1
Ollama with local models (Gemma 4 and LFM3)
Copilot registers its MCP server through ACP session/new. Its server descriptor contains the server name, URL and authorization headers, but does not provide a codemode setting.
As a result, the Miyo MCP tools were exposed through Code Mode rather than as native model tools.
Smaller local models sometimes attempted to invoke obsidian-copilot.miyo_search directly. OpenCode rejected these calls with:
No tool named "obsidian-copilot.miyo_search" is currently available.
The plugin workaround suggested in this issue solved the problem.
After restarting Obsidian, Miyo search worked and the previous Unknown tool errors disappeared.
This confirms that the plugin workaround also works with a real ACP client that dynamically registers an HTTP MCP server.
One further improvement would be to support an ACP-level option, for example _meta["opencode/codemode"] = false, so clients such as Obsidian Copilot can request native MCP tool exposure without requiring users to install an additional OpenCode plugin.
________________________________
From: UweGrensing ***@***.***>
Sent: Saturday, 07 November 2026 20:04:40
To: anomalyco/opencode ***@***.***>
Cc: Subscribed ***@***.***>
Subject: Re: [anomalyco/opencode] [FEATURE]: ACP - allow disabling codemode for MCP servers passed via session/new (Issue #58476)
[https://avatars.githubusercontent.com/u/125870807?s=20&v=4]UweGrensing left a comment (anomalyco/opencode#58476)<#58476 (comment)>
Confirmed: plugin workaround works with Obsidian Copilot (Windows, OpenCode 2.2.6)
I encountered this exact issue using Obsidian Copilot with its OpenCode ACP integration.
Environment:
* Windows 11
* Obsidian Copilot 4.0.18
* OpenCode 2.2.6
* Miyo 0.4.1
* Ollama with local models (Gemma 4 and LFM3)
Copilot registers its MCP server through ACP session/new. Its server descriptor contains the server name, URL and authorization headers, but does not provide a codemode setting.
As a result, the Miyo MCP tools were exposed through Code Mode rather than as native model tools.
Smaller local models sometimes attempted to invoke obsidian-copilot.miyo_search directly. OpenCode rejected these calls with:
No tool named "obsidian-copilot.miyo_search" is currently available.
The plugin workaround suggested in this issue solved the problem.
I installed the plugin under:
~/.config/opencode/plugins/acp-mcp-direct/index.ts
and configured it in opencode.jsonc:
{
"$schema": "https://opencode.ai/config.json",
"plugins": [
{
"package": "./plugins/acp-mcp-direct",
"options": {
"servers": ["obsidian-copilot"]
}
}
]
}
After restarting Obsidian, Miyo search worked and the previous Unknown tool errors disappeared.
This confirms that the plugin workaround also works with a real ACP client that dynamically registers an HTTP MCP server.
One further improvement would be to support an ACP-level option, for example _meta["opencode/codemode"] = false, so clients such as Obsidian Copilot can request native MCP tool exposure without requiring users to install an additional OpenCode plugin.
—
Reply to this email directly, view it on GitHub<#58476?email_source=notifications&email_token=BVRSBAGOEBWUR775YVY74ED5X5I2RA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTMNZRGAZTKMBZHA2KM4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSWGM33PORSXEX3DNRUWG2Y#issuecomment-6710350984>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BVRSBABH5VY4P77RQJMIRVT5X5I2RAVCNFSNUABFKJSXA33TNF2G64TZHM4TONJXGM2DGMJZHNEXG43VMU5TMMBQGAZTMNBRG4ZKC5QC>.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS<https://github.com/notifications/mobile/ios/BVRSBAAA3SNHXPNNHVEBB6D5X5I2RA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTMNZRGAZTKMBZHA2KM4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSVGM33PORSXEX3JN5ZQ> and Android<https://github.com/notifications/mobile/android/BVRSBAFIGCRBSVCZ56KAHHL5X5I2RA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTMNZRGAZTKMBZHA2KM4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSXGM33PORSXEX3BNZSHE33JMQ>. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
Activity
opencode-agent commentedon Oct 23, 2026
Thanks for the detailed write-up, @reinholdk!
Your request: let ACP clients turn off Code Mode for MCP servers they register through
session/new(for example with a_metafield on themcpServersentry), the waycodemode: falsealready works for servers in the config. Then clients would get one tool call per MCP tool with a proper title,kindandrawInput, instead of a genericexecutecall. Right now the ACP layer creates these servers without acodemodesetting, so they always get the default (Code Mode on). Maintainers will consider adding a per-server option.Workaround with a plugin
Servers registered through ACP go through the same MCP config pipeline as config-declared ones, and plugins can edit that pipeline. This plugin turns off Code Mode for the server names you list. If you leave out
servers, it applies to every server that doesn't setcodemodeexplicitly. I haven't been able to test it, so please let me know if it doesn't work.Save it as
.opencode/plugins/acp-mcp-direct.tsin the project, or as~/.config/opencode/plugins/acp-mcp-direct.tsto use it everywhere:To restrict it to specific servers, put the plugin in a directory (for example
./plugins/acp-mcp-direct/index.ts) and set options inopencode.json:{ "plugins": [ { "package": "./plugins/acp-mcp-direct", "options": { "servers": ["my-server"] } } ] }This is set on the OpenCode side, not by the ACP client for each session, so a
_metaoption would still be the cleaner fix.Related issues:
codemode: falseis ignored: server tools stay behindexecute(2.0.25–2.0.28,opencode acp) #55079:codemode: falsewas ignored underopencode acp(closed)session/newreinholdk commentedon Oct 23, 2026
Thanks for suggesting the workaround. An ACP client typically doesn't ship or manage agent-specific plugins, so this would require users to configure OpenCode separately. A per-server option in session/new, for example via _meta, would let the client request this behavior without additional user setup.
UweGrensing commentedon Nov 7, 2026
Confirmed: plugin workaround works with Obsidian Copilot (Windows, OpenCode 2.2.6)
I encountered this exact issue using Obsidian Copilot with its OpenCode ACP integration.
Environment:
Copilot registers its MCP server through ACP
session/new. Its server descriptor contains the server name, URL and authorization headers, but does not provide acodemodesetting.As a result, the Miyo MCP tools were exposed through Code Mode rather than as native model tools.
Smaller local models sometimes attempted to invoke
obsidian-copilot.miyo_searchdirectly. OpenCode rejected these calls with:No tool named "obsidian-copilot.miyo_search" is currently available.The plugin workaround suggested in this issue solved the problem.
I installed the plugin under:
~/.config/opencode/plugins/acp-mcp-direct/index.tsand configured it in
opencode.jsonc:{ "$schema": "https://opencode.ai/config.json", "plugins": [ { "package": "./plugins/acp-mcp-direct", "options": { "servers": ["obsidian-copilot"] } } ] }After restarting Obsidian, Miyo search worked and the previous
Unknown toolerrors disappeared.This confirms that the plugin workaround also works with a real ACP client that dynamically registers an HTTP MCP server.
One further improvement would be to support an ACP-level option, for example
_meta["opencode/codemode"] = false, so clients such as Obsidian Copilot can request native MCP tool exposure without requiring users to install an additional OpenCode plugin.mahammedmahieousman commentedon Nov 7, 2026