LabscoMCP early access ↗
GongRzheMCP SERVER

Gmail AutoAuth MCP Server

Run a Gmail mailbox from an assistant — send with attachments, download attachments to disk, search with Gmail's own operators, and manage labels and filters in batches.

by GongRzhe ↗Email: Mailboxes & DeliveryCommunity

No longer maintained. The GitHub repository for this server is archived — no fixes or security updates are expected.

View project ↗

LABSCO SUMMARY

Inbox work that would take an afternoon, done in one instruction.

The batch and filter tools are what separate it from a send-and-read integration: fifty messages relabelled in one call, or a rule created once so the same class of mail never reaches the inbox again.

What it is

A Gmail integration with an OAuth flow that launches your browser and stores the result globally, so authentication is done once and works from any directory afterwards.

What you get

  • Sending: send_email and draft_email, both taking plain text, HTML or multipart bodies and an attachments array of local file paths, with full support for international characters in subject and body
  • Reading: read_email with MIME structure handling, showing each attachment's filename, type, size and download ID; download_attachment then writes it to a path you choose
  • search_emails using Gmail's own operators — from:, to:, subject:, has:attachment, after:, before:, is: and label:, combinable
  • Organising: modify_email to add and remove labels, delete_email, and the label suite list_email_labels, create_label, update_label, delete_label and get_or_create_label
  • Batches: batch_modify_emails and batch_delete_emails process up to 50 messages at a time with automatic chunking, per-item success reporting and individual retries when a batch item fails
  • Filters: create_filter, list_filters, get_filter, delete_filter, and create_filter_from_template with prebuilt templates for fromSender, withSubject, withAttachments, largeEmails, containingText and mailingList

Requirements

A Google Cloud project with the Gmail API enabled and OAuth 2.0 credentials — Desktop app or Web application both work; for Web, add http://localhost:3000/oauth2callback to the authorized redirect URIs. Rename the downloaded key file to gcp-oauth.keys.json, put it in ~/.gmail-mcp/, and run npx @gongrzhe/server-gmail-autoauth-mcp auth, which opens your browser and saves credentials.json next to it. Then point the client at npx @gongrzhe/server-gmail-autoauth-mcp. Port 3000 must be free during authentication. A Docker image is available, and a custom callback URL can be passed to auth for cloud environments where localhost is not reachable. Gmail's own limit of 25MB per email applies to attachments.

Setup effort

Follow the published steps — In the Google Cloud Console, create a project (or select an existing one) and enable the Gmail API for it.