Gmail MCP Server
Enables interaction with Gmail through the Gmail API, allowing users to list, read, search emails, create and send drafts, and get email summaries through natural language commands with OAuth2 authentication.
README
š§ Gmail MCP Server
An MCP server to integrate Gmail with Claude, Cursor, and other MCP clients. Allows AI agents to read, search, draft, and send emails securely.
š Quickstart
Option 1: Remote Usage - Recommended ā
This method requires no local python installation.
Add this to your mcp_config.json:
{
"mcpServers": {
"gmail-remote": {
"url": "https://gmail-mcp-server-fr3d.onrender.com/mcp",
"transport": "sse"
}
}
}
How to use:
- Ask a question (e.g., "Check my email").
- You will get a URL. Click to authorize Google.
- Copy the code and paste it into the chat.
- You are logged in!
Option 2: Local Usage (For Developers)
If you prefer to run the server code locally on your machine.
1. Install Dependencies
cd Gmail-mcp-server
pip install -r requirements.txt
2. Get Google Credentials
- Go to Google Cloud Console.
- Create Project ā Enable Gmail API.
- Credentials ā Create OAuth Client ID ā Desktop App.
- Download JSON ā rename to
credentials.jsonā place in this folder.
3. Authenticate (One-time)
python authenticate.py
This opens your browser for Google login and creates token.json automatically.
4. Configure Editor
Add this to your mcp_config.json:
{
"mcpServers": {
"gmail": {
"command": "python",
"args": ["<ABSOLUTE_PATH_TO_REPO>/server.py"]
}
}
}
Note: Replace <ABSOLUTE_PATH_TO_REPO> with the actual full path to this directory.
Example Config:
<img width="632" height="202" alt="image" src="https://github.com/user-attachments/assets/f051873a-92e7-41be-a8d4-87730280a676" />
š ļø Features
Tools
| Tool | Description |
|---|---|
list_emails |
List/search emails (returns id, snippet, subject, from, date) |
read_email |
Read full email content by ID |
create_draft |
Create a draft email (requires send_draft to actually send) |
send_draft |
Send a drafted email |
Prompts
| Prompt | Description |
|---|---|
summarize_unread |
Summarize unread emails with priority |
draft_reply |
Draft reply to an email |
compose_email |
Compose new email |
search_emails |
Natural language email search |
daily_digest |
Daily email digest by category |
š File Structure
gmail-mcp-server/
āāā server.py # Main MCP server (FastMCP)
āāā gmail_client.py # Gmail API wrapper library
āāā auth.py # OAuth2 & Auth logic
āāā credentials.json # Google App Credentials (YOU PROVIDE)
āāā token.json # User Access Token (GENERATED)
āāā requirements.txt # Python dependencies
š Security
credentials.json: Identifies the application. Low risk if shared, but keep private.token.json: CRITICAL. Contains acts-as-you keys. NEVER SHARE..gitignore: Ensure both JSON files are ignored (default in this repo).
Note:
send_draftsends real emails. Use responsibly.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
E2B
Using MCP to run code via e2b.