Skip to content

fix(mcp): pass tool input as permission metadata - #51062

Merged
rekram1-node merged 3 commits into
anomalyco:devfrom
lu-zero:luca/mcp-permission-metadata-v2
Oct 14, 2026
Merged

rekram1-node merged 3 commits into
anomalyco:devfrom
lu-zero:luca/mcp-permission-metadata-v2

Conversation

@lu-zero

@lu-zero lu-zero commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #51061

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

The MCP tool wrapper asserted permission with metadata: {}, so permission.evaluate hooks and permission.asked consumers could not see what an MCP call was about to do. It now passes the tool input under metadata.input, so other permission metadata can be added later without mixing with the tool's own arguments. action, resources and save are unchanged, so rule matching and saved approvals behave as before.

v2 port of #48464.

How did you verify your code works?

  • Updated the waits for permission before calling an MCP tool test in packages/core/test/mcp.test.ts to call the tool with an argument and assert it arrives as metadata.input. It fails without the fix and passes with it.
  • bun test test/mcp.test.ts and bun typecheck in packages/core.

Screenshots / recordings

No UI change.

Checklist

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

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

@rekram1-node
rekram1-node merged commit 328f74c into anomalyco:dev Oct 14, 2026
8 of 9 checks passed
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 tool permission requests carry no arguments (metadata: {})

2 participants