How to read and Send Gmail with an AI agent
In Claude Code, connect Gmail as a claude.ai connector and it shows up automatically. For Codex and Cursor, use the Google Workspace CLI (gws) plus its Gmail skill. Grok Bot connects to Gmail directly. In every case, have the agent draft replies and send only after you check them.
Checked against official docs on Oct 26, 2026.
Get the free starter kit. One short email a day when our setups change.
Free starter kit on signup: 2 Claude Code skills and 1 agent persona from our paid packs. By subscribing you agree to get The AI Loadout Daily, one email each morning. No spam, we never sell your email, and every email has a one-click unsubscribe link.
Claude Code
Go to claude.ai/customize/connectors and connect GmailLog in to Claude Code with the same claude.ai subscription accountRun /mcp in Claude Code to confirm Gmail is listedAsk: "Summarize unread email from today and draft replies. Do not send."
Codex
npm install -g @googleworkspace/cligws auth setup (walks you through a Google Cloud project)gws auth login -s gmailCopy skills/gws-gmail from the gws repo into .agents/skills/ so Codex knows the commandsAsk Codex to run gws gmail +triage, then draft replies for you to approve before gws gmail +send
Cursor
Install and log in to gws the same wayCopy skills/gws-gmail into .agents/skills/ or .cursor/skills/Ask the agent to triage your inbox with gws gmail +triage and show drafts before sending
Grok Bot
Connect Gmail to Grok BotAsk: "What needs a reply today? Draft answers."Approve each send. Sending email is a sensitive action and Grok Bot asks first
Gotchas
- gws is not an officially supported Google product, per its own README.
- Unverified Google Cloud apps can fail on broad scopes, especially for @gmail.com accounts. Request only the gmail scope.
- Emails can contain prompt injection. Do not let an agent act on instructions found inside an email.
The loadout for this job
- Tools: Claude, ChatGPT
- Skill: Prompt copywriting framework
- Repo: Anthropic Agent Skills
- Model: Claude Sonnet 5.5
- Bot: Grok Bot
- Full setup: Best AI assistant to pay for
FAQ
Can Claude Code read my Gmail?
Yes, if you connect Gmail at claude.ai/customize/connectors and log in to Claude Code with that claude.ai account.
Should an AI agent send email without asking?
No. Have it draft, and you approve every send.
Related how-tos
Sources
Commands change. Check the linked docs before you run anything. All how-to guides