feat: Add list-scopes command using inventory architecture#1750
feat: Add list-scopes command using inventory architecture#1750SamMorrowDrums merged 7 commits intomainfrom
Conversation
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
|
@copilot create a stacked pr based on this one to: |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
Documents the new OAuth scope handling capabilities including: - OAuth scope challenges (MCP step-up auth) for remote server - PAT scope filtering for local/stdio server - Documented scopes for all MCP tools - New list-scopes CLI command Related PRs: - github-mcp-server: #1679, #1741, #1750, #1650 - github-mcp-server-remote: #503, #609, #618
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.