Gmail MCP Server
Allows sending emails, creating drafts, and reading Gmail labels 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., "@Gmail MCP ServerSend an email to Sarah about the project update."
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.
Gmail MCP Server
This project provides a set of Gmail tools built with the MCP (Model Context Protocol) framework, allowing AI clients like Claude Desktop to send emails, create drafts, and read Gmail labels through Google's Gmail API. Tools are registered with FastMCP and can be tested via the MCP Inspector or connected directly to Claude Desktop.
Features
π€ Send emails through Gmail
π Create email drafts
π·οΈ Read Gmail labels
Related MCP server: gmail-mcp
Prerequisites
Python 3.10+
uvfor dependency managementMCP CLI (
mcp[cli])Gmail API credentials (
client_secret.json)
Enable Gmail API and Download Credentials
Go to the Google Cloud Console
Create a new project (or use an existing one)
Enable the Gmail API
Configure the OAuth consent screen and add yourself as a test user
Create OAuth 2.0 Client ID credentials with application type Desktop app
Download the
client_secret.jsonfile and place it in the project root
Setup
1. Clone the repository
git clone https://github.com/AsifMarwat/Gmail-mcp.git
cd Gmail-mcp2. Install dependencies
uv syncNote: If you're not using
uv, you can also run:pip install -r requirements.txt
3. Add your credentials
Place your downloaded client_secret.json in the project root. On first run, the app will open a browser window for you to sign in and authorize access β this generates a token.json file that stores your session so you don't need to log in again.
Running the Project
Development (MCP Inspector)
Use this to test your tools directly in the MCP Inspector:
uv run mcp dev main.pyConnect to Claude Desktop
Add the server to your claude_desktop_config.json:
{
"mcpServers": {
"gmail-mcp": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/Gmail-mcp",
"run",
"python",
"main.py"
]
}
}
}Restart Claude Desktop after saving. The Gmail tools will then be available directly in your conversations.
Available Tools
Tool | Description |
| Creates a draft email in Gmail |
| Sends an email directly from Gmail |
| Reads all Gmail label information |
Project Structure
.
βββ main.py # Script defining Gmail tools
βββ client_secret.json # OAuth credentials (keep private, not committed)
βββ token.json # Generated after first login (keep private, not committed)
βββ pyproject.toml # Project dependencies
βββ uv.lock # Locked dependency versions
βββ README.md # Project documentationNotes
The script generates and uses
token.jsonfor storing OAuth tokens after your first authorization.Do not commit
client_secret.jsonortoken.jsonto version control. Both are excluded via.gitignore.This project was built as a learning exercise to understand how MCP servers integrate with the Gmail API and AI clients like Claude Desktop.
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-qualityCmaintenanceProvides a suite of 17 tools for searching, reading, sending, and managing Gmail messages and drafts through the Model Context Protocol. It enables comprehensive email management including label organization, archiving, and attachment handling directly within MCP-compatible clients like Claude.402Apache 2.0
- Flicense-qualityCmaintenanceFull Gmail control for any MCP-compatible AI agent. Exposes ~40 tools for reading, composing, labeling, filtering, threading, and account management.
- Alicense-qualityCmaintenanceEnables interaction with Gmail through 11 tools for email management, including reading, sending, replying, searching, and labeling, with OAuth 2.1 authentication and support for various MCP clients.268MIT
- AlicenseAqualityCmaintenanceConnects multiple Gmail accounts to Claude Desktop via MCP, enabling email search, labeling, drafts, and confirmed sending through natural language.13190MIT
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/AsifMarwat/Gmail-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server