feat(mcp): support custom OAuth callbackRedirectURL for remote toolsets#2494
Merged
dgageot merged 1 commit intodocker:mainfrom Apr 22, 2026
Merged
feat(mcp): support custom OAuth callbackRedirectURL for remote toolsets#2494dgageot merged 1 commit intodocker:mainfrom
dgageot merged 1 commit intodocker:mainfrom
Conversation
Add an optional `callbackRedirectURL` field to the remote MCP OAuth config. When set, it is advertised to the authorization server as the OAuth `redirect_uri` instead of the default `http://127.0.0.1:{callbackPort}/callback`. The literal placeholder `${callbackPort}` is substituted with the actual port the local callback server is listening on. This lets users put a public-facing proxy (HTTPS or pre-registered static redirect) in front of the local loopback callback, working around auth servers that refuse http://localhost redirect URIs. The local callback server still listens on 127.0.0.1:{callbackPort}; only the advertised redirect URI changes. Validation: - URL must be absolute (scheme + host) once ${callbackPort} is substituted. - Scheme must be http or https; other schemes (javascript:, file:, ftp:, …) are rejected. - http is only allowed on loopback hosts (127.0.0.1, ::1, localhost); non-loopback http would expose the authorization code on the wire (RFC 8252 §7.3). Includes JSON schema + docs update, a runnable example, and unit tests for validation and the pure buildRedirectURI substitution helper. Assisted-By: docker-agent
gtardif
approved these changes
Apr 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add an optional
callbackRedirectURLfield to the remote MCP OAuth config. When set, it is advertised to the authorization server as the OAuthredirect_uriinstead of the defaulthttp://127.0.0.1:{callbackPort}/callback. The literal placeholder${callbackPort}is substituted with the actual port the local callback server is listening on.This lets users put a public-facing proxy (HTTPS or pre-registered static redirect) in front of the local loopback callback, working around auth servers that refuse http://localhost redirect URIs. The local callback server still listens on 127.0.0.1:{callbackPort}; only the advertised redirect URI changes.
Validation:
Includes JSON schema + docs update, a runnable example, and unit tests for validation and the pure buildRedirectURI substitution helper.
Assisted-By: docker-agent