Skip to content

Commit b84e8af

Browse files
Refine FGP annotations per review feedback
- list_repository_collaborators: administration:read -> metadata:read (the list endpoint requires Fine-grained Metadata read; administration only covers adding/removing collaborators) - create_repository, fork_repository: revert to ungated (administration mapping is genuinely ambiguous between user- and org-owned repos) - projects_get/list/write: revert to ungated (ProjectsV2 GraphQL does not map cleanly to the classic repository_projects/organization_projects catalog consts) get_teams/get_team_members keep members:read; list_issue_fields keeps issues:read. Docs table regenerated (idempotent). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 32b1efe commit b84e8af

3 files changed

Lines changed: 7 additions & 13 deletions

File tree

docs/permissions-filtering.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,6 @@ The generated table below is produced by `script/generate-docs` and lists every
7676
| `labels` | `get_label` | `issues:read` |
7777
| `labels` | `label_write` | `issues:write` |
7878
| `labels` | `list_label` | `issues:read` |
79-
| `projects` | `projects_get` | `organization_projects:read` |
80-
| `projects` | `projects_list` | `organization_projects:read` |
81-
| `projects` | `projects_write` | `organization_projects:write` |
8279
| `pull_requests` | `add_comment_to_pending_review` | `pull_requests:write` |
8380
| `pull_requests` | `add_reply_to_pull_request_comment` | `pull_requests:write` |
8481
| `pull_requests` | `create_pull_request` | `pull_requests:write` |
@@ -90,9 +87,7 @@ The generated table below is produced by `script/generate-docs` and lists every
9087
| `pull_requests` | `update_pull_request` | `pull_requests:write` |
9188
| `repos` | `create_branch` | `contents:write` |
9289
| `repos` | `create_or_update_file` | `contents:write` |
93-
| `repos` | `create_repository` | `administration:write` |
9490
| `repos` | `delete_file` | `contents:write` |
95-
| `repos` | `fork_repository` | `administration:write` |
9691
| `repos` | `get_commit` | `contents:read` |
9792
| `repos` | `get_file_contents` | `contents:read` |
9893
| `repos` | `get_latest_release` | `contents:read` |
@@ -101,7 +96,7 @@ The generated table below is produced by `script/generate-docs` and lists every
10196
| `repos` | `list_branches` | `contents:read` |
10297
| `repos` | `list_commits` | `contents:read` |
10398
| `repos` | `list_releases` | `contents:read` |
104-
| `repos` | `list_repository_collaborators` | `administration:read` |
99+
| `repos` | `list_repository_collaborators` | `metadata:read` |
105100
| `repos` | `list_tags` | `contents:read` |
106101
| `repos` | `push_files` | `contents:write` |
107102
| `secret_protection` | `get_secret_scanning_alert` | `secret_scanning_alerts:read` |

pkg/github/projects.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212
ghErrors "github.com/github/github-mcp-server/pkg/errors"
1313
"github.com/github/github-mcp-server/pkg/ifc"
1414
"github.com/github/github-mcp-server/pkg/inventory"
15-
"github.com/github/github-mcp-server/pkg/permissions"
1615
"github.com/github/github-mcp-server/pkg/scopes"
1716
"github.com/github/github-mcp-server/pkg/translations"
1817
"github.com/github/github-mcp-server/pkg/utils"
@@ -274,7 +273,7 @@ Use this tool to list projects for a user or organization, or list project field
274273
}
275274
}
276275
},
277-
).WithPermissions(permissions.Require(permissions.OrganizationProjects.Read()))
276+
)
278277
return tool
279278
}
280279

@@ -423,7 +422,7 @@ Use this tool to get details about individual projects, project fields, and proj
423422
return utils.NewToolResultError(fmt.Sprintf("unknown method: %s", method)), nil, nil
424423
}
425424
},
426-
).WithPermissions(permissions.Require(permissions.OrganizationProjects.Read()))
425+
)
427426
return tool
428427
}
429428

@@ -673,7 +672,7 @@ func ProjectsWrite(t translations.TranslationHelperFunc) inventory.ServerTool {
673672
return utils.NewToolResultError(fmt.Sprintf("unknown method: %s", method)), nil, nil
674673
}
675674
},
676-
).WithPermissions(permissions.Require(permissions.OrganizationProjects.Write()))
675+
)
677676
return tool
678677
}
679678

pkg/github/repositories.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ func CreateRepository(t translations.TranslationHelperFunc) inventory.ServerTool
676676

677677
return utils.NewToolResultText(string(r)), nil, nil
678678
},
679-
).WithPermissions(permissions.Require(permissions.Administration.Write()))
679+
)
680680
}
681681

682682
// FetchRepoIsPrivate returns whether a repository is private. It is a thin
@@ -986,7 +986,7 @@ func ForkRepository(t translations.TranslationHelperFunc) inventory.ServerTool {
986986

987987
return utils.NewToolResultText(string(r)), nil, nil
988988
},
989-
).WithPermissions(permissions.Require(permissions.Administration.Write()))
989+
)
990990
}
991991

992992
// DeleteFile creates a tool to delete a file in a GitHub repository.
@@ -2795,5 +2795,5 @@ func ListRepositoryCollaborators(t translations.TranslationHelperFunc) inventory
27952795
callResult = attachStaticIFCLabel(ctx, deps, callResult, ifc.LabelCollaboratorRoster())
27962796
return callResult, nil, nil
27972797
},
2798-
).WithPermissions(permissions.Require(permissions.Administration.Read()))
2798+
).WithPermissions(permissions.Require(permissions.Metadata.Read()))
27992799
}

0 commit comments

Comments
 (0)