Repository navigation
feat(opencode): mcp permission patterns - #12801
Closed
karlkurzer wants to merge 2 commits into
Closed
karlkurzer wants to merge 2 commits into
karlkurzer wants to merge 2 commits into
Conversation
added 2 commits
February 6, 2026 17:15
Serialize MCP tool arguments into a deterministic key=value string and
pass it as the permission pattern instead of always using "*". This
lets users write wildcard rules in opencode.json that match against
specific MCP tool inputs, e.g.:
"outlook_calendar_meeting": {
"*": "ask",
"*operation=read*": "allow",
"*operation=delete*": "deny"
}
Also display MCP tool arguments in the TUI permission prompt so users
can see what they are approving.
Closes anomalyco#12358
Contributor
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
Contributor
|
The following comment was made by an LLM, it may be inaccurate: Found a potentially related PR:
This PR appears related because it also addresses displaying tool arguments in permission prompts, which is one of the key features in the current PR (showing MCP tool arguments in the TUI permission prompt). |
3 of 6 tasks
Contributor
|
Closing this pull request because it has had no updates for more than 60 days. If you plan to continue working on it, feel free to reopen or open a new PR. |
|
+99. I really hope this gets reopened and merged! 🙏 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Problem
Granular permission rules didn't work for MCP tools. Pattern matching only applied to built-in tools (bash, edit, read, etc.) because MCP tools always passed patterns: ["*"] — making all user-defined patterns unmatchable.
Solution
Reuse the existing wildcard infrastructure by giving it something meaningful to match. MCP tool args are serialized into a sorted key=value, key=value string (e.g., meetingId=AAMk..., operation=read) and passed as the permission pattern. Users can now write:
Zero changes to core permission evaluation (evaluate, ask, fromConfig, Wildcard.match). Fully backwards compatible — empty args falls back to ["*"].
Files changed
Closes #12358