Title: Consider workflow scope or user-escalation pattern for merging PRs that modify workflow files · Issue #1815 · github/github-mcp-server · GitHub
Open Graph Title: Consider workflow scope or user-escalation pattern for merging PRs that modify workflow files · Issue #1815 · github/github-mcp-server
X Title: Consider workflow scope or user-escalation pattern for merging PRs that modify workflow files · Issue #1815 · github/github-mcp-server
Description: Problem When merging PRs that modify .github/workflows/ files, the GitHub API requires the workflow OAuth scope. Without it, merge attempts fail with HTTP 403: Resource not accessible by integration The GitHub MCP Server currently doesn'...
Open Graph Description: Problem When merging PRs that modify .github/workflows/ files, the GitHub API requires the workflow OAuth scope. Without it, merge attempts fail with HTTP 403: Resource not accessible by integratio...
X Description: Problem When merging PRs that modify .github/workflows/ files, the GitHub API requires the workflow OAuth scope. Without it, merge attempts fail with HTTP 403: Resource not accessible by integratio...
Opengraph URL: https://github.com/github/github-mcp-server/issues/1815
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Consider workflow scope or user-escalation pattern for merging PRs that modify workflow files","articleBody":"## Problem\n\nWhen merging PRs that modify `.github/workflows/` files, the GitHub API requires the `workflow` OAuth scope. Without it, merge attempts fail with HTTP 403:\n\n```\nResource not accessible by integration\n```\n\nThe GitHub MCP Server currently doesn't have the `workflow` scope, causing silent failures when users try to merge Dependabot PRs that update GitHub Actions versions.\n\n## Investigation Findings\n\n### 1. `x-accepted-oauth-scopes` Header Does NOT Help\n\nTested via curl on PR #605 (modifies 4 workflow files) vs PR #609 (no workflow files):\n\n```bash\n# PR with workflow changes\ncurl -s -I \"https://api.github.com/repos/.../pulls/605/merge\"\nx-accepted-oauth-scopes: # EMPTY\n\n# PR without workflow changes \ncurl -s -I \"https://api.github.com/repos/.../pulls/609/merge\"\nx-accepted-oauth-scopes: # ALSO EMPTY\n```\n\n**Both return empty `x-accepted-oauth-scopes`** - GitHub doesn't advertise the `workflow` scope requirement in advance via headers.\n\n### 2. Scope Enforcement is Content-Sensitive\n\nThe `workflow` scope is enforced at merge time based on **what files are being changed**, not declared in API metadata. The enforcement logic is roughly:\n\n```\nprotected_dirs = [\".github/workflows/\", \".github/workflows-lab/\"]\n\nif user is authenticating via OAuth app\n and token does NOT have \"workflow\" scope\n and any changed file starts with protected_dirs:\n reject with 403\n```\n\n### 3. No Pre-flight Detection Possible via Headers\n\nThe only reliable way to detect this requirement is to **inspect PR files** before merge.\n\n## Proposed Solutions\n\n### Option A: Add `workflow` scope to GitHub MCP Server OAuth\n- Pros: Cleanest fix, full functionality\n- Cons: This is a powerful scope (can create/modify/delete workflows) - probably shouldn't be on by default\n\n### Option B: Pre-flight file inspection in scope challenge middleware (Recommended)\n\nSince the `workflow` scope is unique (content-sensitive rather than tool-based), add special handling in the scope challenge middleware:\n\n1. **Intercept merge operations** (`merge_pull_request`, `create_or_update_file`)\n2. **Check if user has `workflow` scope** - if yes, proceed normally\n3. **If no `workflow` scope, fetch PR files** via `GET /repos/{owner}/{repo}/pulls/{pull_number}/files`\n4. **Check paths** against `.github/workflows/` and `.github/workflows-lab/`\n5. **If workflow files detected** → return 401 with scope challenge:\n ```\n WWW-Authenticate: Bearer resource=\"https://api.github.com\", scope=\"workflow\"\n ```\n6. **Otherwise** → proceed with normal merge\n\nThis is different from other scopes because:\n- Normal scopes: deterministic per-tool (`create_issue` → `repo` scope)\n- Workflow scope: content-sensitive (`merge_pull_request` → check files → maybe `workflow` scope)\n\n### Option C: Better error handling (Minimum viable)\n- Detect the 403 error pattern\n- Surface a clear message explaining why and how to resolve\n\n## Technical Context\n\n- MCP uses SSE streams - can't do OAuth re-auth mid-stream\n- `workflow` scope grants significant permissions (create/modify/delete workflows)\n- Common scenario: Dependabot bumping `actions/checkout@v5` → `v6`\n\n## Affected Use Cases\n\n1. Merging Dependabot PRs for GitHub Actions updates\n2. Any PR that touches `.github/workflows/*.yml` files\n3. Users trying to batch-merge security updates\n\n## References\n\n- [GitHub OAuth Scopes](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/scopes-for-oauth-apps#available-scopes)\n- RFC 9728: OAuth 2.0 Protected Resource Metadata","author":{"url":"https://github.com/SamMorrowDrums","@type":"Person","name":"SamMorrowDrums"},"datePublished":"2026-01-15T13:29:29Z","url":"https://github.com/github/github-mcp-server/issues/1815"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b83c6974-fffc-25d5-0541-65dcc63b7e30 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BDCA:1DAC61:10C4A6B:1726970:6B06B5D9 |
| html-safe-nonce | 1b8ad557f03a1063253658f8600d29d3bcd28a4eeb77ee9c2800c2954125f64e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRENBOjFEQUM2MToxMEM0QTZCOjE3MjY5NzA6NkIwNkI1RDkiLCJ2aXNpdG9yX2lkIjoiODMyMzY1MTM1MDIwMjU5NDc3NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e3c84fcac2785e6bfc98599c2fcfbcc12e53bbec709377a129adfe6a113541ee |
| hovercard-subject-tag | issue:3817578268 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/github/github-mcp-server/1815/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9a471cbbd84839174d770a25986c841710a591aa31f2a802b660de8be5f80ff9/github/github-mcp-server/issues/1815 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9a471cbbd84839174d770a25986c841710a591aa31f2a802b660de8be5f80ff9/github/github-mcp-server/issues/1815 |
| og:image:alt | Problem When merging PRs that modify .github/workflows/ files, the GitHub API requires the workflow OAuth scope. Without it, merge attempts fail with HTTP 403: Resource not accessible by integratio... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | SamMorrowDrums |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9b2b1f32e21f9e529372294897d423fa443a20a3a37bafa95dec0f213469ebfc |
| turbo-cache-control | no-preview |
| go-import | github.com/github/github-mcp-server git https://github.com/github/github-mcp-server.git |
| octolytics-dimension-user_id | 9919 |
| octolytics-dimension-user_login | github |
| octolytics-dimension-repository_id | 942771284 |
| octolytics-dimension-repository_nwo | github/github-mcp-server |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 942771284 |
| octolytics-dimension-repository_network_root_nwo | github/github-mcp-server |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 5402de66059e5821fab003de929c7056c92d863f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width