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
Add HTTP+SSE server command with graceful shutdown and logging middleware
I'm not sure we want to merge this, but this allowed me to try dotcom chat action as an MCP host, using `mark3labs/mcp-go` in copilot-api, connecting to a localhost version of github-mcp-server via HTTP/SSE.
```
export GITHUB_PERSONAL_ACCESS_TOKEN=<TOKEN_FROM_DEV_ENVIRONMENT>
go run cmd/github-mcp-server/main.go http --gh-host http://api.github.localhost --port 4567
```
@@ -319,6 +319,35 @@ GitHub MCP Server running on stdio
319
319
320
320
```
321
321
322
+
## HTTP+SSE server
323
+
324
+
> [!WARNING]
325
+
> This version of the server works with the [2024-11-05 MCP Spec](https://spec.modelcontextprotocol.io/specification/2024-11-05/), which requires a stateful connection forSSE. We plan to add support for a stateless modein the future, as allowed by the [2025-03-26 MCP Spec](https://spec.modelcontextprotocol.io/specification/2025-03-26/changelog).
326
+
327
+
Run the server in HTTP mode with Server-Sent Events (SSE):
328
+
329
+
```sh
330
+
go run cmd/github-mcp-server/main.go http
331
+
```
332
+
333
+
The server will start on port 8080 by default. You can specify a different port using the `--port` flag:
334
+
335
+
```sh
336
+
go run cmd/github-mcp-server/main.go http --port 3000
337
+
```
338
+
339
+
The server accepts connections at `http://localhost:<port>` and communicates using Server-Sent Events (SSE).
340
+
341
+
Like the stdio server, ensure your GitHub Personal Access Token is setin the `GITHUB_PERSONAL_ACCESS_TOKEN` environment variable before starting the server.
342
+
343
+
You can use the same flags as the stdio server:
344
+
345
+
- `--read-only`: Restrict the server to read-only operations
346
+
- `--log-file`: Path to log file
347
+
- `--enable-command-logging`: Enable logging of all command requests and responses
348
+
- `--export-translations`: Save translations to a JSON file
0 commit comments