Skip to content

Allow custom HTTP clients for OAuth#908

Open
jif-oai wants to merge 4 commits into
modelcontextprotocol:mainfrom
jif-oai:jif/oauth-http-client
Open

Allow custom HTTP clients for OAuth#908
jif-oai wants to merge 4 commits into
modelcontextprotocol:mainfrom
jif-oai:jif/oauth-http-client

Conversation

@jif-oai

@jif-oai jif-oai commented Jun 16, 2026

Copy link
Copy Markdown

Why

RMCP currently performs OAuth network operations through internally created reqwest clients. Callers therefore cannot route OAuth through another network environment, even when their MCP HTTP transport supports it.

What changed

  • Add one injectable OAuth HTTP client boundary.
  • Route protected-resource discovery, OAuth/OIDC discovery, dynamic registration, code exchange, refresh, and client credentials through it.
  • Keep reqwest as the default for existing callers.
  • Preserve the injected client across OAuth state transitions.
  • Expose timeout and redirect requirements with each request so token operations can disable redirects.
  • Add focused fake-client coverage for discovery, registration, exchange, and refresh.

@jif-oai jif-oai requested a review from a team as a code owner June 16, 2026 17:15
@github-actions github-actions Bot added T-core Core library changes T-transport Transport layer changes labels Jun 16, 2026
@jif-oai jif-oai force-pushed the jif/oauth-http-client branch from c94e2fa to 4f03bf9 Compare June 16, 2026 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-core Core library changes T-transport Transport layer changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant