Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
3e30fc8
Initial HTTP stack
omgitsads Jan 13, 2026
f3802d5
Move lockdown to context
omgitsads Jan 13, 2026
32d2342
Move http stuff into its own package
omgitsads Jan 14, 2026
db34a0c
Fix the broken tests after our HTTP stack refactor
omgitsads Jan 14, 2026
7feaee3
Add VSCode launch configuration for HTTP server
omgitsads Jan 14, 2026
ed37e6f
Move inventory creation to HTTP handler and add factory pattern.
omgitsads Jan 15, 2026
61db07d
Remove extra config fields from HTTP server config
omgitsads Jan 15, 2026
ad7a49a
fix some linter errors, make port configurable
kerobbi Jan 19, 2026
d16f98b
make headers parsing more robust, draft composite ff checker
kerobbi Jan 19, 2026
886025a
add missing features.go
kerobbi Jan 19, 2026
f13e75d
Add API Host interface to resolve URLs dynamically
omgitsads Jan 19, 2026
740fbff
Add a github server factory to HTTPMcpHandler to allow dependency inj…
omgitsads Jan 20, 2026
abffbf5
Add option to provide additional MCP server options via config
omgitsads Jan 20, 2026
f816f02
Merge branch 'main' into http-stack-2
omgitsads Jan 23, 2026
8d44553
chore: regenerate license files
github-actions[bot] Jan 23, 2026
8d25f46
Add readonly and toolset request handlers (#1858)
kerobbi Jan 23, 2026
1fad6c5
Add lockdown mode support for HTTP server (#1876)
kerobbi Jan 26, 2026
d810e83
Actually use the config that is passed
omgitsads Jan 26, 2026
297dcfb
Add some request handler and header tests
omgitsads Jan 26, 2026
c696607
Move feature checker to stdio for now. A new one will be created late…
omgitsads Jan 27, 2026
97e8f35
Merge branch 'main' into http-stack-2
omgitsads Jan 27, 2026
bbaa877
Fix linter issues
omgitsads Jan 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@
"program": "cmd/github-mcp-server/main.go",
"args": ["stdio", "--read-only"],
"console": "integratedTerminal",
},
{
"name": "Launch http server",
"type": "go",
"request": "launch",
"mode": "auto",
"cwd": "${workspaceFolder}",
"program": "cmd/github-mcp-server/main.go",
"args": ["http", "--port", "8082"],
"console": "integratedTerminal",
}
]
}
26 changes: 26 additions & 0 deletions cmd/github-mcp-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

"github.com/github/github-mcp-server/internal/ghmcp"
"github.com/github/github-mcp-server/pkg/github"
ghhttp "github.com/github/github-mcp-server/pkg/http"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/spf13/viper"
Expand Down Expand Up @@ -89,6 +90,28 @@ var (
return ghmcp.RunStdioServer(stdioServerConfig)
},
}

httpCmd = &cobra.Command{
Use: "http",
Short: "Start HTTP server",
Long: `Start an HTTP server that listens for MCP requests over HTTP.`,
RunE: func(_ *cobra.Command, _ []string) error {
ttl := viper.GetDuration("repo-access-cache-ttl")
httpConfig := ghhttp.ServerConfig{
Version: version,
Host: viper.GetString("host"),
Port: viper.GetInt("port"),
ExportTranslations: viper.GetBool("export-translations"),
EnableCommandLogging: viper.GetBool("enable-command-logging"),
LogFilePath: viper.GetString("log-file"),
ContentWindowSize: viper.GetInt("content-window-size"),
LockdownMode: viper.GetBool("lockdown-mode"),
RepoAccessCacheTTL: &ttl,
}

return ghhttp.RunHTTPServer(httpConfig)
},
}
)

func init() {
Expand All @@ -111,6 +134,7 @@ func init() {
rootCmd.PersistentFlags().Bool("lockdown-mode", false, "Enable lockdown mode")
rootCmd.PersistentFlags().Bool("insiders", false, "Enable insiders features")
rootCmd.PersistentFlags().Duration("repo-access-cache-ttl", 5*time.Minute, "Override the repo access cache TTL (e.g. 1m, 0s to disable)")
rootCmd.PersistentFlags().Int("port", 8082, "HTTP server port")

// Bind flag to viper
_ = viper.BindPFlag("toolsets", rootCmd.PersistentFlags().Lookup("toolsets"))
Expand All @@ -126,9 +150,11 @@ func init() {
_ = viper.BindPFlag("lockdown-mode", rootCmd.PersistentFlags().Lookup("lockdown-mode"))
_ = viper.BindPFlag("insiders", rootCmd.PersistentFlags().Lookup("insiders"))
_ = viper.BindPFlag("repo-access-cache-ttl", rootCmd.PersistentFlags().Lookup("repo-access-cache-ttl"))
_ = viper.BindPFlag("port", rootCmd.PersistentFlags().Lookup("port"))

// Add subcommands
rootCmd.AddCommand(stdioCmd)
rootCmd.AddCommand(httpCmd)
}

func initConfig() {
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ require (
github.com/aymerick/douceur v0.2.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/fsnotify/fsnotify v1.9.0 // indirect
github.com/go-chi/chi/v5 v5.2.3
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/swag v0.21.1 // indirect
github.com/go-viper/mapstructure/v2 v2.5.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHk
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
github.com/go-chi/chi/v5 v5.2.3 h1:WQIt9uxdsAbgIYgid+BpYc+liqQZGMHRaUwp0JUcvdE=
github.com/go-chi/chi/v5 v5.2.3/go.mod h1:L2yAIGWB3H+phAw1NxKwWM+7eUH/lU8pOMm5hHcoops=
github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY=
github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
Expand Down
Loading