MCP inspector OAuth token exchange proxy
const url = 'https://example.com/api/oauth/mcp-inspector/token';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"grant_type":"authorization_code","code":"example","redirect_uri":"example","code_verifier":"example","refresh_token":"example","client_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/oauth/mcp-inspector/token \ --header 'Content-Type: application/json' \ --data '{ "grant_type": "authorization_code", "code": "example", "redirect_uri": "example", "code_verifier": "example", "refresh_token": "example", "client_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'Exchanges authorization codes or refresh tokens for the local MCP inspector. Proxies to Supabase OAuth token exchange while keeping anon key usage server-side.
Request Body required
Section titled “Request Body required ”object
Required when grant_type is authorization_code
Must be localhost/127.0.0.1 HTTP or https://local.apphandoff.com
PKCE code verifier (43-128 chars) for authorization_code flow
Required when grant_type is refresh_token
Responses
Section titled “ Responses ”Token exchange payload from Supabase
object
Invalid request
object
Human-readable error message
Stable machine-readable error code for client branching
First validation message per field path
object
Structured validation issues (Zod)
object
Seconds until rate limit resets (429 responses)
Rate limited
object
Human-readable error message
Stable machine-readable error code for client branching
First validation message per field path
object
Structured validation issues (Zod)
object
Seconds until rate limit resets (429 responses)
Seconds until the rate limit resets
Headers
Section titled “Headers ”Server error
object
Human-readable error message
Stable machine-readable error code for client branching
First validation message per field path
object
Structured validation issues (Zod)
object
Seconds until rate limit resets (429 responses)