-
Notifications
You must be signed in to change notification settings - Fork 3.4k
feat: Add list-scopes command using inventory architecture #1750
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
Conversation
Co-authored-by: SamMorrowDrums <[email protected]>
Co-authored-by: SamMorrowDrums <[email protected]>
Co-authored-by: SamMorrowDrums <[email protected]>
Co-authored-by: SamMorrowDrums <[email protected]>
Co-authored-by: SamMorrowDrums <[email protected]>
|
@copilot create a stacked pr based on this one to: |
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.
Pull request overview
This PR adds a new list-scopes CLI command that lists required OAuth scopes for enabled tools, helping users determine token permissions needed. The implementation leverages the new inventory architecture, resulting in a cleaner and more maintainable solution compared to the original closed PR #1487.
Key changes:
- Adds new
list-scopescommand with three output formats (text, json, summary) - Extracts shared
formatToolsetNamehelper function to avoid duplication - Provides convenience wrapper script for easy command execution
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| script/list-scopes | Bash script wrapper that builds (if needed) and executes the list-scopes command |
| cmd/github-mcp-server/list_scopes.go | Main implementation of the list-scopes command using inventory API |
| cmd/github-mcp-server/helpers.go | New file containing extracted formatToolsetName helper function |
| cmd/github-mcp-server/generate_docs.go | Refactored to use shared formatToolsetName helper from helpers.go |
| cd "$(dirname "$0")/.." | ||
|
|
||
| # Build the server if it doesn't exist or is outdated | ||
| if [ ! -f github-mcp-server ] || [ cmd/github-mcp-server/list_scopes.go -nt github-mcp-server ]; then |
Copilot
AI
Jan 8, 2026
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.
The build check only verifies if list_scopes.go is newer than the binary, but doesn't check helpers.go which is also a dependency. If helpers.go is modified, the script won't rebuild the binary automatically. Consider checking all dependencies or using a more comprehensive build condition.
| if [ ! -f github-mcp-server ] || [ cmd/github-mcp-server/list_scopes.go -nt github-mcp-server ]; then | |
| if [ ! -f github-mcp-server ] || find cmd/github-mcp-server -name '*.go' -newer github-mcp-server -print -quit | grep -q .; then |
Summary
Rebuilds the
list-scopescommand from closed PR #1487 using the new inventory system. The command lists required OAuth scopes for enabled tools, helping users determine token permissions needed.Why
PR #1487 was closed due to significant architectural changes (inventory refactor). This feature remains valuable for understanding scope requirements across toolsets.
What changed
cmd/github-mcp-server/list_scopes.go- command implementation using inventory APIscript/list-scopes- convenience wrapper scriptformatToolsetNamehelper tocmd/github-mcp-server/helpers.go(shared withgenerate_docs.go)Implementation is 74 lines shorter than original (290 vs 364) - no mock clients needed, uses inventory filtering directly.
MCP impact
Prompts tested (tool changes only)
N/A - CLI command only
Security / limits
Tool renaming
Lint & tests
./script/lint./script/testDocs
Usage
Supports all
stdiocommand flags (--toolsets,--read-only,--tools) and three output formats (text,json,summary).Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.