Skip to content

Conversation

mxcoppell
Copy link

@mxcoppell mxcoppell commented Jul 7, 2025

This pull request makes the MCP Inspector's OAuth 2.0 callback URIs configurable.

Previously, the callback URIs were hardcoded. This change allows them to be set dynamically, which is useful for environments where the Inspector is running behind a proxy or in a containerized setup with a different public-facing URL.

The implementation reads the callback URI from sessionStorage, which can be populated from environment variables on the server at startup. Specifically, the following keys are used:

  • OAUTH_MCP_INSPECTOR_CALLBACK for the standard OAuth flow.
  • OAUTH_MCP_INSPECTOR_DEBUG_CALLBACK for the OAuth debugging flow.

If these session storage items are not set, the Inspector falls back to the default URIs (/oauth/callback and /oauth/callback/debug).

@mxcoppell mxcoppell changed the title feat: Implement OAuth 2.0 PKCE flow for authentication feat: Make OAuth callback URIs configurable Jul 7, 2025
This makes the MCP Inspector's OAuth 2.0 callback URIs configurable via environment variables (OAUTH_MCP_INSPECTOR_CALLBACK, OAUTH_MCP_INSPECTOR_DEBUG_CALLBACK). This is useful for environments where the Inspector is running behind a proxy or in a containerized setup with a different public-facing URL. The server listens on the ports specified in these URLs and forwards OAuth2 authorization codes to the Inspector frontend.
@mxcoppell mxcoppell force-pushed the feature/oauth-flow branch from a0beb17 to f2ed9c9 Compare July 7, 2025 01:24
@olaservo olaservo added the auth Issues and PRs related to authentication and/or authorization label Aug 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth Issues and PRs related to authentication and/or authorization
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants