Skip to content

Commit 8e5dc79

Browse files
committed
gutted PAT and STDIO
1 parent 1928803 commit 8e5dc79

File tree

3 files changed

+11
-47
lines changed

3 files changed

+11
-47
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ COPY --from=build /bin/github-mcp-server .
2929
# Set the entrypoint to the server binary
3030
ENTRYPOINT ["/server/github-mcp-server"]
3131
# Default arguments for ENTRYPOINT
32-
CMD ["stdio"]
32+
CMD ["http"]

README.md

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -247,24 +247,15 @@ For a complete overview of all installation options, see our **[Installation Gui
247247
### Build from source
248248

249249
If you don't have Docker, you can use `go build` to build the binary in the
250-
`cmd/github-mcp-server` directory, and use the `github-mcp-server stdio` command with the `GITHUB_PERSONAL_ACCESS_TOKEN` environment variable set to your token. To specify the output location of the build, use the `-o` flag. You should configure your server to use the built executable as its `command`. For example:
250+
`cmd/github-mcp-server` directory and run the HTTP transport directly:
251251

252-
```JSON
253-
{
254-
"mcp": {
255-
"servers": {
256-
"github": {
257-
"command": "/path/to/github-mcp-server",
258-
"args": ["stdio"],
259-
"env": {
260-
"GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>"
261-
}
262-
}
263-
}
264-
}
265-
}
252+
```bash
253+
go build -o github-mcp-server ./cmd/github-mcp-server
254+
./github-mcp-server http --listen :8080
266255
```
267256

257+
> **Heads up:** Stdio transport and personal access tokens are no longer supported. The server must receive GitHub OAuth access tokens in the `Authorization` header on every request (for example, when running behind Pomerium).
258+
268259
### Run as an HTTP server
269260

270261
The same binary can expose the MCP server over HTTP using the streamable transport. This mode is designed for deployments behind zero-trust proxies (for example, Pomerium) that exchange OAuth tokens with GitHub on a per-request basis.

cmd/github-mcp-server/main.go

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package main
22

33
import (
4-
"errors"
54
"fmt"
65
"os"
76
"strings"
@@ -28,37 +27,11 @@ var (
2827
}
2928

3029
stdioCmd = &cobra.Command{
31-
Use: "stdio",
32-
Short: "Start stdio server",
33-
Long: `Start a server that communicates via standard input/output streams using JSON-RPC messages.`,
30+
Use: "stdio",
31+
Short: "Start stdio server",
32+
Hidden: true,
3433
RunE: func(_ *cobra.Command, _ []string) error {
35-
token := viper.GetString("personal_access_token")
36-
if token == "" {
37-
return errors.New("GITHUB_PERSONAL_ACCESS_TOKEN not set")
38-
}
39-
40-
// If you're wondering why we're not using viper.GetStringSlice("toolsets"),
41-
// it's because viper doesn't handle comma-separated values correctly for env
42-
// vars when using GetStringSlice.
43-
// https://github.com/spf13/viper/issues/380
44-
var enabledToolsets []string
45-
if err := viper.UnmarshalKey("toolsets", &enabledToolsets); err != nil {
46-
return fmt.Errorf("failed to unmarshal toolsets: %w", err)
47-
}
48-
49-
stdioServerConfig := ghmcp.StdioServerConfig{
50-
Version: version,
51-
Host: viper.GetString("host"),
52-
Token: token,
53-
EnabledToolsets: enabledToolsets,
54-
DynamicToolsets: viper.GetBool("dynamic_toolsets"),
55-
ReadOnly: viper.GetBool("read-only"),
56-
ExportTranslations: viper.GetBool("export-translations"),
57-
EnableCommandLogging: viper.GetBool("enable-command-logging"),
58-
LogFilePath: viper.GetString("log-file"),
59-
ContentWindowSize: viper.GetInt("content-window-size"),
60-
}
61-
return ghmcp.RunStdioServer(stdioServerConfig)
34+
return fmt.Errorf("stdio transport has been removed; run `github-mcp-server http` behind your OAuth proxy")
6235
},
6336
}
6437

0 commit comments

Comments
 (0)