### Search Emails using Gmail MCP Server Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/llms-install.md An example JSON payload for searching emails via the Gmail AutoAuth MCP server. It allows specifying a query and the maximum number of results. ```json { "query": "from:sender@example.com after:2024/01/01", "maxResults": 10 } ``` -------------------------------- ### Install and Authenticate Gmail AutoAuth MCP Server Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/llms-install.md This snippet outlines the command-line steps to install and authenticate the Gmail AutoAuth MCP server. It involves creating a Google Cloud project, obtaining OAuth keys, setting up a configuration directory, and running the authentication command. ```bash mkdir -p ~/.gmail-mcp mv gcp-oauth.keys.json ~/.gmail-mcp/ npx @gongrzhe/server-gmail-autoauth-mcp auth ``` -------------------------------- ### Install Gmail AutoAuth MCP Server via Smithery Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md Installs the Gmail AutoAuth MCP server for Claude Desktop using the Smithery CLI. This command automates the installation process. ```bash npx -y @smithery/cli install @gongrzhe/server-gmail-autoauth-mcp --client claude ``` -------------------------------- ### Send Email using Gmail MCP Server Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/llms-install.md An example JSON payload for sending an email via the Gmail AutoAuth MCP server. It includes recipient, subject, body, and optional CC/BCC fields. ```json { "to": ["recipient@example.com"], "subject": "Meeting Tomorrow", "body": "Hi,\n\nJust a reminder about our meeting tomorrow at 10 AM.\n\nBest regards", "cc": ["cc@example.com"], "bcc": ["bcc@example.com"] } ``` -------------------------------- ### Configure Claude Desktop for Gmail MCP Server Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/llms-install.md This JSON configuration is used to integrate the Gmail AutoAuth MCP server into Claude Desktop. It specifies the command and arguments required to run the MCP server. ```json { "mcpServers": { "gmail": { "command": "npx", "args": [ "@gongrzhe/server-gmail-autoauth-mcp" ] } } } ``` -------------------------------- ### Create Newsletter Filter Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/filter-examples.md Example of creating a Gmail filter to manage newsletters by specifying the sender's email, label IDs, and whether to archive the emails. ```Gmail Filter Template: fromSender Parameters: senderEmail, labelIds, archive ``` -------------------------------- ### Handle Promotional Emails Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md Example JSON configuration to handle promotional emails by adding a promotions label and removing them from the inbox and unread status. ```JSON { "criteria": { "query": "unsubscribe OR promotional" }, "action": { "addLabelIds": ["Label_Promotions"], "removeLabelIds": ["INBOX", "UNREAD"] } } ``` -------------------------------- ### Send HTML Email Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md Example of sending an email with HTML content. The 'mimeType' should be set to 'text/html'. ```json { "to": ["recipient@example.com"], "subject": "Meeting Tomorrow", "mimeType": "text/html", "body": "

Meeting Reminder

Just a reminder about our meeting tomorrow at 10 AM.

Best regards

" } ``` -------------------------------- ### Priority Emails from Boss Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md Example JSON configuration to identify and label priority emails from a specific sender, marking them as important. ```JSON { "criteria": { "from": "boss@company.com" }, "action": { "addLabelIds": ["IMPORTANT", "Label_Boss"] } } ``` -------------------------------- ### Send Basic Email Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md Example of sending a plain text email with recipient, subject, and body. Optional CC, BCC, and mimeType can be included. ```json { "to": ["recipient@example.com"], "subject": "Meeting Tomorrow", "body": "Hi,\n\nJust a reminder about our meeting tomorrow at 10 AM.\n\nBest regards", "cc": ["cc@example.com"], "bcc": ["bcc@example.com"], "mimeType": "text/plain" } ``` -------------------------------- ### Send Email with Attachments Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md Example of sending an email that includes file attachments. Specify the file paths in the 'attachments' array. ```json { "to": ["recipient@example.com"], "subject": "Project Files", "body": "Hi,\n\nPlease find the project files attached.\n\nBest regards", "attachments": [ "/path/to/document.pdf", "/path/to/spreadsheet.xlsx", "/path/to/presentation.pptx" ] } ``` -------------------------------- ### Auto-organize Newsletters Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md Example JSON configuration to automatically organize newsletters by adding a specific label and removing it from the inbox. ```JSON { "criteria": { "from": "newsletter@company.com" }, "action": { "addLabelIds": ["Label_Newsletter"], "removeLabelIds": ["INBOX"] } } ``` -------------------------------- ### Send Multipart Email Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md Example of sending a multipart email containing both plain text and HTML versions. Use 'body' for plain text and 'htmlBody' for HTML. ```json { "to": ["recipient@example.com"], "subject": "Meeting Tomorrow", "mimeType": "multipart/alternative", "body": "Hi,\n\nJust a reminder about our meeting tomorrow at 10 AM.\n\nBest regards", "htmlBody": "

Meeting Reminder

Just a reminder about our meeting tomorrow at 10 AM.

Best regards

" } ``` -------------------------------- ### Get or Create Gmail Label Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md Retrieves an existing Gmail label by its name or creates a new one if it does not exist. Supports setting visibility. ```json { "name": "Project XYZ", "messageListVisibility": "show", "labelListVisibility": "labelShow" } ``` -------------------------------- ### Filter Large Attachments Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md Example JSON configuration to filter emails that have attachments larger than a specified size, applying a specific label. ```JSON { "criteria": { "size": 10485760, "sizeComparison": "larger", "hasAttachment": true }, "action": { "addLabelIds": ["Label_LargeFiles"] } } ``` -------------------------------- ### Get Gmail Filter Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md Retrieves the details of a specific Gmail filter using its unique filter ID. ```json { "filterId": "ANe1Bmj1234567890" } ``` -------------------------------- ### Gmail Advanced Search Operators Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md Examples of Gmail's advanced search operators that can be used for filtering emails, including sender, recipient, subject, attachments, dates, and labels. ```Text from:john@example.com to:mary@example.com subject:"meeting notes" has:attachment after:2024/01/01 before:2024/02/01 is:unread label:work from:john@example.com after:2024/01/01 has:attachment ``` -------------------------------- ### Run Evals with Environment Variables Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md This command executes the evals package for the Gmail MCP Server. It loads an MCP client and runs the index.ts file. Environment variables, such as OPENAI_API_KEY, can be set by prefixing the npx command. Ensure you have the necessary keys and paths configured. ```bash OPENAI_API_KEY=your-key npx mcp-eval src/evals/evals.ts src/index.ts ``` -------------------------------- ### Run Gmail Autoauth MCP Server Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md Command to run the server-gmail-autoauth-mcp for authentication in a cloud environment. It requires the callback URL as an argument. ```bash npx @gongrzhe/server-gmail-autoauth-mcp auth https://gmail.gongrzhe.com/oauth2callback ``` -------------------------------- ### Configure MCP Servers in Application Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md Configuration snippet for the application to use the gmail MCP server. It specifies the command and arguments to run the server. ```json { "mcpServers": { "gmail": { "command": "npx", "args": [ "@gongrzhe/server-gmail-autoauth-mcp" ] } } } ``` -------------------------------- ### Configure Gmail MCP Server in Claude Desktop Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md Configuration snippet for integrating the Gmail AutoAuth MCP server into Claude Desktop. This JSON object specifies the command and arguments to run the server. ```json { "mcpServers": { "gmail": { "command": "npx", "args": [ "@gongrzhe/server-gmail-autoauth-mcp" ] } } } ``` -------------------------------- ### Global Authentication for Gmail AutoAuth MCP Server Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md Sets up global authentication for the Gmail AutoAuth MCP server. It involves placing the OAuth keys in a specific directory and running the authentication command. ```bash # First time: Place gcp-oauth.keys.json in your home directory's .gmail-mcp folder mkdir -p ~/.gmail-mcp mv gcp-oauth.keys.json ~/.gmail-mcp/ # Run authentication from anywhere npx @gongrzhe/server-gmail-autoauth-mcp auth ``` -------------------------------- ### Docker Authentication for Gmail AutoAuth MCP Server Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md Authenticates the Gmail AutoAuth MCP server using Docker. This command mounts the OAuth keys and specifies the path for credentials. ```bash docker run -i --rm \ --mount type=bind,source=/path/to/gcp-oauth.keys.json,target=/gcp-oauth.keys.json \ -v mcp-gmail:/gmail-server \ -e GMAIL_OAUTH_PATH=/gcp-oauth.keys.json \ -e "GMAIL_CREDENTIALS_PATH=/gmail-server/credentials.json" \ -p 3000:3000 \ mcp/gmail auth ``` -------------------------------- ### List Email Labels Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md Retrieves a list of all available Gmail labels for the account. ```json {} ``` -------------------------------- ### Create Gmail Label Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md Creates a new label in Gmail. Allows specifying the label name and visibility settings. ```json { "name": "Important Projects", "messageListVisibility": "show", "labelListVisibility": "labelShow" } ``` -------------------------------- ### Docker Usage for Gmail AutoAuth MCP Server Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md Configures the Gmail AutoAuth MCP server for usage with Docker. This JSON object specifies how to run the Docker container and manage credentials. ```json { "mcpServers": { "gmail": { "command": "docker", "args": [ "run", "-i", "--rm", "-v", "mcp-gmail:/gmail-server", "-e", "GMAIL_CREDENTIALS_PATH=/gmail-server/credentials.json", "mcp/gmail" ] } } } ``` -------------------------------- ### Create Gmail Filter from Template Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md Creates a Gmail filter using pre-defined templates for common scenarios, such as filtering by sender or subject. Parameters are specific to the chosen template. ```json { "template": "fromSender", "parameters": { "senderEmail": "notifications@github.com", "labelIds": ["Label_GitHub"], "archive": true } } ``` -------------------------------- ### Local Authentication for Gmail AutoAuth MCP Server Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md Performs local authentication for the Gmail AutoAuth MCP server. The OAuth keys are placed in the current directory and automatically copied to the global configuration. ```bash # Place gcp-oauth.keys.json in your current directory # The file will be automatically copied to global config npx @gongrzhe/server-gmail-autoauth-mcp auth ``` -------------------------------- ### Download Email Attachment Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md Downloads email attachments to a specified local path with an optional custom filename. Requires messageId and attachmentId. ```json { "messageId": "182ab45cd67ef", "attachmentId": "ANGjdJ9fkTs-i3GCQo5o97f_itG...", "savePath": "/path/to/downloads", "filename": "downloaded_document.pdf" } ``` -------------------------------- ### Cloud Server Authentication for Gmail AutoAuth MCP Server Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md Enables authentication for the Gmail AutoAuth MCP server in cloud environments by specifying a custom callback URL. ```bash npx @gongrzhe/server-gmail-autoauth-mcp auth https://gmail.gongrzhe.com/oauth2callback ``` -------------------------------- ### Search Emails Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md Searches for emails using Gmail's search syntax. Allows specifying a query string and the maximum number of results. ```json { "query": "from:sender@example.com after:2024/01/01 has:attachment", "maxResults": 10 } ``` -------------------------------- ### Draft Email with Attachments Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md Creates a draft email without sending it, supporting optional attachments. Includes recipient, subject, body, and CC fields. ```json { "to": ["recipient@example.com"], "subject": "Draft Report", "body": "Here's the draft report for your review.", "cc": ["manager@example.com"], "attachments": ["/path/to/draft_report.docx"] } ``` -------------------------------- ### Create Gmail Filter Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md Creates a new Gmail filter with custom criteria, such as sender or subject, and defines actions like adding or removing labels. ```json { "criteria": { "from": "newsletter@company.com", "hasAttachment": false }, "action": { "addLabelIds": ["Label_Newsletter"], "removeLabelIds": ["INBOX"] } } ``` -------------------------------- ### Gmail Filter Template: Subject Filter Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md A template to filter emails based on their subject line. It allows applying labels and marking emails as read. ```json { "template": "withSubject", "parameters": { "subjectText": "[URGENT]", "labelIds": ["Label_Urgent"], "markAsRead": false } } ``` -------------------------------- ### List Gmail Filters Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md Retrieves all existing Gmail filters associated with the account. This operation does not require any parameters. ```json {} ``` -------------------------------- ### Gmail Filter Template: Content Filter Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md A template to filter emails containing specific text. It supports applying labels and marking emails as important. ```json { "template": "containingText", "parameters": { "searchText": "invoice", "labelIds": ["Label_Finance"], "markImportant": true } } ``` -------------------------------- ### Update Gmail Label Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md Updates an existing Gmail label with new properties like name and visibility settings. ```json { "id": "Label_1234567890", "name": "Urgent Projects", "messageListVisibility": "show", "labelListVisibility": "labelShow" } ``` -------------------------------- ### Batch Modify Emails Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md Efficiently modifies labels for multiple emails in batches. Allows adding and removing labels, and specifies a batch size for processing. ```json { "messageIds": ["182ab45cd67ef", "182ab45cd67eg", "182ab45cd67eh"], "addLabelIds": ["IMPORTANT"], "removeLabelIds": ["INBOX"], "batchSize": 50 } ``` -------------------------------- ### Batch Delete Emails Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md Permanently deletes multiple emails in efficient batches. Requires a list of message IDs and specifies the batch size. ```json { "messageIds": ["182ab45cd67ef", "182ab45cd67eg", "182ab45cd67eh"], "batchSize": 50 } ``` -------------------------------- ### Gmail Filter Template: Mailing List Filter Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md A template to filter emails from mailing lists, identified by a list identifier. It allows applying labels and archiving. ```json { "template": "mailingList", "parameters": { "listIdentifier": "dev-team", "labelIds": ["Label_DevTeam"], "archive": true } } ``` -------------------------------- ### Gmail Filter Template: From Sender Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md A template to filter emails from a specific sender. It can apply labels and archive matching emails. ```json { "template": "fromSender", "parameters": { "senderEmail": "newsletter@company.com", "labelIds": ["Label_Newsletter"], "archive": true } } ``` -------------------------------- ### Modify Email Labels Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md Adds or removes labels from an email, allowing for actions like moving to folders or archiving. Requires messageId and label IDs. ```json { "messageId": "182ab45cd67ef", "addLabelIds": ["IMPORTANT"], "removeLabelIds": ["INBOX"] } ``` -------------------------------- ### Gmail Filter Template: Large Email Filter Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md A template to filter emails that exceed a specified size in bytes. Matching emails can be assigned a label. ```json { "template": "largeEmails", "parameters": { "sizeInBytes": 10485760, "labelIds": ["Label_Large"] } } ``` -------------------------------- ### Gmail Filter Template: Attachment Filter Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md A template to filter all emails that contain attachments. It allows applying a specific label to these emails. ```json { "template": "withAttachments", "parameters": { "labelIds": ["Label_Attachments"] } } ``` -------------------------------- ### Read Email by Message ID Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md Retrieves the content of a specific email using its message ID. The response includes enhanced attachment information. ```json { "messageId": "182ab45cd67ef" } ``` -------------------------------- ### Delete Gmail Label Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md Deletes a specified Gmail label. Requires the label's unique ID. ```json { "id": "Label_1234567890" } ``` -------------------------------- ### Delete Email Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md Permanently deletes an email. Requires the messageId of the email to be deleted. ```json { "messageId": "182ab45cd67ef" } ``` -------------------------------- ### Delete Gmail Filter Source: https://github.com/gongrzhe/gmail-mcp-server/blob/main/README.md Deletes a specific Gmail filter identified by its filter ID. ```json { "filterId": "ANe1Bmj1234567890" } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.