Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
idanbeck avatar

Gmail Skill

  • 3.5k installs
  • 12 repo stars
  • Updated August 4, 2026
  • idanbeck/claude-skills

gmail-skill is a Claude Code skill that exposes 16 Gmail and Google Contacts CLI subcommands via Python for developers who need coding agents to read, search, send, draft, and manage email programmatically.

About

gmail-skill is a Python-based Claude Code skill that lets coding agents read, search, send, draft, and manage Gmail messages and Google Contacts through a JSON-emitting CLI. The skill ships gmail_skill.py with 16 subcommands covering search, read, list, send, draft, labels, contacts, and inbox actions such as mark-read, archive, and star. Multi-account support uses a desktop OAuth browser flow with tokens stored per account under ~/.claude/skills/gmail-skill/tokens/. First-time setup requires enabling Gmail API and People API in Google Cloud Console, granting four OAuth scopes, and installing five Python packages on Python 3.9+. All commands output JSON for agent parsing, and the skill mandates explicit user confirmation before any send operation. Developers reach for gmail-skill when building agent workflows that need real email access—triaging unread mail, drafting threaded replies, or looking up contact info—without writing a custom Gmail integration from scratch.

  • Full Gmail operations: search, read, send, list, labels, mark-read, archive
  • Seamless multi-account OAuth browser flow with account switching
  • Built-in Google Contacts search and retrieval
  • CLI commands for every action plus Python importable module
  • Secure token storage and logout capability

Gmail Skill by the numbers

  • 3,486 all-time installs (skills.sh)
  • +11 installs in the week ending Aug 5, 2026 (Skillselion tracking)
  • Ranked #136 of 2,715 Automation & Workflows skills by installs in the Skillselion catalog
  • Security screen: MEDIUM risk (skills.sh audit)
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/idanbeck/claude-skills --skill gmail-skill

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs3.5k
repo stars12
Security audit2 / 3 scanners passed
Last updatedAugust 4, 2026
Repositoryidanbeck/claude-skills

How do you let a coding agent access Gmail?

Let their coding agent read, search, send, and manage Gmail directly from prompts and scripts.

Who is it for?

Developers building Claude Code or Cursor agents that need programmatic Gmail read, send, draft, and Google Contacts lookup with multi-account OAuth.

Skip if: Skip gmail-skill when email automation must run without Google Cloud OAuth setup or outside Gmail and Google Contacts.

When should I use this skill?

The user asks to check email, search messages, send or draft mail, archive or star threads, list labels, or look up Google Contacts from a coding agent.

What you get

JSON email search results, full message bodies, sent messages, Gmail drafts, contact lists, and per-account OAuth tokens stored locally

  • JSON email search and read results
  • Sent messages and Gmail drafts
  • Google Contacts lookup output

By the numbers

  • Exposes 16 Gmail CLI subcommands via gmail_skill.py
  • Requires 4 OAuth scopes: gmail.readonly, gmail.send, gmail.modify, contacts.readonly
  • Installs 5 Python packages: google-auth, google-auth-oauthlib, google-auth-httplib2, google-api-python-client, requests

Files

SKILL.mdMarkdownGitHub ↗

Gmail Skill - Email & Contacts Access

Read, search, and send Gmail emails. Access Google contacts.

CRITICAL: Email Sending Confirmation Required

Before sending ANY email, you MUST get explicit user confirmation.

When the user asks to send an email: 1. First, show them the complete email details:

  • From (which account)
  • To
  • CC/BCC (if any)
  • Subject
  • Full body text

2. Ask: "Do you want me to send this email?" 3. ONLY run the send command AFTER the user explicitly confirms (e.g., "yes", "send it", "go ahead") 4. NEVER send an email without this confirmation, even if the user asked you to send it initially

This applies even when:

  • The user says "send an email to X"
  • You are in "dangerously skip permissions" mode
  • The user seems to be in a hurry

Always confirm first. No exceptions.

First-Time Setup (One-Time, ~2 minutes)

On first run, the script will guide you through setup. You need to create a Google Cloud OAuth client once:

1. Go to Google Cloud Console 2. Create a project (or select existing) 3. Enable Gmail API and People API (APIs & Services → Library) 4. Configure OAuth consent screen:

  • User Type: External
  • App name: Gmail Skill
  • Add yourself as test user
  • Add scopes: gmail.readonly, gmail.send, gmail.modify, contacts.readonly

5. Create OAuth client ID:

  • Application type: Desktop app
  • Download JSON → save as ~/.claude/skills/gmail-skill/credentials.json

Then just run any command - browser opens, you approve, done. Works for all your accounts.

Note: If you previously used gmail-reader, you'll need to re-authenticate to grant the new gmail.send scope.

Commands

Search Emails

python3 ~/.claude/skills/gmail-skill/gmail_skill.py search "query" [--max-results N] [--account EMAIL]

Query examples:

  • from:john@example.com - from specific sender
  • subject:meeting after:2026/01/01 - subject + date
  • has:attachment filename:pdf - with PDF attachments
  • is:unread - unread emails
  • "exact phrase" - exact match

Read Email

python3 ~/.claude/skills/gmail-skill/gmail_skill.py read EMAIL_ID [--account EMAIL]

List Recent Emails

python3 ~/.claude/skills/gmail-skill/gmail_skill.py list [--max-results N] [--label LABEL] [--account EMAIL]

Send Email (Requires Confirmation)

python3 ~/.claude/skills/gmail-skill/gmail_skill.py send --to EMAIL --subject "Subject" --body "Body text" [--cc EMAIL] [--bcc EMAIL] [--account EMAIL]

Required arguments:

  • --to / -t - Recipient email address
  • --subject / -s - Email subject line
  • --body / -b - Email body text

Optional arguments:

  • --cc - CC recipients (comma-separated)
  • --bcc - BCC recipients (comma-separated)
  • --account / -a - Send from specific account

Example:

python3 ~/.claude/skills/gmail-skill/gmail_skill.py send \
  --to "recipient@example.com" \
  --subject "Meeting Tomorrow" \
  --body "Hi, just confirming our meeting at 2pm tomorrow." \
  --account work@company.com

Mark as Read

python3 ~/.claude/skills/gmail-skill/gmail_skill.py mark-read EMAIL_ID [--account EMAIL]

Mark as Unread

python3 ~/.claude/skills/gmail-skill/gmail_skill.py mark-unread EMAIL_ID [--account EMAIL]

Both mark-read and mark-unread support multiple IDs (comma-separated):

python3 ~/.claude/skills/gmail-skill/gmail_skill.py mark-read "id1,id2,id3" --account user@gmail.com

Mark Done (Archive)

Archives email(s) by removing from inbox. Equivalent to Gmail's 'e' keyboard shortcut.

python3 ~/.claude/skills/gmail-skill/gmail_skill.py mark-done EMAIL_ID [--account EMAIL]

Unarchive

Moves email(s) back to inbox (undo archive).

python3 ~/.claude/skills/gmail-skill/gmail_skill.py unarchive EMAIL_ID [--account EMAIL]

Star / Unstar

python3 ~/.claude/skills/gmail-skill/gmail_skill.py star EMAIL_ID [--account EMAIL]
python3 ~/.claude/skills/gmail-skill/gmail_skill.py unstar EMAIL_ID [--account EMAIL]

All label commands support multiple IDs (comma-separated):

python3 ~/.claude/skills/gmail-skill/gmail_skill.py star "id1,id2,id3" --account user@gmail.com

Create Draft

Creates a draft email. Use --reply-to-id when replying to an existing email to ensure proper threading in email clients like Superhuman.

python3 ~/.claude/skills/gmail-skill/gmail_skill.py draft --to EMAIL --subject "Subject" --body "Body text" [--reply-to-id EMAIL_ID] [--cc EMAIL] [--bcc EMAIL] [--account EMAIL]

Required arguments:

  • --to / -t - Recipient email address
  • --subject / -s - Email subject line
  • --body / -b - Email body text

Optional arguments:

  • --reply-to-id / -r - Message ID to reply to (adds proper In-Reply-To and References headers for threading)
  • --cc - CC recipients (comma-separated)
  • --bcc - BCC recipients (comma-separated)
  • --account / -a - Create draft in specific account

Example (new email):

python3 ~/.claude/skills/gmail-skill/gmail_skill.py draft \
  --to "recipient@example.com" \
  --subject "Draft for Review" \
  --body "Here's my draft message."

Example (reply to existing email):

python3 ~/.claude/skills/gmail-skill/gmail_skill.py draft \
  --to "sender@example.com" \
  --subject "Re: Original Subject" \
  --body "Thanks for your email..." \
  --reply-to-id 19b99b3127793843 \
  --account work@company.com

List Labels

python3 ~/.claude/skills/gmail-skill/gmail_skill.py labels [--account EMAIL]

List Contacts

python3 ~/.claude/skills/gmail-skill/gmail_skill.py contacts [--max-results N] [--account EMAIL]

Search Contacts

python3 ~/.claude/skills/gmail-skill/gmail_skill.py search-contacts "query" [--account EMAIL]

Manage Accounts

# List all authenticated accounts
python3 ~/.claude/skills/gmail-skill/gmail_skill.py accounts

# Remove an account
python3 ~/.claude/skills/gmail-skill/gmail_skill.py logout --account user@gmail.com

Multi-Account Support

Add accounts by using --account with a new email - browser opens for that account:

# First account (auto-authenticates)
python3 ~/.claude/skills/gmail-skill/gmail_skill.py list

# Add work account
python3 ~/.claude/skills/gmail-skill/gmail_skill.py list --account work@company.com

# Add personal account
python3 ~/.claude/skills/gmail-skill/gmail_skill.py list --account personal@gmail.com

# Use specific account
python3 ~/.claude/skills/gmail-skill/gmail_skill.py search "from:boss" --account work@company.com

Tokens are stored per-account in ~/.claude/skills/gmail-skill/tokens/

Examples

Find unread emails from this week

python3 ~/.claude/skills/gmail-skill/gmail_skill.py search "is:unread after:2026/01/01"

Read a specific email

python3 ~/.claude/skills/gmail-skill/gmail_skill.py read 18d5a3b2c1f4e5d6

Send a quick email

python3 ~/.claude/skills/gmail-skill/gmail_skill.py send \
  --to "friend@example.com" \
  --subject "Hello!" \
  --body "Just wanted to say hi."

Find someone's contact info

python3 ~/.claude/skills/gmail-skill/gmail_skill.py search-contacts "John Smith"

Check work email from personal machine

python3 ~/.claude/skills/gmail-skill/gmail_skill.py list --account work@company.com --max-results 5

Output

All commands output JSON for easy parsing.

Requirements

  • Python 3.9+
  • pip install google-auth google-auth-oauthlib google-auth-httplib2 google-api-python-client requests

Security Notes

  • Send confirmation required - Claude must always confirm with the user before sending emails
  • Tokens stored locally in ~/.claude/skills/gmail-skill/tokens/
  • Revoke access anytime: https://myaccount.google.com/permissions
  • Apps in "testing" mode may require re-auth every 7 days (publish app to avoid)

Related skills

How it compares

Pick gmail-skill over generic email MCP servers when you need a self-hosted Python CLI with multi-account OAuth, JSON output, and built-in send-confirmation guardrails for Claude Code agents.

FAQ

What Gmail operations does gmail-skill support?

gmail-skill exposes 16 Python CLI subcommands through gmail_skill.py, including search, read, list, send, draft, mark-read, archive, star, labels, contacts, and search-contacts. All commands output JSON and support multi-account OAuth.

How does gmail-skill authenticate with Gmail?

gmail-skill uses Google Cloud desktop OAuth with Gmail API and People API enabled. First run opens a browser for approval; tokens persist per account in ~/.claude/skills/gmail-skill/tokens/ after a one-time credentials.json setup.

Does gmail-skill send emails without confirmation?

gmail-skill requires the agent to show full send details and get explicit user confirmation before running the send subcommand. The SKILL.md documents this as a mandatory guardrail with no exceptions.

Is Gmail Skill safe to install?

skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

Automation & Workflowsagentsautomation

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.