- Notifications
You must be signed in to change notification settings - Fork3k
Add HTTP server mode with OAuth token support#1216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
This adds HTTP server mode to the GitHub MCP Server, enabling multi-clientsupport with "bring your own token" OAuth functionality. This is useful forenterprise scenarios where a single MCP server instance handles multipleexternal clients, each authenticating with their own credentials.Key changes:- Add `http` command 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 READMEThis implementation is inspired by PRgithub#888 by@Dreadnoth, updated to workwith the current codebase architecture and dependencies.Co-authored-by: Dreadnoth <15017947+Dreadnoth@users.noreply.github.com>🤖 Generated with [Claude Code](https://claude.com/claude-code)Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Pull Request Overview
This PR adds HTTP server mode to the GitHub MCP Server, enabling multi-client support with per-request OAuth token authentication. This addresses the limitation where GitHub Enterprise Server users couldn't use OAuth forwarding with HTTP mode.
- Introduces an HTTP server command that can handle multiple concurrent clients
- Implements "bring your own token" OAuth functionality via Authorization headers
- Falls back to environment variable token when no Authorization header is provided
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/ghmcp/server.go | Adds HTTP server implementation with OAuth token extraction and context-aware client factories |
| cmd/github-mcp-server/main.go | Addshttp command with port configuration flag |
| README.md | Documents HTTP server mode usage and OAuth token support |
| go.mod | Adds logrus dependency for HTTP server logging |
| Dockerfile | Exposes port 8080 for HTTP server mode |
Tip: Customize your code reviews with copilot-instructions.md.Create the file orlearn how to get started.
| logrusLogger:=logrus.New() | ||
| ifcfg.LogFilePath!="" { | ||
| file,err:=os.OpenFile(cfg.LogFilePath,os.O_CREATE|os.O_WRONLY|os.O_APPEND,0600) |
CopilotAIOct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
[nitpick] The file permissions 0600 are appropriate for log files containing potentially sensitive information, but consider using 0640 if the log file needs to be readable by a logging service or monitoring system running under a different user in the same group.
| file,err:=os.OpenFile(cfg.LogFilePath,os.O_CREATE|os.O_WRONLY|os.O_APPEND,0600) | |
| file,err:=os.OpenFile(cfg.LogFilePath,os.O_CREATE|os.O_WRONLY|os.O_APPEND,0640) |
Uh oh!
There was an error while loading.Please reload this page.
Dreadnoth commentedOct 14, 2025
Fingers crossed :) |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
CLoui commentedOct 14, 2025
This would be really helpful to have! |
Dreadnoth commentedOct 14, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Yeah, we have a few PoCs running thi MCP version as server, I don't know why it was ignored |
khondakar1 left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Delete this server/host agent/project
tuannvm commentedNov 5, 2025
similar attempt#549 (comment) |
paulcwarren commentedNov 5, 2025
+1 for this. Please consider merging this PR as it would be very useful. |
garethjevans commentedNov 6, 2025
+1 |
Uh oh!
There was an error while loading.Please reload this page.
What does this change do
Why is this change needed
Key changes
httpcommand to start HTTP server on configurable port (default 8080)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:
🤖 Generated withClaude Code
Closes: