[BUG] Web-connected Gmail account overrides local Gmail MCP server configuration
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When connecting a Gmail account via the Claude web interface (claude.ai), the web-connected account overrides a locally configured Gmail MCP server in Claude Code CLI. The local MCP
server is configured to authenticate against a different Gmail account, but after the web connection, all Gmail MCP calls resolve to the web-connected account instead.
Steps to reproduce
- Configure a local Gmail MCP server in Claude Code CLI using @gongrzhe/server-gmail-autoauth-mcp with OAuth credentials for Account A (e.g. a shared/project mailbox)
- Verify that gmail_get_profile returns Account A — works correctly
- Connect Account B (e.g. a personal Gmail account) via the Claude web interface (claude.ai) using the built-in Gmail integration
- Open Claude Code CLI again and call gmail_get_profile
Expected: Returns Account A (the locally configured MCP account)
Actual: Returns Account B (the web-connected account)
Environment
- Claude Code CLI on Linux (Ubuntu)
- Local MCP server: @gongrzhe/server-gmail-autoauth-mcp with credentials stored in ~/.gmail-mcp/
- The local MCP config has not changed — the credentials and server definition remain intact
Impact
This effectively breaks project-scoped Gmail MCP setups where the CLI needs to operate on a different account than the one connected via the web UI. The local MCP configuration should
take precedence over the web-connected account, or at minimum the two should coexist without conflict.
What Should Happen?
Expected: Returns Account A (the locally configured MCP account)
Actual: Returns Account B (the web-connected account)
Error Messages/Logs
Steps to Reproduce
Steps to reproduce
- Configure a local Gmail MCP server in Claude Code CLI using @gongrzhe/server-gmail-autoauth-mcp with OAuth credentials for Account A (e.g. a shared/project mailbox)
- Verify that gmail_get_profile returns Account A — works correctly
- Connect Account B (e.g. a personal Gmail account) via the Claude web interface (claude.ai) using the built-in Gmail integration
- Open Claude Code CLI again and call gmail_get_profile
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
Claude Code 2.1.90
Claude Code Version
Claude Code 2.1.100
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Xterm
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗