Skip to content

Commit c4c6491

Browse files
Use repo scope for star/unstar tools instead of public_repo
public_repo is implicit - the GitHub API handles the distinction between public and private repos. Using repo as the required scope is more consistent with our enforcement model: - PATs: tools visible if token has repo scope - OAuth: scope challenge requests repo scope
1 parent 570ce0c commit c4c6491

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

README.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ The following sets of tools are available:
628628

629629
- **get_team_members** - Get team members
630630
- **Required OAuth Scopes**: `read:org`
631-
- **Accepted OAuth Scopes**: `read:org`, `admin:org`, `write:org`
631+
- **Accepted OAuth Scopes**: `write:org`, `read:org`, `admin:org`
632632
- `org`: Organization login (owner) that contains the team. (string, required)
633633
- `team_slug`: Team slug (string, required)
634634

@@ -946,7 +946,7 @@ The following sets of tools are available:
946946

947947
- **get_project** - Get project
948948
- **Required OAuth Scopes**: `read:project`
949-
- **Accepted OAuth Scopes**: `project`, `read:project`
949+
- **Accepted OAuth Scopes**: `read:project`, `project`
950950
- `owner`: If owner_type == user it is the handle for the GitHub user account. If owner_type == org it is the name of the organization. The name is not case sensitive. (string, required)
951951
- `owner_type`: Owner type (string, required)
952952
- `project_number`: The project's number (number, required)
@@ -1265,7 +1265,7 @@ The following sets of tools are available:
12651265

12661266
- **get_secret_scanning_alert** - Get secret scanning alert
12671267
- **Required OAuth Scopes**: `security_events`
1268-
- **Accepted OAuth Scopes**: `security_events`, `repo`
1268+
- **Accepted OAuth Scopes**: `repo`, `security_events`
12691269
- `alertNumber`: The number of the alert. (number, required)
12701270
- `owner`: The owner of the repository. (string, required)
12711271
- `repo`: The name of the repository. (string, required)
@@ -1337,14 +1337,12 @@ The following sets of tools are available:
13371337
- `username`: Username to list starred repositories for. Defaults to the authenticated user. (string, optional)
13381338

13391339
- **star_repository** - Star repository
1340-
- **Required OAuth Scopes**: `public_repo`
1341-
- **Accepted OAuth Scopes**: `public_repo`, `repo`
1340+
- **Required OAuth Scopes**: `repo`
13421341
- `owner`: Repository owner (string, required)
13431342
- `repo`: Repository name (string, required)
13441343

13451344
- **unstar_repository** - Unstar repository
1346-
- **Required OAuth Scopes**: `public_repo`
1347-
- **Accepted OAuth Scopes**: `public_repo`, `repo`
1345+
- **Required OAuth Scopes**: `repo`
13481346
- `owner`: Repository owner (string, required)
13491347
- `repo`: Repository name (string, required)
13501348

pkg/github/repositories.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2183,7 +2183,7 @@ func StarRepository(t translations.TranslationHelperFunc) inventory.ServerTool {
21832183
Required: []string{"owner", "repo"},
21842184
},
21852185
},
2186-
[]scopes.Scope{scopes.PublicRepo},
2186+
[]scopes.Scope{scopes.Repo},
21872187
func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
21882188
owner, err := RequiredParam[string](args, "owner")
21892189
if err != nil {
@@ -2248,7 +2248,7 @@ func UnstarRepository(t translations.TranslationHelperFunc) inventory.ServerTool
22482248
Required: []string{"owner", "repo"},
22492249
},
22502250
},
2251-
[]scopes.Scope{scopes.PublicRepo},
2251+
[]scopes.Scope{scopes.Repo},
22522252
func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
22532253
owner, err := RequiredParam[string](args, "owner")
22542254
if err != nil {

0 commit comments

Comments
 (0)