Persist Google OAuth 2.1 tokens across container restarts - #2
Open
ibulgakov wants to merge 1 commit into
Open
Conversation
MCP_ENABLE_OAUTH21=true stores refresh/upstream tokens via fastmcp's OAuth-proxy under /home/app/.local/share/fastmcp, not under WORKSPACE_MCP_CREDENTIALS_DIR. That directory wasn't bind-mounted, so docker compose down (or any container recreation) silently wiped the Google OAuth session, and SETUP.md's ./google-credentials/ check in Step 7 never actually reflected auth success in this mode. Fixes #1
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.
Problem
With
MCP_ENABLE_OAUTH21=true, thegoogle_workspace_mcpimage does not store Google OAuth tokens underWORKSPACE_MCP_CREDENTIALS_DIR(/home/app/.google_workspace_mcp/credentials, bind-mounted as./google-credentials). Instead it stores refresh/upstream tokens via its internal fastmcp OAuth-proxy under/home/app/.local/share/fastmcp/oauth-proxy/..., which wasn't bind-mounted anywhere.Consequences:
ls ./google-credentials/) never reflects real auth state in this mode -- it stays empty even after a fully successful OAuth flow.docker compose down(or any container recreation) silently wipes the Google OAuth session, forcing re-authentication every time, contrary to what Step 9's checklist implies.Verified manually end-to-end: authenticated via Claude Code, confirmed Google Workspace tools worked, found
./google-credentials/empty, located the real tokens viadocker exec ... find /home/app/.local/share/fastmcp -iname *token*, then confirmed the fix by recreating the container and confirming tokens (and a livesearch_drive_filescall) survived.Fixes #1
Change
docker-compose.yml(and the synced copy inSETUP.md): add a second bind mount,./google-oauth-proxy:/home/app/.local/share/fastmcp, with a comment explaining why.SETUP.mdStep 7: point the success-verification command at the new directory instead of./google-credentials/, and note explicitly that./google-credentials/staying empty is expected/not a failure signal in OAuth 2.1 mode.SETUP.mdStep 9 checklist: same correction.Testing
docker compose up -dwith the new volume, authenticated via/mcpin Claude Code -- tokens appeared under./google-oauth-proxy/oauth-proxy/*/S_mcp_refresh_tokens-*.docker compose up -d google-workspace-mcp, forcing recreate) -- tokens persisted,search_drive_fileskept working without re-auth.