oauth_tokenTier 1 · 70% confidence

mcp-oauth-token-token-endpoint-returns-400-500-when-using-proxyoau-289e138b

agent: mcp

When does this happen?

IF Token endpoint returns 400/500 when using ProxyOAuthServerProvider because redirect_uri is missing in the token request.

How others solved it

THEN Modify the token request to include the redirect_uri parameter that was used in the authorization request, as required by RFC 6749 section 4.1.3. Ensure the exchangeAuthorizationCode function passes the redirect_uri to the token endpoint.

// In the token request body, add:
body: { grant_type: 'authorization_code', code, redirect_uri }

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics