Skip to content

MCP tools show * instead of actual tool name in permission dialogs #19549

Closed as not planned

Description

@megheaiulian

Bug

When an MCP tool requests permission, the dialog shows * instead of the actual tool name.

Example

  • User has nextcloud MCP server configured with tools disabled globally: "nextcloud_*": false
  • Agent calls nextcloud_nc_webdav_delete_resource
  • Permission dialog shows: * as the permission name
  • Expected: Should show nextcloud_nc_webdav_delete_resource

Screenshot

User reports seeing just * in the permission prompt instead of the specific MCP tool name.

Root Cause

In packages/opencode/src/session/prompt.ts, the resolveTools function wraps MCP tool execution with permission handling that always uses patterns: ["*"]:

await ctx.ask({
  permission: key,
  metadata: {},
  patterns: ["*"],    // <-- Should be [key]
  always: ["*"],
})

Meanwhile, built-in tools like bash use specific patterns:

patterns.add(commandText)
always.add(BashArity.prefix(command).join(" ") + " *")

Expected Behavior

MCP tools should use their actual tool name as the permission pattern, similar to how built-in tools use specific patterns. This would allow users to:

  1. See exactly which MCP tool is requesting permission
  2. Make informed decisions about allowing/denying specific tools
  3. Configure tool-specific permissions in agent frontmatter

Fix

Change the patterns to use the MCP tool name:

await ctx.ask({
  permission: key,
  metadata: {},
  patterns: [key],
  always: [key],
})

Environment

  • OpenCode version: 1.3.3
  • MCP server: nextcloud (and likely all MCP servers)

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 28, 2026
  2. added a commit that references this issue on Mar 28, 2026
    55c3d4e
  3. mattrossman commented on Apr 9, 2026

    @mattrossman

    This is particularly frustrating in the web/desktop UI where you can't see a preview of what args it's attempting to use.

    Related tweet w/ screenshots: https://twitter.com/the_ross_man/status/2029944815010349392

  4. removed
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  5. added 2 commits that reference this issue on Jun 16, 2026
    55738fe
    68a9077
  6. added 2 commits that reference this issue on Jun 29, 2026
    80becbc
    b144314
  7. github-actions commented on Jul 12, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  8. SamBWagner commented on Jul 24, 2026

    @SamBWagner

    Still reproducible on the current CLI build (opencode v1.17.11, macOS). This was closed by the stale-issue bot after 60 days of inactivity, not because it was resolved or rejected — both fix attempts (#24605, #32564) were themselves auto-closed by the PR-template-compliance bot within ~2 hours of opening, never on technical merit. Requesting this be reopened.

    Root cause confirmed independently, by decompiling the shipped binary (strings on the standalone macOS build) and locating the generic MCP tool wrapper:

    f.execute=(F,O)=>l.promise(h.gen(function*(){
      let i=Y(F,O);
      yield*d.trigger("tool.execute.before",{tool:r,sessionID:i.sessionID,callID:O.toolCallId},{args:F});
      let K=yield*h.gen(function*(){
        return yield*i.ask({permission:r,metadata:{},patterns:["*"],always:["*"]}),
        yield*h.promise(()=>k(F,O))
      })...

    metadata:{} and patterns:["*"] are hardcoded for every generic/MCP tool, exactly as #32564 already diagnosed. Meanwhile tool.execute.before fires immediately before that ask() call with the real arguments — confirming a plugin-side workaround is possible (caching args by callID in tool.execute.before, then correlating on the permission.asked event) but the core UX bug for anyone not writing a plugin remains: the built-in ask dialog for any MCP tool shows only *, with no tool name or arguments, regardless of READ_ONLY_MODE/ENABLED_TOOLS settings.

    As a secondary consequence also flagged in #32564: because the pattern is *, clicking Allow always on any single MCP tool call silently grants blanket approval for every MCP tool from that server — which seems like an unintended security-relevant side effect of the same bug, not just a UX one.

    Happy to pick up #32564's approach (or a version of it) and resubmit as a fresh PR against dev with a linked issue and template filled out properly this time, if that's useful — just let me know.

  9. lu-zero commented on Jul 27, 2026

    @lu-zero
    Contributor

    I rerolled the PR, if you want to open another issue with the details and point to it maybe we'll manage to get it landed :)

  10. added 2 commits that reference this issue on Aug 24, 2026
    b157177
    4a76ed5
  11. added 2 commits that reference this issue on Sep 11, 2026
    341130f
    c0aa2a6
  12. added 2 commits that reference this issue on Sep 21, 2026
    91c1b7d
    ce23eeb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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