Skip to content

fix(mcp): pass tool name and args to permission ask - #48464

Open
lu-zero wants to merge 2 commits into
anomalyco:devfrom
lu-zero:mcp-populate-metadata
Open

fix(mcp): pass tool name and args to permission ask#48464
lu-zero wants to merge 2 commits into
anomalyco:devfrom
lu-zero:mcp-populate-metadata

Conversation

@lu-zero

@lu-zero lu-zero commented Sep 11, 2026

Copy link
Copy Markdown

Issue for this PR

Fixes #19549. Reroll of #39057, closed by automated cleanup rather than review, rebased onto dev.

Type of change

  • Bug fix

What does this PR do?

The MCP tool wrapper called ctx.ask with hardcoded wildcards, so permission dialogs showed * instead of the tool name and carried no arguments:

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

This aligns the MCP wrapper with the convention every other tool uses (bash, webfetch, task, read, edit): forward the action key as permission and patterns/always, and pass the tool input as metadata.

ctx.ask({ permission: key, metadata: args, patterns: [key], always: [key] })
File Change
session/tools.ts Pass the real tool name and args to the permission ask.
test/session/prompt.test.ts Assert the payload the MCP wrapper hands to ctx.ask.

How did you verify your code works?

Check Result
bun test test/session/prompt.test.ts 59 pass, 0 fail
bun turbo typecheck 30/30 tasks pass

Screenshots / recordings

No UI changes — only the data the existing dock already renders.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

🤖 Generated with Claude Code

lu-zero and others added 2 commits September 11, 2026 10:25
Fixes anomalyco#19549

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Fixes anomalyco#19549

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant