Repository navigation
Closed
Labels
Description
Describe the feature or problem you’d like to solve
MCP can currently authenticate with:
- Personal Access Tokens (classic or fine‑grained) ✨
- Soon 🚀: OAuth 2.0 device‑code flow via Non PAT auth method #132
Both approaches depend on credentials that are bound to a human account.
In enterprises(including ours) PAT creation is often blocked, and a device‑code token still requires a privileged “service user” to stay alive.
That leaves 24 × 7, org‑wide automation brittle and out of step with GitHub’s own security guidance.
| Concern | Fine‑grained PAT | OAuth device‑code |
|---|---|---|
| 👤 Identity coupling | Single user → breaks on off‑boarding | Needs service user |
| ⏳ Secret lifetime | Up to 1 year; manual/scripted rotation | 8 h access token + 6 mo refresh token |
| 🔍 Audit clarity | Traffic appears as that user | oauth-app/<app> (as @user) |
| 🛡️ Org policies | PATs often disallowed | Refresh token is still long‑lived |
So, neither option is ideal for a headless, fleet‑wide MCP deployment.
Visual cheat‑sheet (PAT vs device‑code vs GitHub App installation):
Proposed solution
Allow GitHub App installation‑token (server‑to‑server) authentication.
- install the App at org/enterprise scope with the minimum perms MCP needs (
contents:read,metadata:read, etc) - store only the App’s private key in AWS Secrets Manager / KMS
- at runtime MCP signs a short‑lived JWT → exchanges it for a 60‑minute installation token → refreshes automatically
- audit events appear as
github‑app/mcp‑server
Benefits
- zero human coupling – no PATs, survives re‑orgs and off‑boarding
- short‑lived creds – ≤ 60 min window if a token leaks
- governance – admins can see/change App permissions & repo list in one click
- clear audit trail – bot traffic is obvious (
github‑app/…) - future‑proof – aligns MCP with GitHub’s move away from long‑lived personal tokens
Additional context
Suggested implementation approach
- add
--auth=github-appflag - read
APP_ID,INSTALLATION_ID, private‑key path/env var - generate JWT (RS256) →
POST /app/installations/{id}/access_tokens - inject token into existing GitHub client; transparently refresh on HTTP 401/expiry
Architecture sketch of MCP + GitHub App flow:
Happy to help spec out more, test, etc - just let me know what’s useful 🙌
Reacted by kohbis, YZ, matthew-fiederlein-bzy, Matt Dotson, Cristi Pufu, Jim Zheng [SSW], Alexandre Miziara, enem, Riyaz Ali, Bartosz Żurkowski and 24 more
Activity
EnricoMessall commentedon Apr 25, 2025
Hey, i've implemented GitHub App Auth here in my fork of github-mcp-server. If someone has the capacity to write proper test cases or further improve it feel free to take my commit since i will not have the time right now to create a proper PR for it:
https://github.com/Arematics/github-mcp-server/commit/a6e4462d542766ab9a6d726b239303022d64a889
tonytrg commentedon Jun 16, 2025
You should be able to use github apps on the remote mcp server.
S2S Tokens specifically are not enabled currently.
What platform are you intending the use of the mcp on?
pc-ahrens commentedon Jul 28, 2025
+1 for OAuth solution using in GHES
tommaso-moro commentedon Oct 28, 2025
Thank you for reporting this. I am closing the issue as this is now supported!
dgilmanuni commentedon Oct 28, 2025
@tommaso-moro Link to it being supported? I am not seeing this on the deployed github copilot one.
SamMorrowDrums commentedon Nov 25, 2025
👋 We're actively looking at improving GHES support for the MCP server! If you have thoughts on GHES-specific needs, please share your feedback in this discussion. 🙏
feat: add GitHub App installation token authentication