Summary
Connects the internal/oauth core library to the stdio MCP server:
BearerAuthTransport gains a TokenProvider consulted per-request, so the lazily-acquired, auto-refreshing OAuth token replaces the pinned static token without rebuilding the HTTP client
RunStdioServer starts without a token and installs receiving middleware that runs the authorization flow on the first tool call, surfacing the auth URL or device code via elicitation (or a tool-result fallback)
- Tool filtering uses the requested OAuth scopes; missing-scope tools are hidden
- A
sessionPrompter adapts the MCP server session to oauth.Prompter, keeping the auth URL off the model's context
- New stdio flags:
--oauth-client-id, --oauth-client-secret, --oauth-scopes, --oauth-callback-port
- New
internal/ghmcp/oauth.go integrates the session layer; internal/ghmcp/server.go updated
Upstream reference
Fork conflict
None. internal/ghmcp/server.go additions are additive alongside the fork's existing project-management setup.
Context
Without this wiring, the core OAuth library has no effect. This commit makes OAuth login the default path for stdio users on github.com by intercepting the first MCP tool call.
Depends on
See parent issue (OAuth story).
Summary
Connects the
internal/oauthcore library to the stdio MCP server:BearerAuthTransportgains aTokenProviderconsulted per-request, so the lazily-acquired, auto-refreshing OAuth token replaces the pinned static token without rebuilding the HTTP clientRunStdioServerstarts without a token and installs receiving middleware that runs the authorization flow on the first tool call, surfacing the auth URL or device code via elicitation (or a tool-result fallback)sessionPrompteradapts the MCP server session tooauth.Prompter, keeping the auth URL off the model's context--oauth-client-id,--oauth-client-secret,--oauth-scopes,--oauth-callback-portinternal/ghmcp/oauth.gointegrates the session layer;internal/ghmcp/server.goupdatedUpstream reference
Fork conflict
None.
internal/ghmcp/server.goadditions are additive alongside the fork's existing project-management setup.Context
Without this wiring, the core OAuth library has no effect. This commit makes OAuth login the default path for stdio users on github.com by intercepting the first MCP tool call.
Depends on
See parent issue (OAuth story).