Documentation Index
Fetch the complete documentation index at: https://mintlify.com/dvlpjrs/guMCP/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Gmail server enables AI agents to interact with Gmail emails. It provides tools for searching, reading, and sending emails, as well as managing email labels.Prerequisites
- Python 3.11+
- A Google Cloud Project with Gmail API enabled
- OAuth 2.0 credentials with the scope:
https://www.googleapis.com/auth/gmail.modify
Authentication
Setup OAuth Credentials
- Create a new Google Cloud project
- Enable the Gmail API
- Configure an OAuth consent screen
- Add OAuth scope:
https://www.googleapis.com/auth/gmail.modify - Create an OAuth Client ID for “Desktop App”
- Download the credentials JSON and save as
local_auth/oauth_configs/gmail/oauth.json
Authenticate
Available Tools
read_emails
read_emails
Description: Search and read emails in GmailParameters:Returns: List of matching emails with metadata (subject, sender, date, status, labels)
query(string, required): Gmail search query (e.g., “from:someone@example.com” or “subject:important”)max_results(integer, optional): Maximum number of emails to return (default: 10)
send_email
send_email
Description: Send an email through GmailParameters:Returns: Confirmation with message ID
to(string, required): Recipient email addresssubject(string, required): Email subjectbody(string, required): Email body (plain text)cc(string, optional): CC recipients (comma separated)bcc(string, optional): BCC recipients (comma separated)
update_email
update_email
Description: Update email labels (mark as read/unread, move to folders)Parameters:Returns: Confirmation with updated label list
email_id(string, required): The email ID to modifyadd_labels(array, optional): Labels to add (e.g., [“INBOX”, “STARRED”, “IMPORTANT”])remove_labels(array, optional): Labels to remove (e.g., [“UNREAD”])
Resources
The Gmail server provides access to email resources:List Resources
Lists recent unread emails from your inbox (up to 10 at a time). URI Format:gmail:///{message_id}
Read Resource
Reads the full content of a specific email, including:- Headers (From, To, Date, Subject)
- Email body (plain text)
- Metadata
Usage Examples
Searching Emails
Sending Emails
Managing Email Labels
Gmail Search Syntax
Thequery parameter supports Gmail’s powerful search operators:
| Operator | Description | Example |
|---|---|---|
from: | Sender | from:john@example.com |
to: | Recipient | to:jane@example.com |
subject: | Subject line | subject:invoice |
is:unread | Unread emails | is:unread |
is:read | Read emails | is:read |
has:attachment | Has attachments | has:attachment |
after: | Date range | after:2024/01/01 |
before: | Date range | before:2024/12/31 |
label: | Has label | label:important |
- | Exclude | -from:spam@example.com |
Gmail Labels
Common Gmail labels you can use withupdate_email:
INBOX- InboxUNREAD- UnreadSTARRED- StarredIMPORTANT- ImportantSENT- SentDRAFT- DraftSPAM- SpamTRASH- Trash
Running the Server
Local Development
Best Practices
- Use specific queries: Narrow searches with operators to reduce results
- Respect rate limits: Gmail API has quotas - be mindful of bulk operations
- Email IDs: Store email IDs returned from searches for later operations
- Plain text: Currently only plain text email bodies are supported
API Reference
| Tool | Purpose | Common Use Cases |
|---|---|---|
read_emails | Search emails | Find specific messages, monitor inbox |
send_email | Send emails | Automated responses, notifications |
update_email | Manage labels | Mark as read, archive, star |