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.
Works seamlessly with
Explicitly built for autonomous AI agents, not just simple queries.
No manual path mapping. The `npx` wizard detects your OS and AI client, automatically configuring your local JSON.
Features like dry-run `advanced_filter` and bulk `batch_modify_emails` let agents safely manage thousands of emails.
Bring-your-own-credentials. No third-party proxy servers, telemetry, or external data reading. Your data stays on your machine.
20 powerful tools organized into clean categories. From simple searches to complex inbox automation.
Full Gmail query syntax — search by sender, subject, labels, date range, attachments, and more.
Get full email content with headers, body, and attachments. Navigate entire conversation threads.
Send new emails, reply (or reply-all), forward messages, and save drafts — all with proper threading.
Create, delete, apply, and remove labels. Archive, trash, star, and mark as read/unread in bulk.
Advanced filter with dry-run support. Apply actions to hundreds of emails matching complex queries.
Download and read attachment content. Let your AI agent process invoices, receipts, and documents.
Get your email profile and discover your most-contacted addresses from sent mail history.
All data stays on your machine. No external servers, no telemetry. OAuth tokens auto-refresh.
Every tool uses Zod validation, returns structured JSON, and includes descriptive error messages.
search_emailsGmail query search with paginationget_emailFull email with body & attachmentsget_threadAll messages in a threadget_attachmentDownload attachment contentsend_emailSend new emailreply_emailReply or reply-allforward_emailForward with optional notecreate_draftSave as draftmodify_emailAdd/remove labelsbatch_modify_emailsBulk modify (up to 1000)trash_emailMove to trashuntrash_emailRestore from trashbatch_trash_emailsBulk trashmark_spamMark as spamadvanced_filterSearch + bulk actionlist_labelsAll labels with IDscreate_labelCreate nested labeldelete_labelDelete user labelget_profileYour email profileget_frequent_contactsTop contacts from sentGo to Google Cloud Console, create a project, enable Gmail API, and configure your OAuth consent screen with your email as a "Test User".
Create an OAuth Client ID for "Desktop app". Download the JSON and save it as credentials.json in your project folder.
npx gmail-mcp-server setup
Choose your AI client — the wizard auto-configures everything, runs the OAuth flow, and starts the server.
{
"mcpServers": {
"gmail": {
"command": "npx",
"args": ["-y", "gmail-mcp-server"]
}
}
}