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
Copy file name to clipboardExpand all lines: README.md
+209Lines changed: 209 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -266,6 +266,215 @@ the hostname for GitHub Enterprise Server or GitHub Enterprise Cloud with data r
266
266
}
267
267
```
268
268
269
+
### HTTP Server Mode
270
+
271
+
The GitHub MCP Server supports HTTP mode for serving multiple concurrent clients with per-request authentication. This is ideal for enterprise deployments where a centralized MCP server serves multiple users or applications.
272
+
273
+
#### Starting the HTTP Server
274
+
275
+
Start the HTTP server with the `http` command:
276
+
277
+
```bash
278
+
# Start HTTP server on default port (8080)
279
+
github-mcp-server http
280
+
281
+
# Start HTTP server on custom port
282
+
github-mcp-server http --port 3000
283
+
284
+
# With Docker
285
+
docker run -p 8080:8080 ghcr.io/github/github-mcp-server http
286
+
287
+
# With Docker on custom port
288
+
docker run -p 3000:3000 ghcr.io/github/github-mcp-server http --port 3000
289
+
```
290
+
291
+
> **Note:** Unlike stdio mode, HTTP mode does not require a `GITHUB_PERSONAL_ACCESS_TOKEN` environment variable at startup. Instead, each client provides their token via the `Authorization` header.
292
+
#### Authentication with Authorization Header
293
+
294
+
Clients authenticate by including their GitHub Personal Access Token in the `Authorization` header of each request:
295
+
296
+
```
297
+
Authorization: Bearer ghp_your_github_token_here
298
+
```
299
+
300
+
This "Bring Your Own Token" (BYOT) approach enables:
301
+
-**Multi-tenancy**: Different users can use their own tokens with proper permissions
302
+
-**Security**: Tokens are never stored on the server
303
+
-**Flexibility**: Users can revoke/rotate tokens independently
304
+
305
+
#### Client Configuration Examples
306
+
307
+
##### VS Code with GitHub Copilot
308
+
309
+
Configure VS Code to connect to your HTTP server by adding the following to your VS Code MCP settings (`.vscode/settings.json` or user settings):
310
+
311
+
```json
312
+
{
313
+
"servers": {
314
+
"github-http": {
315
+
"type": "http",
316
+
"url": "http://your-mcp-server.example.com:8080",
317
+
"headers": {
318
+
"Authorization": "Bearer ${input:github_token}"
319
+
}
320
+
}
321
+
},
322
+
"inputs": [
323
+
{
324
+
"type": "promptString",
325
+
"id": "github_token",
326
+
"description": "GitHub Personal Access Token",
327
+
"password": true
328
+
}
329
+
]
330
+
}
331
+
```
332
+
333
+
VS Code will prompt for the `github_token` input when connecting.
334
+
335
+
336
+
337
+
> **Security Note:** When using hardcoded tokens in configuration files, ensure proper file permissions (e.g., `chmod 600`) to protect your token.
338
+
##### Other MCP Clients
339
+
340
+
For other MCP clients that support HTTP transport, ensure they:
341
+
1. Connect to the server's HTTP endpoint (e.g., `http://localhost:8080`)
342
+
2. Include the `Authorization: Bearer <token>` header in all requests
343
+
3. Use the MCP streamable HTTP transport protocol
344
+
345
+
Example with curl for testing:
346
+
347
+
```bash
348
+
# Test server health (this should fail without proper MCP request structure)
0 commit comments