Bug: GOOGLE_REFRESH_TOKEN not passed to MCP server process
Bug: GOOGLE_REFRESH_TOKEN not passed to MCP server process
Summary
When configuring google-drive MCP server in claude_desktop_config.json, the GOOGLE_REFRESH_TOKEN environment variable is not being passed to the spawned MCP server process, while other environment variables (GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, GOOGLE_REDIRECT_URI) are passed correctly.
Environment
- OS: macOS 26.2 (Build 25C56)
- Claude Desktop: Latest version
- MCP Server: mcp-google-drive@1.6.2
- Install location:
/opt/homebrew/bin/mcp-google-drive
Configuration
claude_desktop_config.json:
{
"mcpServers": {
"google-drive": {
"command": "/opt/homebrew/bin/mcp-google-drive",
"env": {
"GOOGLE_CLIENT_ID": "xxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com",
"GOOGLE_CLIENT_SECRET": "GOCSPX-xxxxxxxxxxxxxxxxxxxxxxxx",
"GOOGLE_REFRESH_TOKEN": "1//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"GOOGLE_REDIRECT_URI": "http://localhost"
}
}
}
}
Observed Behavior
When checking the environment variables of the running mcp-google-drive process:
$ ps eww <PID> | tr ' ' '\n' | grep "GOOGLE"
GOOGLE_CLIENT_ID=xxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=GOCSPX-xxxxxxxxxxxxxxxxxxxxxxxx
GOOGLE_REDIRECT_URI=http://localhost
Note: GOOGLE_REFRESH_TOKEN is missing from the process environment variables!
Expected Behavior
All environment variables defined in the env section of the config should be passed to the spawned MCP server process, including GOOGLE_REFRESH_TOKEN.
Impact
Without the refresh token, the MCP server cannot authenticate with Google Drive API and fails with:
MCP error -32603: Authentication not ready after 3 seconds
MCP server logs show:
[ERROR] MCP-Google-Drive: Failed to initialize Google Drive API: Error: No authentication credentials provided
[ERROR] MCP-Google-Drive: Authentication failed after 3 attempts
Steps to Reproduce
- Configure
google-driveMCP server inclaude_desktop_config.jsonwith all required environment variables includingGOOGLE_REFRESH_TOKEN - Restart Claude Desktop
- Start a new conversation session
- Attempt to use any Google Drive MCP tool
- Check the environment variables of the spawned
mcp-google-driveprocess using:ps eww <PID> | tr ' ' '\n' | grep "GOOGLE"
Additional Notes
- JSON configuration is valid (verified with
python3 -m json.tool) - The refresh token is present in the config file
- Restarting Claude Desktop does not resolve the issue
- Killing and restarting the MCP process does not help
- Other MCP servers (MS365, Notion) work correctly in the same configuration
Workaround Attempted
- Fully restarted Claude Desktop (Cmd+Q and relaunch)
- Killed all
mcp-google-driveprocesses to force respawn - Validated JSON configuration format
- No workaround found
Possible Cause
This appears to be a bug in how Claude Desktop passes environment variables to MCP server processes. Specifically, GOOGLE_REFRESH_TOKEN is being filtered out or not transmitted, while other variables are passed correctly.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗