|
| 1 | +--- |
| 2 | +title: "Intelligent Scope Features" |
| 3 | +date: 2026-01 |
| 4 | +description: "OAuth scope challenges, automatic PAT filtering, and comprehensive scope documentation for smarter authentication" |
| 5 | +category: feature |
| 6 | +--- |
| 7 | + |
| 8 | +# Intelligent Scope Features |
| 9 | + |
| 10 | +GitHub MCP Server now intelligently handles OAuth scopes—filtering tools based on your permissions and enabling dynamic scope requests when needed. |
| 11 | + |
| 12 | +## What's New |
| 13 | + |
| 14 | +### OAuth Scope Challenges |
| 15 | + |
| 16 | +The server now implements [MCP scope challenge handling](https://modelcontextprotocol.io/specification/2025-11-05/basic/authorization#scope-challenge-handling). Instead of failing when you lack a required scope, it requests additional permissions dynamically—start with minimal permissions and expand them as needed. |
| 17 | + |
| 18 | +### PAT Scope Filtering |
| 19 | + |
| 20 | +For classic Personal Access Tokens (`ghp_`), tools are automatically filtered based on your token's scopes. The server discovers your scopes at startup and hides tools you can't use. |
| 21 | + |
| 22 | +**Example:** If your PAT only has `repo` and `gist` scopes, tools requiring `admin:org`, `project`, or `notifications` are hidden. |
| 23 | + |
| 24 | +### Server-to-Server Token Handling |
| 25 | + |
| 26 | +For server-to-server tokens (like `GITHUB_TOKEN` in Actions), the server hides user-context tools like `get_me` that don't apply without a human user. |
| 27 | + |
| 28 | +### Documented OAuth Scopes |
| 29 | + |
| 30 | +Every MCP tool now documents its required and accepted OAuth scopes in the README and tool metadata. |
| 31 | + |
| 32 | +### New `list-scopes` Command |
| 33 | + |
| 34 | +Discover what scopes your toolsets need: |
| 35 | + |
| 36 | +```bash |
| 37 | +github-mcp-server list-scopes --output=summary |
| 38 | +github-mcp-server list-scopes --toolsets=all --output=json |
| 39 | +``` |
| 40 | + |
| 41 | +## Scope Hierarchy |
| 42 | + |
| 43 | +The server understands GitHub's scope hierarchy, so parent scopes satisfy child scope requirements: |
| 44 | + |
| 45 | +| Parent Scope | Covers | |
| 46 | +|-------------|--------| |
| 47 | +| `repo` | `public_repo`, `security_events` | |
| 48 | +| `admin:org` | `write:org`, `read:org` | |
| 49 | +| `project` | `read:project` | |
| 50 | +| `write:org` | `read:org` | |
| 51 | + |
| 52 | +If a tool requires `read:org` and your token has `admin:org`, the tool is available. |
| 53 | + |
| 54 | +## Authentication Comparison |
| 55 | + |
| 56 | +| Authentication Method | Scope Handling | |
| 57 | +|----------------------|----------------| |
| 58 | +| **OAuth** (remote server) | Scope challenges — request permissions on-demand | |
| 59 | +| **Classic PAT** (`ghp_`) | Automatic filtering — hide unavailable tools | |
| 60 | +| **Fine-grained PAT** (`github_pat_`) | No filtering — fine-grained permissions, not OAuth scopes | |
| 61 | +| **GitHub App** (`ghs_`) | No filtering — fine-grained permissions, not OAuth scopes | |
| 62 | +| **Server-to-Server** (`GITHUB_TOKEN`) | User tools hidden — no user context available | |
| 63 | + |
| 64 | +## Getting Started |
| 65 | + |
| 66 | +**OAuth users:** No action required—scope challenges work automatically. |
| 67 | + |
| 68 | +**PAT users:** Run `list-scopes` to discover required scopes, create a PAT at [github.com/settings/tokens](https://github.com/settings/tokens), and start the server. |
| 69 | + |
| 70 | +## Related Documentation |
| 71 | + |
| 72 | +- [PAT Scope Filtering Guide](https://github.com/github/github-mcp-server/blob/v0.29.0/docs/scope-filtering.md) |
| 73 | +- [OAuth Authentication Guide](https://github.com/github/github-mcp-server/blob/v0.29.0/docs/oauth-authentication.md) |
| 74 | +- [Server Configuration](https://github.com/github/github-mcp-server/blob/v0.29.0/docs/server-configuration.md) |
| 75 | + |
| 76 | +## Feedback |
| 77 | + |
| 78 | +Share your experience in the [Scope filtering/challenging discussion](https://github.com/github/github-mcp-server/discussions/1802). We're exploring ways to better support fine-grained permissions in the future. |
0 commit comments