mcpbeat Sign in

Gmail Skill for Claude

This skill should be used when searching, fetching, or downloading emails from Gmail. Use for queries like "search Gmail for...", "find emails from John", "show unread emails", "emails about project X", or "download attachment from email".

8k tokens
context cost
the whole folder, loaded on every use
4
files
ships runnable scripts
0
copies elsewhere
how many repositories repackaged it
337
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/glebis/claude-skills --skill gmail

What comes with it

22 296 bytes besides the instruction
.claude-plugin/plugin.json
README.md
scripts/gmail_search.py

The instruction itself

26 sections, as written by the author

Gmail Search Skill

Search and fetch emails via Gmail API with flexible query options and output formats.

Prerequisites

Credentials must be configured in ~/.gmail_credentials/. Run setup to check status:

python3 scripts/gmail_search.py setup

Obtaining Gmail API Credentials

1. Create Google Cloud Project
2. Enable Gmail API
  • Navigate to "APIs & Services" -> "Library"
  • Search for "Gmail API"
  • Click it and press "Enable"
  • Go to "OAuth consent screen" (left sidebar)
  • Choose "External" user type
  • Fill in required fields:
  • App name: Gmail Agent Skill
  • User support email: your email
  • Developer email: your email
  • Click "Save and Continue", skip Scopes
  • On "Test users" page, add your Gmail address
  • Complete all steps
4. Publish the Test App

Important: Without this step, you'll get "Error 403: access_denied".

  • Go back to "OAuth consent screen"
  • Under "Publishing status", click "Publish App"
  • Confirm the dialog

This keeps the app in test mode (not production) but allows your test users to authenticate. You'll see an "unverified app" warning during login - click "Advanced" -> "Go to Gmail Agent Skill (unsafe)" to proceed.

Note: Test tokens expire after 7 days. Production requires Google verification.

5. Create OAuth Credentials
  • Go to "Credentials" (left sidebar)
  • Click "Create Credentials" -> "OAuth client ID"
  • Select "Desktop app" as application type
  • Name it (e.g., "Gmail Agent Client")
  • Click "Create"
6. Get Your Credentials
  • Client ID will be displayed - copy it
  • Client Secret: Click the download icon or view details to get the secret
7. Save Credentials

Create ~/.gmail_credentials/credentials.json:

{
  "installed": {
    "client_id": "YOUR_CLIENT_ID",
    "client_secret": "YOUR_CLIENT_SECRET",
    "auth_uri": "https://accounts.google.com/o/oauth2/auth",
    "token_uri": "https://oauth2.googleapis.com/token",
    "redirect_uris": ["http://localhost"]
  }
}
8. Authenticate
python3 scripts/gmail_search.py auth

This opens a browser. Click through the "unverified app" warning ("Advanced" -> "Go to Gmail Agent Skill"), approve access, and you're ready.

Quick Start

# Check setup status
python3 scripts/gmail_search.py setup

# Authenticate (opens browser)
python3 scripts/gmail_search.py auth

# Search emails
python3 scripts/gmail_search.py search "meeting notes"

# Search with filters
python3 scripts/gmail_search.py search --from "[email protected]" --unread

Commands

Setup

Check configuration status:

python3 scripts/gmail_search.py setup
python3 scripts/gmail_search.py setup --json

Authenticate

Authenticate with Gmail (opens browser for OAuth):

python3 scripts/gmail_search.py auth

Scope

View or change API permission scope:

# View current scope
python3 scripts/gmail_search.py scope

# Change scope (requires re-auth)
python3 scripts/gmail_search.py scope --set readonly
python3 scripts/gmail_search.py scope --set modify
python3 scripts/gmail_search.py scope --set full

Available scopes:

  • readonly - Read emails only (default, recommended)
  • modify - Read + modify labels, mark read/unread
  • full - Full access including delete

Search emails with free-text query or filters:

# Free-text search (uses Gmail search syntax)
python3 scripts/gmail_search.py search "project deadline"
python3 scripts/gmail_search.py search "from:[email protected] subject:invoice"

# Using helper flags
python3 scripts/gmail_search.py search --from "[email protected]"
python3 scripts/gmail_search.py search --to "[email protected]"
python3 scripts/gmail_search.py search --subject "Weekly Report"
python3 scripts/gmail_search.py search --label "INBOX"
python3 scripts/gmail_search.py search --label "work"

# Date filters (YYYY/MM/DD format)
python3 scripts/gmail_search.py search --after 2024/01/01
python3 scripts/gmail_search.py search --before 2024/12/31
python3 scripts/gmail_search.py search --after 2024/01/01 --before 2024/06/30

# Status filters
python3 scripts/gmail_search.py search --unread
python3 scripts/gmail_search.py search --starred
python3 scripts/gmail_search.py search --has-attachment

# Combined filters
python3 scripts/gmail_search.py search "invoice" --from "billing@" --has-attachment --after 2024/01/01

# Limit results
python3 scripts/gmail_search.py search "meeting" --limit 50

# Include full body (default shows snippet only)
python3 scripts/gmail_search.py search "contract" --full

# Include attachment info
python3 scripts/gmail_search.py search --has-attachment --attachments

# JSON output
python3 scripts/gmail_search.py search "project" --json

Download Attachments

Download attachments from a specific message:

# Download to default location (~/Downloads/gmail_attachments/)
python3 scripts/gmail_search.py download MESSAGE_ID

# Download to custom directory
python3 scripts/gmail_search.py download MESSAGE_ID --output /path/to/folder

# JSON output
python3 scripts/gmail_search.py download MESSAGE_ID --json

Get message ID from search results (shown in output).

Labels

List all available Gmail labels:

python3 scripts/gmail_search.py labels
python3 scripts/gmail_search.py labels --json

Output Formats

Markdown (default)

# Gmail Search Results (3 messages)

## Weekly Report
**From:** [email protected]
**To:** [email protected]
**Date:** Mon, 25 Nov 2024 10:00:00 +0000
**ID:** `18abc123def`

> Here's the weekly report summary...

---

JSON

Add --json flag for structured output:

[
  {
    "id": "18abc123def",
    "thread_id": "18abc123def",
    "from": "[email protected]",
    "to": "[email protected]",
    "subject": "Weekly Report",
    "date": "Mon, 25 Nov 2024 10:00:00 +0000",
    "snippet": "Here's the weekly report summary...",
    "labels": ["INBOX", "UNREAD"]
  }
]

Gmail Search Syntax

The skill supports Gmail's native search syntax in free-text queries:

| Operator | Example | Description |

|----------|---------|-------------|

| from: | from:[email protected] | From specific sender |

| to: | to:[email protected] | To specific recipient |

| subject: | subject:meeting | In subject line |

| label: | label:work | Has specific label |

| has:attachment | has:attachment | Has attachments |

| filename: | filename:pdf | Attachment filename |

| is:unread | is:unread | Unread messages |

| is:starred | is:starred | Starred messages |

| after: | after:2024/01/01 | After date |

| before: | before:2024/12/31 | Before date |

| newer_than: | newer_than:7d | Within last N days |

| older_than: | older_than:1m | Older than N months |

| in: | in:inbox | In specific folder |

| OR | from:john OR from:jane | Either condition |

| - | -label:spam | Exclude |

| "" | "exact phrase" | Exact match |

Example User Requests

| User says | Command |

|-----------|---------|

| "Search Gmail for meeting notes" | search "meeting notes" |

| "Find emails from John" | search --from "john" |

| "Show unread emails" | search --unread |

| "Emails about the project from last month" | search "project" --after 2024/10/01 |

| "Invoices with attachments" | search "invoice" --has-attachment |

| "Read the full email about contract" | search "contract" --full --limit 1 |

| "Download attachments from that email" | download MESSAGE_ID |

| "What labels do I have?" | labels |

| "Starred emails from boss" | search --from "boss" --starred |

| "Is Gmail configured?" | setup |

Dependencies

pip install google-api-python-client google-auth-httplib2 google-auth-oauthlib

Files

  • ~/.gmail_credentials/credentials.json - OAuth client credentials
  • ~/.gmail_credentials/token.pickle - Cached auth token
  • ~/.gmail_credentials/scope.txt - Current scope setting

Other skills for the same job

different authors, same section of the catalogue
Meeting Insights Analyzer
by frostant
×8

Analyzes meeting transcripts and recordings to uncover behavioral patterns, communication insights, and actionable feedback. Identifies when you avoid conflict, use filler words, dominate conversations, or miss opportunities to listen. Perfect for professionals seeking to improve their communication and leadership skills.

3k tokens
Slack Gif Creator
by JayZeeDesign
×7

Toolkit for creating animated GIFs optimized for Slack, with validators for size constraints and composable animation primitives. This skill applies when users request animated GIFs or emoji animations for Slack from descriptions like "make me a GIF for Slack of X doing Y".

53k tokens scripts
Developer Growth Analysis
by frostant
×6

Analyzes your recent Claude Code chat history to identify coding patterns, development gaps, and areas for improvement, curates relevant learning resources from HackerNews, and automatically sends a personalized growth report to your Slack DMs.

4k tokens
Slack Gif Creator
by anthropics
vendor ×5

Knowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack.

11k tokens scripts
Skill Share
by frostant
×4

A skill that creates new Claude skills and automatically shares them on Slack using Rube for seamless team collaboration and skill discovery.

728 tokens
Electron
by vercel-labs
vendor ×2

Automate Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify, etc.) using agent-browser via Chrome DevTools Protocol. Use when the user needs to interact with an Electron app, automate a desktop app, connect to a running app, control a native app, or test an Electron application. Triggers include "automate Slack app", "control VS Code", "interact with Discord app", "test this Electron app", "connect to desktop app", or any task requiring automation of a native Electron application.

2k tokens
Notion Meeting Intelligence
by openai
vendor ×2

Prepare meeting materials with Notion context and Codex research; use when gathering context, drafting agendas/pre-reads, and tailoring materials to attendees.

18k tokens
Daily Meeting Update
by softaworks
×2

Interactive daily standup/meeting update generator. Use when user says 'daily', 'standup', 'scrum update', 'status update', 'what did I do yesterday', 'prepare for meeting', 'morning update', or 'team sync'. Pulls activity from GitHub, Jira, and Claude Code session history. Conducts 4-question interview (yesterday, today, blockers, discussion topics) and generates formatted Markdown update.

8k tokens scripts

How to use it

Copy the folder

Take glebis/gmail from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.

Install what it needs

The instructions reference pip. Without those the skill loads but fails at the first command.