Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
talalryz wants to merge3 commits intogithub:main
base:main
Choose a base branch
Loading
fromtalalryz:add-http-oauth-support

Conversation

@talalryz
Copy link

@talalryztalalryz commentedOct 14, 2025
edited
Loading

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

  • Addhttp 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 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:

🤖 Generated withClaude Code

Closes:

dgilmanuni reacted with thumbs up emojiDreadnoth, evandiewald, dgilmanuni, matsumo-and, and ytupman reacted with heart emoji
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>
@talalryztalalryz requested a review froma team as acode ownerOctober 14, 2025 07:20
CopilotAI review requested due to automatic review settingsOctober 14, 2025 07:20
Copy link
Contributor

CopilotAI left a 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
FileDescription
internal/ghmcp/server.goAdds HTTP server implementation with OAuth token extraction and context-aware client factories
cmd/github-mcp-server/main.goAddshttp command with port configuration flag
README.mdDocuments HTTP server mode usage and OAuth token support
go.modAdds logrus dependency for HTTP server logging
DockerfileExposes 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)

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.

Suggested change
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)

Copilot uses AI. Check for mistakes.
@Dreadnoth
Copy link

Fingers crossed :)

talalryz and CLoui reacted with thumbs up emoji

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@CLoui
Copy link

This would be really helpful to have!

@Dreadnoth
Copy link

Dreadnoth commentedOct 14, 2025
edited
Loading

Yeah, we have a few PoCs running thi MCP version as server, I don't know why it was ignored

Copy link

@khondakar1khondakar1 left a 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
Copy link

similar attempt#549 (comment)

@paulcwarren
Copy link

+1 for this. Please consider merging this PR as it would be very useful.

@garethjevans
Copy link

+1

@jm809jm809 mentioned this pull requestNov 6, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

Copilot code reviewCopilotCopilot left review comments

+1 more reviewer

@khondakar1khondakar1khondakar1 left review comments

Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

7 participants

@talalryz@Dreadnoth@CLoui@tuannvm@paulcwarren@garethjevans@khondakar1

[8]ページ先頭

©2009-2025 Movatter.jp