Repository navigation
Add OAuth scope metadata to all MCP tools #1679
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f06fccf
Initial plan
Copilot a479dc6
Add scopes package and update ServerTool struct with scope fields
Copilot 883e8a1
Update most tools with OAuth scope information
Copilot 356ae08
Complete OAuth scope implementation for all tools
Copilot 530d3fb
Simplify scope implementation per feedback
Copilot fe6ac2a
refresh readme after rebase
SamMorrowDrums 28075bf
Add scope hierarchy and auto-derive accepted scopes
SamMorrowDrums 86183b6
refres readme after update
SamMorrowDrums eb57a9d
Use repo scope for star/unstar tools instead of public_repo
SamMorrowDrums 742dfe3
Fix conflict and regenerate docs after rebase
SamMorrowDrums f955ec2
Sort scope slices for deterministic output
SamMorrowDrums File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
- Loading branch information
commit eb57a9d8d24c496e68e3c5ec95f354dc5f38b6e3
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -1995,7 +1995,7 @@ func StarRepository(t translations.TranslationHelperFunc) inventory.ServerTool { | |||||
| Required: []string{"owner", "repo"}, | ||||||
| }, | ||||||
| }, | ||||||
| []scopes.Scope{scopes.PublicRepo}, | ||||||
| []scopes.Scope{scopes.Repo}, | ||||||
| func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) { | ||||||
| owner, err := RequiredParam[string](args, "owner") | ||||||
| if err != nil { | ||||||
|
|
@@ -2060,7 +2060,7 @@ func UnstarRepository(t translations.TranslationHelperFunc) inventory.ServerTool | |||||
| Required: []string{"owner", "repo"}, | ||||||
| }, | ||||||
| }, | ||||||
| []scopes.Scope{scopes.PublicRepo}, | ||||||
| []scopes.Scope{scopes.Repo}, | ||||||
|
||||||
| []scopes.Scope{scopes.Repo}, | |
| []scopes.Scope{scopes.PublicRepo}, |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the PR description's scope mapping, star_repository should require the
public_reposcope (notrepo). The mapping shows:public_repopublic_repo,repoThis should use
[]scopes.Scope{scopes.PublicRepo}instead of[]scopes.Scope{scopes.Repo}.