feat(mcp): add resource read tools (#33483)

This commit is contained in:
Shoubhit Dash
2026-06-23 13:49:42 +05:30
committed by GitHub
parent ea17d9bed8
commit 3f3f120825
8 changed files with 376 additions and 22 deletions
+2 -1
View File
@@ -214,9 +214,10 @@ export function merge(...rulesets: PermissionV1.Ruleset[]): PermissionV1.Rule[]
export function disabled(tools: string[], ruleset: PermissionV1.Ruleset): Set<string> {
const edits = ["edit", "write", "apply_patch"]
const reads = ["list_mcp_resources", "read_mcp_resource"]
return new Set(
tools.filter((tool) => {
const permission = edits.includes(tool) ? "edit" : tool
const permission = edits.includes(tool) ? "edit" : reads.includes(tool) ? "read" : tool
const rule = ruleset.findLast((rule) => Wildcard.match(permission, rule.permission))
return rule?.pattern === "*" && rule.action === "deny"
}),