Skip to content

Commit 3fe69e6

Browse files
authored
Use host-derived OAuth authorization server only
1 parent b7b1073 commit 3fe69e6

4 files changed

Lines changed: 2 additions & 21 deletions

File tree

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,6 @@ the hostname for GitHub Enterprise Server or GitHub Enterprise Cloud with data r
246246

247247
- For GitHub Enterprise Server, prefix the hostname with the `https://` URI scheme, as it otherwise defaults to `http://`, which GitHub Enterprise Server does not support.
248248
- For GitHub Enterprise Cloud with data residency, use `https://YOURSUBDOMAIN.ghe.com` as the hostname.
249-
- If your OAuth authorization server is different from `<host>/login/oauth`, set `--authorization-server` or `GITHUB_AUTHORIZATION_SERVER`.
250249

251250
``` json
252251
"github": {

cmd/github-mcp-server/main.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ var (
139139
Host: viper.GetString("host"),
140140
Port: viper.GetInt("port"),
141141
BaseURL: viper.GetString("base-url"),
142-
AuthorizationServer: viper.GetString("authorization-server"),
143142
ResourcePath: viper.GetString("base-path"),
144143
ExportTranslations: viper.GetBool("export-translations"),
145144
EnableCommandLogging: viper.GetBool("enable-command-logging"),
@@ -185,7 +184,6 @@ func init() {
185184
// HTTP-specific flags
186185
httpCmd.Flags().Int("port", 8082, "HTTP server port")
187186
httpCmd.Flags().String("base-url", "", "Base URL where this server is publicly accessible (for OAuth resource metadata)")
188-
httpCmd.Flags().String("authorization-server", "", "OAuth authorization server URL override (for OAuth resource metadata)")
189187
httpCmd.Flags().String("base-path", "", "Externally visible base path for the HTTP server (for OAuth resource metadata)")
190188
httpCmd.Flags().Bool("scope-challenge", false, "Enable OAuth scope challenge responses")
191189

@@ -205,7 +203,6 @@ func init() {
205203
_ = viper.BindPFlag("repo-access-cache-ttl", rootCmd.PersistentFlags().Lookup("repo-access-cache-ttl"))
206204
_ = viper.BindPFlag("port", httpCmd.Flags().Lookup("port"))
207205
_ = viper.BindPFlag("base-url", httpCmd.Flags().Lookup("base-url"))
208-
_ = viper.BindPFlag("authorization-server", httpCmd.Flags().Lookup("authorization-server"))
209206
_ = viper.BindPFlag("base-path", httpCmd.Flags().Lookup("base-path"))
210207
_ = viper.BindPFlag("scope-challenge", httpCmd.Flags().Lookup("scope-challenge"))
211208
// Add subcommands

docs/streamable-http.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,6 @@ The OAuth protected resource metadata's `resource` attribute will be populated w
5959

6060
This allows OAuth clients to discover authentication requirements and endpoint information automatically.
6161

62-
### With Custom OAuth Authorization Server
63-
64-
If your GHES deployment requires a non-default OAuth authorization server URL, override it explicitly:
65-
66-
```bash
67-
github-mcp-server http --gh-host https://ghe.example.com --authorization-server https://auth.ghe.example.com/login/oauth
68-
```
69-
70-
You can also set this via `GITHUB_AUTHORIZATION_SERVER`.
71-
7262
## Client Configuration
7363

7464
### Using OAuth Authentication

pkg/http/server.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ type ServerConfig struct {
3939
// If not set, the server will derive the URL from incoming request headers.
4040
BaseURL string
4141

42-
// AuthorizationServer is the OAuth authorization server URL advertised in OAuth
43-
// protected resource metadata. If empty, it is derived from the GitHub host.
44-
AuthorizationServer string
45-
4642
// ResourcePath is the externally visible base path for this server (e.g., "/mcp").
4743
// This is used to restore the original path when a proxy strips a base path before forwarding.
4844
ResourcePath string
@@ -154,9 +150,8 @@ func RunHTTPServer(cfg ServerConfig) error {
154150

155151
// Register OAuth protected resource metadata endpoints
156152
oauthCfg := &oauth.Config{
157-
BaseURL: cfg.BaseURL,
158-
AuthorizationServer: cfg.AuthorizationServer,
159-
ResourcePath: cfg.ResourcePath,
153+
BaseURL: cfg.BaseURL,
154+
ResourcePath: cfg.ResourcePath,
160155
}
161156

162157
serverOptions := []HandlerOption{}

0 commit comments

Comments
 (0)