Allows reading, sending, removing, drafting, and responding to emails through Gmail. Features include retrieving unread emails, marking emails as read, trashing emails, and opening emails in a browser.
Used for creating projects and setting up the OAuth authentication required for Gmail API access.
Gmail Server for Model Context Protocol (MCP)
This MCP server integrates with Gmail to enable sending, removing, reading, drafting, and responding to emails.
Note: This server enables an MCP client to read, remove, and send emails. However, the client prompts the user before conducting such activities.
https://github.com/user-attachments/assets/5794cd16-00d2-45a2-884a-8ba0c3a90c90
Components
Tools
send-email
Sends email to email address recipient
Input:
recipient_id
(string): Email address of addresseesubject
(string): Email subjectmessage
(string): Email content
Returns status and message_id
trash-email
Moves email to trash
Input:
email_id
(string): Auto-generated ID of email
Returns success message
mark-email-as-read
Marks email as read
Input:
email_id
(string): Auto-generated ID of email
Returns success message
get-unread-emails
Retrieves unread emails
Returns list of emails including email ID
read-email
Retrieves given email content
Input:
email_id
(string): Auto-generated ID of email
Returns dictionary of email metadata and marks email as read
open-email
Open email in browser
Input:
email_id
(string): Auto-generated ID of email
Returns success message and opens given email in default browser
Setup
Gmail API Setup
Configure an OAuth consent screen
Select "external". However, we will not publish the app.
Add your personal email address as a "Test user".
Add OAuth scope
https://www.googleapis.com/auth/gmail/modify
Create an OAuth Client ID for application type "Desktop App"
Download the JSON file of your client's OAuth keys
Rename the key file and save it to your local machine in a secure location. Take note of the location.
The absolute path to this file will be passed as parameter
--creds-file-path
when the server is started.
Authentication
When the server is started, an authentication flow will be launched in your system browser.
Token credentials will be subsequently saved (and later retrieved) in the absolute file path passed to parameter --token-path
.
For example, you may use a dot directory in your home folder, replacing [your-home-folder]
.:
Parameter | Example |
|
|
|
|
Usage with Desktop App
Using uv is recommended.
To integrate this server with Claude Desktop as the MCP Client, add the following to your app's server configuration. By default, this is stored as ~/Library/Application\ Support/Claude/claude_desktop_config.json
.
The following parameters must be set
Parameter | Example |
| Absolute path to
directory containing server |
| Absolute path to credentials file created in Gmail API Setup. |
| Absolute path to store and retrieve access and refresh tokens for application. |
Troubleshooting with MCP Inspector
To test the server, use MCP Inspector. From the git repo, run the below changing the parameter arguments accordingly.
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
Integrates with Gmail to enable sending, reading, drafting, and managing emails via the Model Context Protocol (MCP), allowing users to interact with email tasks through automated client prompts.
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityModel Context Protocol server for Gmail integration. This allows Claude Desktop (or any MCP client) to interact with your Gmail account through Google Apps Script.Last updated -2612MIT License
- -securityAlicense-qualityEnables interaction with Gmail and Google Calendar using the MCP protocol, supporting multiple Google accounts, email management, and calendar operations through natural language.Last updated -13MIT License
- -securityAlicense-qualityProvides comprehensive Gmail integration with LLM processing capabilities, allowing users to read, search, filter emails and handle attachments through the Model Context Protocol.Last updated -51MIT License
- -securityAlicense-qualityMCP server that integrates with Gmail to enable sending, reading, and managing emails through tools like send-email, trash-email, get-unread-emails, and read-email.Last updated -60GPL 3.0