Email MCP Server
Integrates Gmail with Claude Desktop to fetch unread emails, generate AI-powered draft replies with customizable tone and style guides, and manage your inbox through natural language commands.
README
Email MCP Server
An MCP (Model Context Protocol) server that brings email management capabilities to Claude Desktop. Fetch unread emails, generate AI-powered draft replies, and manage your Gmail inbox using natural language.
Check the docs for more detailed set up instructions and usage examples.
What It Does
This server integrates Gmail with Claude Desktop, allowing you to:
- Fetch unread emails from your Gmail inbox
- Generate contextual draft replies with customizable tone using Claude AI
- Save drafts directly to Gmail with proper email threading
- Send emails via Gmail API
- Interact with your inbox using natural language in Claude Desktop
Features
- OAuth 2.0 Authentication: Secure Google authentication (no app passwords needed)
- AI-Powered Replies: Generate smart email replies using Claude
- Style Guide Integration: Pull email style guides from Google Docs or any URL to ensure consistent messaging
- Email Threading: Maintains conversation threads when replying
- Flexible Tone Control: Choose professional, casual, or friendly tones for replies
- Direct Gmail Integration: Drafts appear in your Gmail Drafts folder
Quick Start
Prerequisites
- Python 3.8+
- Gmail account
- Google Cloud Project with Gmail API enabled (Setup Guide)
- Anthropic API key (Get one here)
- Claude Desktop installed
Installation
-
Clone and install dependencies:
cd email-mcp-server python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt -
Set up Google OAuth 2.0:
Follow the detailed OAuth Setup Guide to:
- Create a Google Cloud Project
- Enable Gmail API
- Configure OAuth consent screen
- Download
credentials.json
-
Authenticate with Gmail:
source venv/bin/activate python gmail_auth.pyThis opens your browser to authorize the app and saves a
token.jsonfile. -
Configure Claude Desktop:
Add to your Claude Desktop config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
{ "mcpServers": { "email": { "command": "/absolute/path/to/email-mcp-server/venv/bin/python", "args": ["/absolute/path/to/email-mcp-server/email_server.py"], "env": { "ANTHROPIC_API_KEY": "sk-ant-api03-..." } } } } - macOS:
-
Restart Claude Desktop
Usage
Once configured, interact with your emails in Claude Desktop using natural language:
- "Show me my unread emails"
- "Generate a professional reply to the first email"
- "Draft a friendly response mentioning the project is on track"
- "Generate a reply using my company style guide at https://docs.google.com/document/d/YOUR_DOC_ID/export?format=txt"
- "Save that reply as a draft in Gmail"
For more examples and workflows, see the Usage Examples Guide and Style Guide Feature Guide.
Available Tools
The server provides four MCP tools that Claude can use:
get_unread_emails
Fetches unread emails from Gmail. Optional parameter: max_emails (default: 10)
generate_draft_reply
Generates AI-powered email replies. Parameters: email_from, email_subject, email_body, email_date, optional tone, additional_context, and style_guide_url
Style Guide Support: Pass a style_guide_url parameter to fetch an external email style guide (e.g., from Google Docs). The AI will follow the style guide when generating replies. For Google Docs, use the export URL format:
https://docs.google.com/document/d/YOUR_DOC_ID/export?format=txt
Style guides are cached for 1 hour to improve performance.
save_draft
Saves draft emails to Gmail. Parameters: to, subject, body, optional in_reply_to for threading
send_email
Sends emails immediately. Parameters: to, subject, body
Documentation
- Google OAuth 2.0 Setup Guide - Step-by-step OAuth configuration with screenshot placeholders
- Usage Examples - Real-world usage examples and workflows with Claude Desktop
- Troubleshooting Guide - Common issues and solutions
Security
- Never commit
credentials.jsonortoken.json(already in.gitignore) - OAuth tokens are stored locally in
token.json - Refresh tokens enable automatic re-authentication
- Revoke access anytime at Google Account Permissions
Development
Run the server manually for testing:
cd email-mcp-server
source venv/bin/activate
python email_server.py
Troubleshooting
For common issues like OAuth errors, permission problems, or Claude Desktop integration issues, see the Troubleshooting Guide.
Quick fixes:
- OAuth issues: Make sure you're added as a test user in Google Cloud Console
- Permission errors: Delete
token.jsonand re-runpython gmail_auth.py - MCP not working: Verify paths are absolute in Claude Desktop config and restart the app
License
MIT License
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。
mcp-server-qdrant
这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。