Gmail MCP Server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| GMAIL_MCP_DIR | No | Base directory for credentials lookup | process.cwd() |
| GMAIL_CREDENTIALS_PATH | No | Path to your OAuth credentials file | ./credentials.json |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| search_emailsA | Search Gmail using Gmail query syntax (e.g. 'from:alice@example.com', 'is:unread', 'subject:invoice'). Returns message summaries. |
| get_emailB | Get the full content of an email by its ID, including body text and attachment info. |
| get_threadB | Get all messages in an email thread by thread ID. |
| send_emailC | Compose and send a new email. |
| reply_emailA | Reply to an existing email. Automatically sets In-Reply-To and References headers and keeps the thread. |
| forward_emailB | Forward an existing email to new recipients, optionally adding a note above the original message. |
| create_draftA | Create a draft email (not sent). Optionally attach it to an existing thread for a draft reply. |
| modify_emailB | Modify a single email: add/remove labels, mark as read/unread, archive, or move to trash. |
| batch_modify_emailsA | Apply the same label modifications to multiple emails at once (up to 1000 IDs). |
| trash_emailA | Move an email to Trash (recoverable for 30 days). |
| untrash_emailB | Restore an email from Trash back to the inbox. |
| batch_trash_emailsA | Move multiple emails to Trash at once by adding the TRASH label and removing INBOX. |
| mark_spamB | Mark one or more emails as spam (moves to Spam folder). |
| advanced_filterA | Search emails with multiple criteria and optionally apply a bulk action to all matching results. Useful for inbox cleanup, bulk labeling, or archiving by rule. |
| list_labelsA | List all Gmail labels (system and user-created), including their IDs needed for modify operations. |
| create_labelB | Create a new Gmail label (folder). |
| delete_labelA | Delete a user-created Gmail label. System labels (INBOX, SENT, etc.) cannot be deleted. |
| extract_addressesB | Extract unique email addresses from messages matching a Gmail query. Useful for building contact lists. |
| format_emailsA | Re-format and filter a list of email objects (previously fetched) into a custom structure. Supports field selection, filtering by field value, and sorting. |
| get_attachmentA | Download an email attachment by message ID and attachment ID. Returns base64-encoded content with metadata. Use get_email first to find attachment IDs. |
| get_profileA | Get the authenticated user's Gmail profile: email address, total messages, total threads, and history ID. |
| get_frequent_contactsB | Analyze recent sent emails to find your most frequently contacted email addresses. No extra API scope needed. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/neutral-Stage/gmail-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server