-
Notifications
You must be signed in to change notification settings - Fork 152
OAuth DCR with Docker CE #208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
slimslenderslacks
approved these changes
Nov 13, 2025
Collaborator
slimslenderslacks
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approved
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.
What I did
export DOCKER_MCP_USE_CE=trueDual-Mode Operation:
DOCKER_MCP_USE_CE=true): Standalone OAuth with credential helpersdocker mcp oauth authorizesequenceDiagram participant User participant Gateway participant Browser participant AuthSrv as Auth Server participant Proxy as mcp-oauth participant Callback as localhost:PORT participant CredHelper as Credential Helper User->>Gateway: docker mcp oauth authorize notion-remote alt No DCR client Gateway->>AuthSrv: OAuth discovery (RFC 9728, RFC 8414) Gateway->>AuthSrv: Register client (RFC 7591)<br/>redirect_uri=https://mcp.docker.com/oauth/callback Gateway->>CredHelper: Store DCR client end Gateway->>Callback: Start HTTP server on port Gateway->>Gateway: Generate PKCE verifier + state UUID Gateway->>Browser: Open auth URL<br/>state=mcp-gateway:PORT:UUID Browser->>AuthSrv: User authorizes AuthSrv->>Proxy: Redirect with code Proxy->>Proxy: Parse state → extract PORT, UUID Proxy->>Callback: http://localhost:PORT/callback?code=X&state=UUID Callback->>Gateway: Return code + UUID Gateway->>Gateway: Validate UUID, get PKCE verifier Gateway->>AuthSrv: Exchange code + verifier → token Gateway->>CredHelper: Store token Gateway-->>User: Authorization successfulComponents:
pkg/oauth/(OAuth Package)Added:
mode.go- Detect CE vs Desktop mode via env varmanager.go- OAuth flow orchestration (authorize, exchange, revoke)callback_server.go- Localhost HTTP server for OAuth callbacksstate.go- PKCE verifier and state UUID trackingtoken_store.go- Store/retrieve OAuth tokens via credential helperbrowser.go- Open browser for authorizationModified:
credhelper.go- Read credential helper from Docker config, add read-write helperprovider.go- Add DCRProvider (public client + PKCE + resource URL)pkg/oauth/dcr/(DCR Subpackage)Added:
manager.go- DCR discovery and registration (calls oauth-helpers library)credentials.go- Store/retrieve DCR clients via credential helpercmd/docker-mcp/(Commands)Modified:
oauth/auth.go- Add CE mode OAuth flow (authorizeCEMode function)oauth/revoke.go- Add CE mode revoke (deletes token + DCR client)server/enable.go- Skip DCR pre-registration in CE modeRelated issue
N/A
(not mandatory) A picture of a cute animal, if possible in relation to what you did
N/A