mcp-gmail
Provides tools for reading unread messages, retrieving email threads, and creating draft replies within Gmail accounts through the Gmail API.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-gmailcreate a draft reply to my latest unread email"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-gmail
A toy demo of an MCP server that can write you some nifty draft emails
https://github.com/user-attachments/assets/2dcba8aa-81c5-4098-bccd-d07a6324be7c
Requirements
uv
claude desktop
a google workspace setup with desktop application access for the Gmail API (steps Setup Your Environment through Authorize Credentials For a Desktop Application) with
gmail.readonlyandgmail.composescopes
Related MCP server: Gmail MCP Server
Example claude_desktop_config.json
{
"mcpServers": {
"email": {
"command": "uv",
"args": ["--directory", "/your/path/to/mcp-gmail", "run", "main.py"]
},
"preferences": {
"quickEntryShortcut": "off"
}
}Getting started in Claude Desktop
Clone the repo,
Add the MCP server to your
claude_desktop_config.json(see above)Quit and restart the application
The MCP server should run via the
stdiotransport locally; you can check it's enabled in the 'connectors' section of the prompt (click the+icon)
What The Server Does
This repository implements a Gmail automation server using FastMCP and the Google Gmail API. The gmail.py file contains a Gmail class that handles authentication with the Gmail API and provides methods for interacting with Gmail, such as get_unread_messages to retrieve unread emails, get_thread to fetch an entire email thread, and create_draft to compose a draft reply within a specific thread. The models.py file defines Pydantic models for structuring Gmail message data, ensuring data integrity and type safety when interacting with the dynamic Gmail API responses. The main.py file sets up a FastMCP server, exposing the Gmail functionalities as callable tools: get_unread_emails, get_email_thread, and create_draft_reply. This allows external clients to interact with Gmail programmatically through a well-defined API, enabling automated email processing and drafting. The server is designed to run locally, authenticating users and performing actions on their behalf.
Notes
I was using Claude Desktop, and my original plan was to use MCP Sampling, but Claude Desktop does not appear to support sampling; instead we just expose the tools needed to draft an email
AuthN/AuthZ through MCP clients/servers feels somewhat complex; this just has the app deal with it when it spins up.
The messages returned by the Gmail API are unread, but don't appear to have guaranteed ordering: the first message returned might not be the most recent message. This is likely to be undesired behaviour.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceEnables interaction with Gmail through the Gmail API to read, send, and manage emails. Supports multiple Gmail accounts with real-time monitoring and advanced features for email search and attachment handling.Last updated17Apache 2.0
- Flicense-qualityDmaintenanceEnables interaction with Gmail through the Gmail API with OAuth2 authentication. Supports reading, sending, searching emails, and managing read status through natural language.Last updated
- AlicenseCqualityDmaintenanceEnables comprehensive Gmail management through the Gmail API, including sending/receiving emails, organizing labels and threads, managing drafts, and configuring account settings with secure OAuth2 authentication.Last updated641,7191MIT
- Alicense-quality-maintenanceEnables AI assistants to interact with Gmail through natural language, supporting email sending/reading, searching, draft management, label organization, and batch operations with secure OAuth authentication.Last updated
Related MCP Connectors
Manage Gmail end-to-end: search, read, send, draft, label, and organize threads. Automate workflow…
Manage Gmail messages, threads, labels, drafts, and settings from your workflows. Send and organiz…
Read, search, send, organize, draft and schedule email across your inboxes from any MCP client.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/martingaston/mcp-gmail'
If you have feedback or need assistance with the MCP directory API, please join our Discord server