[BUG] [PRIVACY] GMail MCP Rewrites URL with google tracking URLS as of 5th of June
Status Open
Maintainer reply None cached
Activity 6 comments · opened Jun 7, 2026
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?
As of few days GMail MCP is rewriting - silently URL in the emails created as drafts with google tracking URLs - this is privacy nightmare and it's been done silently without telling anyone.
This should be fixed immediately and this "feature" should be opt-in.
What Should Happen?
URLs should be passed verbatim and not modified on the flight.
Error Messages/Logs
No error logs, no information about this happening
Steps to Reproduce
- Send draft email with embedded URL
- Observe the URL in draft is silently rewritten to
https://www.google.com/url?q=…&source=gmail&ust=…&sa=E)
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
v2.1.168
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
Please - don't do it.
Showing cached comments. Read the full discussion on GitHub ↗
4 Comments
The rewritten form you're seeing —
https://www.google.com/url?q=…&source=gmail&ust=…&sa=E— is Gmail's own link redirector, not something Claude Code or the MCP generates. Thesource=gmail/ust/sa=Eparameters are Gmail's server-side signature; that wrapper is applied by Google's mail infrastructure to links inside email bodies, which lines up with theexternallabel here.That said, "it worked in a previous version" is a real signal, so the useful question is what changed on the MCP side that now makes Gmail wrap the links. The usual trigger is the MIME content type of the body:
text/plain, Gmail generally leaves URLs verbatim.text/html(or multipart with an HTML part), Gmail tends to rewrap<a href>/auto-linked URLs through thegoogle.com/url?q=…redirector.So a likely explanation is that the MCP started sending drafts as HTML where it previously sent plain text.
How to pin down where the rewrite happens (and who owns the fix), without guessing:
users.drafts.getwithformat=RAW(orusers.messages.get?format=raw), and base64url-decode the payload.google.com/url?q=…form → Gmail rewrote it at accept-time (or the MCP sent it pre-wrapped). Check theContent-Typeheader in that same MIME — if it'stext/html, that's almost certainly the cause.If the raw MIME is
text/htmland contains the wrapped URLs, the fix belongs in the Gmail MCP server (sendtext/plain, or expose a content-type option), not in Claude Code core — and it'd be worth filing against that MCP server repo with the raw MIME attached. If the stored body is verbatim, then nothing was actually modified in your data and it's purely Gmail's render-time redirect.Either way, the raw-draft dump is the one artifact that settles it conclusively.
Just to verify if google is doing something global I tested with Grok to send an email with https link and there was no URL google.com wrapping then.
Reproducing this via Claude Desktop + Gmail MCP (Gmail:create_draft)
Same issue here. When Claude creates a draft using htmlBody with clean <a href="https://example.com">anchor text</a> tags, the links in the resulting draft already contain the google.com/url?q=... wrapper before the email is ever sent. This means recipients are hitting a redirect warning interstitial and have to click "Continue to site" before the link loads.
The rewriting is happening inside the MCP at draft-creation time, not as a Gmail send-time behaviour. The href in the draft's HTML source is already wrapped when you inspect the draft in Gmail.
Reddit thread also tracking this: https://www.reddit.com/r/ClaudeCowork/comments/1uci5fz/links_in_coworkdrafted_gmail_started_arriving_as/
Still reproducing on v2.1.197 (macOS), ~6 weeks after this report — not fixed.
**Minimal repro (confirms it's not reply-specific): a brand-new draft via
create_draftwith two plain-text URLs comes back with both** rewritten tohttps://www.google.com/url?q=…&source=gmail&ust=<ts>&sa=Ein the stored body — as visible text, not just thehref. Both share oneust=timestamp → a single wrapping pass at creation. NoreplyToMessageId, no quoted original involved.Contrast on the same account: creating the identical draft via the community
workspace-mcpdraft_gmail_messagetool stores the URLs verbatim. So the raw URL reaches the pipeline intact — the built-in connector is what mangles it.Impact: hits client-facing links — e.g. a payment link renders as
google.com/url?q=…next to "Pay $X," which reads as phishing on a payment email and forces manual fixes or switching tools.+1 that URLs should be passed verbatim.