GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [FEATURE]: ACP - allow disabling codemode for MCP servers passed via session/new · Issue #58476 · anomalyco/opencode

[FEATURE]: ACP - allow disabling codemode for MCP servers passed via session/new #58476

New issue
Copy link
New issue
Copy link
Open
Open
[FEATURE]: ACP - allow disabling codemode for MCP servers passed via session/new#58476
Copy link

Description

@reinholdk
reinholdk
opened on Oct 23, 2026
Issue body actions

Feature hasn't been suggested before.

  • 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:

{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "session/new",
  "params": {
    "cwd": "/abs/path/to/project",
    "mcpServers": [
      {
        "type": "http",
        "name": "my-server",
        "url": "http://127.0.0.1:8123/mcp",
        "headers": [
          { "name": "Authorization", "value": "Bearer <token>" }
        ]
      }
    ]
  }
}

The agent then runs the tools of my-server inside codemode. The client receives generic execute tool call updates in session/update:

{
  "method": "session/update",
  "params": {
    "sessionId": "sess_1",
    "update": {
      "sessionUpdate": "tool_call_update",
      "toolCallId": "call_1",
      "title": "execute",
      "kind": "other",
      "status": "in_progress",
      "rawInput": { "code": "...await my_server.read_file({ path: '/abs/path/to/project/README.md' })" }
    }
  }
}

This causes three problems:

  • The client cannot tell which MCP tool ran, so it cannot show a meaningful title or kind (read, edit, search, and so on).
  • The user sees a code blob where they should see tool input { path: '/abs/path/to/project/README.md' }.

The same server declared in the opencode config JSON with codemode: false produces one tool call per MCP tool:

{
  "mcp": {
    "my-server": {
      "type": "remote",
      "url": "http://127.0.0.1:8123/mcp",
      "codemode": false
    }
  }
}
{
  "sessionUpdate": "tool_call_update",
  "toolCallId": "call_1",
  "title": "my-server_read_file",
  "kind": "read",
  "status": "in_progress",
  "rawInput": { "path": "/abs/path/to/project/README.md" }
}

The ACP path has no way to get this behavior.

Adding a possibility for ACP clients to opt-out from codemode , e.g. via _meta on the mcpServers entry would be helpful.

Activity

  1. opencode-agent commented on Oct 23, 2026

    @opencode-agent
    opencode-agentBot
    on Oct 23, 2026 – with OpenCode Agent
    Contributor
    More actions

    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 _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.
    export default Plugin.define({
      id: "acp-mcp-direct",
      setup: async (ctx) => {
        const names = Array.isArray(ctx.options.servers) ? ctx.options.servers.map(String) : undefined
        await ctx.mcp.transform((editor) => {
          for (const [name, server] of editor.list()) {
            if (server.codemode !== undefined) continue
            if (names && !names.includes(name)) continue
            server.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:

    {
      "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 _meta option would still be the cleaner fix.

    Related issues:

    • MCP codemode: false is ignored: server tools stay behind execute (2.0.25–2.0.28, opencode acp) #55079: codemode: false was ignored under opencode acp (closed)
    • feat(core): default Cloudflare MCP servers to codemode false #57193 and [FEATURE]: Make direct MCP servers also available in codemode #54826: other changes to how Code Mode is chosen per MCP server
    • ACP: MCP servers from session/new are lost after a location idle eviction #57902: another problem with MCP servers added through session/new
  2. reinholdk commented on Oct 23, 2026

    @reinholdk
    reinholdk
    on Oct 23, 2026
    Author
    More actions

    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.

  3. UweGrensing commented on Nov 7, 2026

    @UweGrensing
    UweGrensing
    on Nov 7, 2026
    More actions

    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.

  4. mahammedmahieousman commented on Nov 7, 2026

    @mahammedmahieousman
    mahammedmahieousman
    on Nov 7, 2026 via email
    More actions
    Sent from Outlook for Android<https://aka.ms/AAb9ysg>
    …
    ________________________________ 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: ***@***.***>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.