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

Gmail

  • 406 installs
  • 364 repo stars
  • Updated July 9, 2026
  • sanjay3290/ai-skills

gmail is an Agent Skills Standard skill that connects AI coding assistants to Google Workspace Gmail through Python CLI scripts for search, read, send, draft, and label operations with standalone OAuth.

About

gmail is an Agent Skills Standard (SKILL.md) integration from sanjay3290/ai-skills that connects AI coding assistants to Google Workspace Gmail through two Python CLI scripts. Version 1.0 bundles scripts/auth.py for browser OAuth login and scripts/gmail.py with seven subcommands—search, get, send, create-draft, send-draft, modify, and list-labels—covering Gmail query syntax, HTML email, CC/BCC, and label changes like archive, star, and mark read. Tokens persist in the system keyring (macOS Keychain, Windows Credential Locker, or Linux Secret Service) under service name gmail-skill-oauth, using keyring>=24.0.0 as its sole pip dependency. The skill targets developers who want inbox automation inside Claude Code, Cursor, Codex, or Gemini CLI without deploying the full Google Workspace MCP server. Reach for gmail when an agent must search threads, read messages, send replies, or triage labels during a coding session; skip it if you use a personal Gmail account, because only Google Workspace accounts are supported.

  • gmail
  • AI & Agent Building
  • AI-coding skill

Gmail by the numbers

  • 406 all-time installs (skills.sh)
  • +7 installs in the week ending Jul 26, 2026 (Skillselion tracking)
  • Ranked #1,947 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/sanjay3290/ai-skills --skill gmail

Add your badge

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

Listed on Skillselion
Installs406
repo stars364
Last updatedJuly 9, 2026
Repositorysanjay3290/ai-skills

How do you automate Gmail from Claude Code?

Helps with ai & agent building tasks.

Who is it for?

Developers on Google Workspace who want lightweight Gmail search, send, and label control inside Claude Code, Cursor, or Codex without running a persistent MCP server.

Skip if: Developers using personal Gmail accounts or teams that need the full Google Workspace MCP server with Calendar, Drive, Docs, and Sheets in one deployment.

When should I use this skill?

Trigger gmail when the user asks to search email, read a thread, send or draft a message, archive or star mail, or manage Gmail labels from an AI coding agent.

What you get

OAuth tokens in system keyring, searched message results, sent or drafted emails, and updated Gmail label states (read, starred, archived).

  • sent or drafted Gmail messages
  • searched email thread results
  • modified Gmail label states

By the numbers

  • Exposes 7 gmail.py CLI subcommands for inbox operations
  • Bundles 2 Python scripts: auth.py and gmail.py
  • Skill metadata version 1.0

Files

SKILL.mdMarkdownGitHub ↗

Gmail

Lightweight Gmail integration with standalone OAuth authentication. No MCP server required.

⚠️ Requires Google Workspace account. Personal Gmail accounts are not supported.

First-Time Setup

Authenticate with Google (opens browser):

python scripts/auth.py login

Check authentication status:

python scripts/auth.py status

Logout when needed:

python scripts/auth.py logout

Commands

All operations via scripts/gmail.py. Auto-authenticates on first use if not logged in.

Search Emails

# Search with Gmail query syntax
python scripts/gmail.py search "from:someone@example.com is:unread"

# Search recent emails (no query returns all)
python scripts/gmail.py search --limit 20

# Filter by label
python scripts/gmail.py search --label INBOX --limit 10

# Include spam and trash
python scripts/gmail.py search "subject:important" --include-spam-trash

Read Email Content

# Get full message content
python scripts/gmail.py get MESSAGE_ID

# Get just metadata (headers)
python scripts/gmail.py get MESSAGE_ID --format metadata

# Get minimal response (IDs only)
python scripts/gmail.py get MESSAGE_ID --format minimal

Send Emails

# Send a simple email
python scripts/gmail.py send --to "user@example.com" --subject "Hello" --body "Message body"

# Send with CC and BCC
python scripts/gmail.py send --to "user@example.com" --cc "cc@example.com" --bcc "bcc@example.com" \
  --subject "Team Update" --body "Update message"

# Send from an alias (must be configured in Gmail settings)
python scripts/gmail.py send --to "user@example.com" --subject "Hello" --body "Message" \
  --from "Mile9 Accounts <accounts@mile9.io>"

# Send HTML email
python scripts/gmail.py send --to "user@example.com" --subject "HTML Email" \
  --body "<h1>Hello</h1><p>HTML content</p>" --html

Draft Management

# Create a draft
python scripts/gmail.py create-draft --to "user@example.com" --subject "Draft Subject" \
  --body "Draft content"

# Send an existing draft
python scripts/gmail.py send-draft DRAFT_ID

Modify Messages (Labels)

# Mark as read (remove UNREAD label)
python scripts/gmail.py modify MESSAGE_ID --remove-label UNREAD

# Mark as unread
python scripts/gmail.py modify MESSAGE_ID --add-label UNREAD

# Archive (remove from INBOX)
python scripts/gmail.py modify MESSAGE_ID --remove-label INBOX

# Star a message
python scripts/gmail.py modify MESSAGE_ID --add-label STARRED

# Unstar a message
python scripts/gmail.py modify MESSAGE_ID --remove-label STARRED

# Mark as important
python scripts/gmail.py modify MESSAGE_ID --add-label IMPORTANT

# Multiple label changes at once
python scripts/gmail.py modify MESSAGE_ID --remove-label UNREAD --add-label STARRED

List Labels

# List all Gmail labels (system and user-created)
python scripts/gmail.py list-labels

Gmail Query Syntax

Gmail supports powerful search operators:

QueryDescription
from:user@example.comEmails from a specific sender
to:user@example.comEmails to a specific recipient
subject:meetingEmails with "meeting" in subject
is:unreadUnread emails
is:starredStarred emails
is:importantImportant emails
has:attachmentEmails with attachments
after:2024/01/01Emails after a date
before:2024/12/31Emails before a date
newer_than:7dEmails from last 7 days
older_than:1mEmails older than 1 month
label:workEmails with a specific label
in:inboxEmails in inbox
in:sentSent emails
in:trashTrashed emails

Combine with AND (space), OR, or - (NOT):

python scripts/gmail.py search "from:boss@company.com is:unread newer_than:1d"
python scripts/gmail.py search "subject:urgent OR subject:important"
python scripts/gmail.py search "from:newsletter@example.com -is:starred"

Common Label IDs

LabelID
InboxINBOX
SentSENT
DraftsDRAFT
SpamSPAM
TrashTRASH
StarredSTARRED
ImportantIMPORTANT
UnreadUNREAD

Token Management

Tokens stored securely using the system keyring:

  • macOS: Keychain
  • Windows: Windows Credential Locker
  • Linux: Secret Service API (GNOME Keyring, KDE Wallet, etc.)

Service name: gmail-skill-oauth

Tokens automatically refresh when expired using Google's cloud function.

Related skills

How it compares

Pick gmail over the full Google Workspace MCP when you only need inbox search, send, drafts, and label management from a coding agent without running a persistent MCP server.

FAQ

Does gmail skill work with personal Gmail accounts?

gmail requires a Google Workspace account and does not support personal Gmail. The skill shares OAuth infrastructure with the official Google Workspace MCP, which limits authentication to Workspace tenants.

How does gmail skill store OAuth tokens?

gmail runs python scripts/auth.py login for browser OAuth, then stores tokens in the system keyring under service name gmail-skill-oauth on macOS Keychain, Windows Credential Locker, or Linux Secret Service.

What Gmail operations does gmail skill support?

gmail exposes 7 commands via scripts/gmail.py: search with Gmail query syntax, read full or metadata message bodies, send plain or HTML email, create and send drafts, modify labels, and list all labels.

This week in AI coding

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

unsubscribe anytime.