diff --git a/docs/streamable-http.md b/docs/streamable-http.md index e0fb461ef2..35f8a18f96 100644 --- a/docs/streamable-http.md +++ b/docs/streamable-http.md @@ -132,15 +132,25 @@ github-mcp-server http --trust-proxy-headers Equivalent environment variable: `GITHUB_TRUST_PROXY_HEADERS=1`. Only enable this when the upstream proxy is trusted to set or strip these headers; otherwise prefer `--base-url`. When `--base-url` is set, it always takes precedence and `--trust-proxy-headers` has no effect. -### With an OAuth Proxy (GHES / non-standard authorization server) +### With an OAuth Proxy (GHES / clients that require Dynamic Client Registration) -When deploying against GitHub Enterprise Server, GHES does not natively support the OAuth extensions required by MCP (RFC 8414 metadata discovery, RFC 7591 Dynamic Client Registration, PKCE). In this case you can run a separate OAuth proxy that implements the MCP OAuth spec and forwards authentication to GHES. Use `--authorization-server` to advertise the proxy's URL in the protected resource metadata instead of the one derived from `--gh-host`: +When deploying against GitHub Enterprise Server, GHES does not natively support the OAuth extensions required by MCP (RFC 8414 metadata discovery, RFC 7591 Dynamic Client Registration, PKCE). In this case you can run a separate OAuth proxy that implements the MCP OAuth spec and forwards authentication to GHES. + +The same approach works on `github.com` for MCP clients that can only register through RFC 7591 Dynamic Client Registration: the authorization server metadata for `https://github.com/login/oauth` does not advertise a `registration_endpoint`. + +Use `--authorization-server` to advertise the proxy's URL in the protected resource metadata instead of the one derived from `--gh-host`: ```bash +# GitHub Enterprise Server github-mcp-server http \ --gh-host https://github.example.com \ --base-url https://mcp.example.com \ --authorization-server https://mcp.example.com/oauth-proxy + +# github.com, for clients that require Dynamic Client Registration +github-mcp-server http \ + --base-url https://mcp.example.com \ + --authorization-server https://mcp.example.com/oauth-proxy ``` The `authorization_servers` field in the protected resource metadata will then point at your proxy: @@ -159,6 +169,11 @@ Equivalent environment variable: `GITHUB_AUTHORIZATION_SERVER=https://mcp.exampl When neither the flag nor environment variable is set, the server preserves the existing behavior and derives the authorization server from `--gh-host`. The override only changes the URL advertised in OAuth protected resource metadata; it does not change token validation or the GitHub API host. +The server still expects a GitHub token in the `Authorization` header and uses it to call the GitHub API, so the proxy must hand clients a GitHub access token (for example by brokering GitHub's OAuth flow). A proxy that issues its own tokens must also sit in front of the MCP endpoint and replace them with a GitHub token before forwarding requests. + +> [!NOTE] +> This flag only configures a self-hosted server. GitHub's hosted remote server (`https://api.githubcopilot.com/mcp/`) advertises `https://github.com/login/oauth` and does not support Dynamic Client Registration, so clients that require it need a self-hosted server or a proxy in front of the MCP endpoint. + ## Client Configuration ### Using OAuth Authentication