Skip to content

MCP tool permission requests carry no arguments (metadata: {}) #51061

Closed

Description

@lu-zero

Description

MCP tool permission requests carry no arguments. The MCP tool wrapper asserts permission with metadata: {} (packages/core/src/tool/mcp.ts:55), while built-in tools pass what they are about to do (websearch passes its input, edit/write pass file previews, read_mcp_resource passes server and URI).

Anything deciding on an MCP call therefore sees only the tool name:

Consumer What it gets for demo_search({ query: "…" })
permission.evaluate plugin hook action: "demo_search", metadata: {}
permission.asked event (SDK/server clients) same

A plugin or client that approves destination-scoped tools (e.g. "post to this channel only") cannot tell one call from another, so it must either allow the tool wholesale or deny it wholesale.

Previously reported against 1.x as #19549 (auto-closed); the 1.x fix is #48464.

OpenCode version

2.0.16 (v2 @ dcfe1ec)

Steps to reproduce

  1. Configure any MCP server and set its tool to ask.
  2. Have the agent call the tool with arguments.
  3. Inspect the permission.asked event or a permission.evaluate hook: metadata is {}.

Activity

  1. Serenity-2026 commented on Sep 27, 2026

    @Serenity-2026

    I'd like to take this one. packages/core/src/tool/mcp.ts asserts permission with metadata: {}, so permission.evaluate hooks and permission.asked events only see the tool name. I'll forward the tool call arguments (the same value already passed to callTool), matching built-in tools like websearch, and add a regression test. Please assign if this scope looks right.

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