You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 13b4635
Browse filesBrowse the repository at this point in the historyBrowse files
This adds HTTP server mode to the GitHub MCP Server, enabling multi-client
support with "bring your own token" OAuth functionality. This is useful for
enterprise scenarios where a single MCP server instance handles multiple
external 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 README
This implementation is inspired by PR github#888 by @Dreadnoth, updated to work
with 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>
Copy file name to clipboardExpand all lines: README.md
+37Lines changed: 37 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -121,6 +121,43 @@ GitHub Enterprise Server does not support remote server hosting. Please refer to
121
121
122
122
---
123
123
124
+
## HTTP Server Mode
125
+
126
+
The GitHub MCP Server can run in HTTP mode, allowing it to serve multiple clients concurrently. This is useful for enterprise scenarios where you want to run a single MCP server instance that handles multiple external clients.
127
+
128
+
### Starting the HTTP Server
129
+
130
+
To run the server in HTTP mode, use the `http` command:
131
+
132
+
```bash
133
+
github-mcp-server http --port 8080
134
+
```
135
+
136
+
Or with Docker:
137
+
138
+
```bash
139
+
docker run -p 8080:8080 \
140
+
-e GITHUB_PERSONAL_ACCESS_TOKEN=<your-token> \
141
+
ghcr.io/github/github-mcp-server http --port 8080
142
+
```
143
+
144
+
### HTTP Server with "Bring Your Own Token"
145
+
146
+
When running the server in HTTP mode, clients can provide their own GitHub token with each request using the `Authorization` header:
147
+
148
+
```http
149
+
Authorization: Bearer <github-token>
150
+
```
151
+
152
+
This allows each client to authenticate with their own credentials, enabling:
153
+
- Multi-tenant deployments where each user has their own access level
154
+
- Enterprise use cases with centralized MCP server infrastructure
155
+
- OAuth-based authentication flows
156
+
157
+
If no `Authorization` header is provided, the server will fall back to using the token specified via the `GITHUB_PERSONAL_ACCESS_TOKEN` environment variable (if configured).
158
+
159
+
---
160
+
124
161
## Local GitHub MCP Server
125
162
126
163
[](https://insiders.vscode.dev/redirect/mcp/install?name=github&inputs=%5B%7B%22id%22%3A%22github_token%22%2C%22type%22%3A%22promptString%22%2C%22description%22%3A%22GitHub%20Personal%20Access%20Token%22%2C%22password%22%3Atrue%7D%5D&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22-i%22%2C%22--rm%22%2C%22-e%22%2C%22GITHUB_PERSONAL_ACCESS_TOKEN%22%2C%22ghcr.io%2Fgithub%2Fgithub-mcp-server%22%5D%2C%22env%22%3A%7B%22GITHUB_PERSONAL_ACCESS_TOKEN%22%3A%22%24%7Binput%3Agithub_token%7D%22%7D%7D) [](https://insiders.vscode.dev/redirect/mcp/install?name=github&inputs=%5B%7B%22id%22%3A%22github_token%22%2C%22type%22%3A%22promptString%22%2C%22description%22%3A%22GitHub%20Personal%20Access%20Token%22%2C%22password%22%3Atrue%7D%5D&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22-i%22%2C%22--rm%22%2C%22-e%22%2C%22GITHUB_PERSONAL_ACCESS_TOKEN%22%2C%22ghcr.io%2Fgithub%2Fgithub-mcp-server%22%5D%2C%22env%22%3A%7B%22GITHUB_PERSONAL_ACCESS_TOKEN%22%3A%22%24%7Binput%3Agithub_token%7D%22%7D%7D&quality=insiders)
0 commit comments