Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 6, 2026

Summary

Rebuilds the list-scopes command 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

  • Added cmd/github-mcp-server/list_scopes.go - command implementation using inventory API
  • Added script/list-scopes - convenience wrapper script
  • Extracted formatToolsetName helper to cmd/github-mcp-server/helpers.go (shared with generate_docs.go)

Implementation is 74 lines shorter than original (290 vs 364) - no mock clients needed, uses inventory filtering directly.

MCP impact

  • No tool or API changes - This is a CLI utility command, not an MCP tool

Prompts tested (tool changes only)

N/A - CLI command only

Security / limits

  • No security or limits impact - Read-only command that queries tool metadata

Tool renaming

  • I am not renaming tools as part of this PR

Lint & tests

  • Linted locally with ./script/lint
  • Tested locally with ./script/test

Docs

  • Not needed - CLI utility, not user-facing tool

Usage

# Default toolsets
$ github-mcp-server list-scopes --output=summary
Required OAuth scopes for enabled tools:
  read:org
  repo
Total: 2 unique scope(s)

# All toolsets
$ github-mcp-server list-scopes --toolsets=all --output=summary
Total: 7 unique scope(s)

# JSON output for automation
$ github-mcp-server list-scopes --output=json

Supports all stdio command flags (--toolsets, --read-only, --tools) and three output formats (text, json, summary).

Original prompt

Please rebuild http://github.com/github/github-mcp-server/pull/1487 based on main with new scope handling features, it has changed a lot, but this could be a useful feature and I'd like a fresh PR that takes this approach and makes a simple solution, since the refactor makes it much cleaner with inventory and things.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI self-assigned this Jan 6, 2026
Copilot AI and others added 5 commits January 6, 2026 17:53
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 AI changed the title [WIP] Rebuild scope handling features based on main feat: Add list-scopes command using inventory architecture Jan 6, 2026
Copilot AI requested a review from SamMorrowDrums January 6, 2026 18:06
@JoannaaKL
Copy link
Contributor

@copilot create a stacked pr based on this one to:
pass a pat to script/list-scopes script and compare scopes in it vs required by tools. The command to list scopes in a PAT token:

curl -sI -H "Authorization: Bearer $GITHUB_PERSONAL_ACCESS_TOKEN" \
  https://api.github.com/user | grep -i x-oauth-scopes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants