Open Source · MIT License · 20 Tools

Gmail meets AI Agents

The most powerful open-source MCP server for Gmail. Search, read, compose, and organize your email — all through Claude, Cursor, and any MCP-compatible AI agent.

Terminal
$
View on GitHub →

Works seamlessly with

Claude Desktop
Claude Code
Cursor
Windsurf
Any MCP Client

Why choose this MCP?

Explicitly built for autonomous AI agents, not just simple queries.

Zero-Config Setup

No manual path mapping. The `npx` wizard detects your OS and AI client, automatically configuring your local JSON.

🤖

Agent-First Tools

Features like dry-run `advanced_filter` and bulk `batch_modify_emails` let agents safely manage thousands of emails.

🏠

100% Local & Private

Bring-your-own-credentials. No third-party proxy servers, telemetry, or external data reading. Your data stays on your machine.

Everything your AI agent needs

20 powerful tools organized into clean categories. From simple searches to complex inbox automation.

🔍

Smart Search

Full Gmail query syntax — search by sender, subject, labels, date range, attachments, and more.

📖

Read & Thread

Get full email content with headers, body, and attachments. Navigate entire conversation threads.

✉️

Compose & Reply

Send new emails, reply (or reply-all), forward messages, and save drafts — all with proper threading.

🏷️

Labels & Organize

Create, delete, apply, and remove labels. Archive, trash, star, and mark as read/unread in bulk.

Bulk Actions

Advanced filter with dry-run support. Apply actions to hundreds of emails matching complex queries.

📎

Attachments

Download and read attachment content. Let your AI agent process invoices, receipts, and documents.

👤

Profile & Contacts

Get your email profile and discover your most-contacted addresses from sent mail history.

🔒

Secure & Local

All data stays on your machine. No external servers, no telemetry. OAuth tokens auto-refresh.

20 tools at your fingertips

Every tool uses Zod validation, returns structured JSON, and includes descriptive error messages.

Search & Read

search_emailsGmail query search with pagination
get_emailFull email with body & attachments
get_threadAll messages in a thread
get_attachmentDownload attachment content

Compose

send_emailSend new email
reply_emailReply or reply-all
forward_emailForward with optional note
create_draftSave as draft

Organize

modify_emailAdd/remove labels
batch_modify_emailsBulk modify (up to 1000)
trash_emailMove to trash
untrash_emailRestore from trash
batch_trash_emailsBulk trash
mark_spamMark as spam
advanced_filterSearch + bulk action

Labels & Profile

list_labelsAll labels with IDs
create_labelCreate nested label
delete_labelDelete user label
get_profileYour email profile
get_frequent_contactsTop contacts from sent

Set up in 3 steps

1

Google Cloud Setup

Go to Google Cloud Console, create a project, enable Gmail API, and configure your OAuth consent screen with your email as a "Test User".

2

Download Credentials

Create an OAuth Client ID for "Desktop app". Download the JSON and save it as credentials.json in your project folder.

3

Run the Magic Command

npx gmail-mcp-server setup

Choose your AI client — the wizard auto-configures everything, runs the OAuth flow, and starts the server.

~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "gmail": {
      "command": "npx",
      "args": ["-y", "gmail-mcp-server"]
    }
  }
}