Add HTTP server mode with OAuth token support
What does this change do
- This adds HTTP server mode to the GitHub MCP Server, enabling multi-client support with "bring your own token" OAuth functionality.
Why is this change needed
- Github Remote MCP server supports OAuth & HTTP but DOES NOT SUPPORT Github enterprise server
- Github Local MCP server supports github enterprise server but DOES NOT SUPPORT Oauth or HTTP
- Enterprise server users would prefer OAuth forwarding + HTTP instead of every user creating and managing their own personal access tokens.
Key changes
- Add
httpcommand to start HTTP server on configurable port (default 8080) - Support per-request OAuth tokens via Authorization header
- Fall back to GITHUB_PERSONAL_ACCESS_TOKEN env var if no header provided
- Modify client factories to extract token from request context
- Add comprehensive HTTP server documentation to README
This implementation is based off PR #888 by @Dreadnoth, updated to work with the current codebase architecture and dependencies. There have also been other attempts at solving this:
- https://github.com/github/github-mcp-server/issues/311
- https://github.com/github/github-mcp-server/pull/464
🤖 Generated with Claude Code
Closes:
- issues related to this:
- https://github.com/github/github-mcp-server/issues/132
- https://github.com/github/github-mcp-server/issues/606
Fingers crossed :)
This would be really helpful to have!
Yeah, we have a few PoCs running thi MCP version as server, I don't know why it was ignored
similar attempt https://github.com/github/github-mcp-server/issues/549#issuecomment-3489822336
+1 for this. Please consider merging this PR as it would be very useful.
+1
Thank you all for expressing interest in a remote MCP server for Enterprise Server (and especially for coding one up). I will make sure your voices are heard as we discuss this further internally.
+1
+1
We are upgrading to the new Go SDK, and after that has landed we will look at updating this PR and merging. It will be officially unsupported as users will be providing their own infra and deployment strategies and unless we have bundled the server with GHES we have no control or visibility, but I also agree it is high time to enable something so we will be revisiting this shortly.
In the meantime, please join the discussion and share your thoughts and opinions.
:pray: Thank you for the work to and for showing your interest.
Related GHES Issues Summary
Here's a summary of GHES-related issues and feature requests that have been filed in this repository:
Open Issues
| Issue | Title | Type | 👍 |
|---|---|---|---|
| #500 | Support subdomain isolation for GHES hosts | enhancement | - |
| #471 | Add Streamable HTTP Transport Support for Multi-User Mode | enhancement | - |
| #299 | Network timeouts when interacting with GitHub Enterprise Server | bug | 1 |
| #157 | Better support custom TLS situations when using Docker | enhancement | 2 |
Closed Issues (for reference)
| Issue | Title | Type | 👍 | Resolution |
|---|---|---|---|---|
| #662 | Custom GHES host names are not supported | bug | - | ✅ Completed |
| #661 | Fix GHES hostnames detection to use exact match | bug | - | Duplicate of #662 |
| #311 | Support GitHub App installation-token authentication for MCP | enhancement | 30 | ✅ Completed |
| #864 | get_file_contents not working properly (path resolution) |
bug | 14 | ✅ Completed |
| #623 | Multiple account support | - | 4 | ✅ Completed |
| #606 | BYO OAuth Access Token for GHES | - | - | ✅ Completed |
| #503 | Remote server authentication for GHES | - | 3 | ✅ Completed |
| #206 | Support multiple instances (GHES + GHEC) | enhancement | 2 | Not planned |
| #404 | Invalid JSON schemas with GHES | bug | - | Not planned |
| #933 | API rate limits with MCP server | - | - | ✅ Completed |
This demonstrates significant community interest in GHES support and related features.