
A Model Context Protocol (MCP) server for Gmail & Google Calendar integration with Claude Desktop, enabling intelligent, context-aware interactions with your email.
概览
A Model Context Protocol (MCP) server for Gmail & Google Calendar integration with Claude Desktop, enabling intelligent, context-aware interactions with your email. - : Provides comprehensive context from entire conversation threads - : Generates responses considering full communication history - : Analyzes email content for calendar events, tasks, and follow-ups - : Detects events in emails and creates calendar entries with natural language support - : Searches across entire email history with semantic understanding - : Adapts to your communication style with specific contacts - Python 3.10+ - A Google Cloud Platform account with Gmail API and Google Calendar API (optional) enabled - OAuth 2.0 credentials for the Gmail API and Google Calendar API (optional) - Claude Desktop with MCP support (currently only LLM interface to support MCP) To install Gmail Integration Server for Claude Desktop automatically via Smithery: 2. Set up a virtual environment using uv: 1.
README
以下为原文 README 节选,完整内容请查看原文。
Gmail MCP Server
A Model Context Protocol (MCP) server for Gmail & Google Calendar integration with Claude Desktop, enabling intelligent, context-aware interactions with your email.
🌟 Features
- Deep Email Analysis: Provides comprehensive context from entire conversation threads
- Context-Aware Responses: Generates responses considering full communication history
- Intelligent Action Suggestions: Analyzes email content for calendar events, tasks, and follow-ups
- Calendar Integration: Detects events in emails and creates calendar entries with natural language support
- Advanced Search: Searches across entire email history with semantic understanding
- Personalization: Adapts to your communication style with specific contacts
🚀 Getting Started
Prerequisites
- Python 3.10+
- A Google Cloud Platform account with Gmail API and Google Calendar API (optional) enabled
- OAuth 2.0 credentials for the Gmail API and Google Calendar API (optional)
- Claude Desktop with MCP support (currently only LLM interface to support MCP)
Installation
Installing via Smithery
To install Gmail Integration Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @bastienchabal/gmail-mcp --client claude
Installing Manually
-
Clone this repository:
git clone https://github.com/bastienchabal/gmail-mcp.git cd gmail-mcp -
Set up a virtual environment using uv:
pip install uv uv venv source .venv/bin/activate # On Windows: .venv\Scripts\activate -
Install dependencies:
uv pip install -e .
⚙️ Configuration
Step 1: Authenticate with Google
- Go to the Google Cloud Console
- Create a new project or select an existing one
- Enable Google APIs:
- Configure the OAuth consent screen:
- Select “External” user type
- Add your email as a test user
- Add all the scopes of Gmail and Calendar
- Create OAuth 2.0 credentials:
- Choose “Desktop app” as the application type
- Download the JSON credentials file and copy the Client ID and Client Secret
Step 2: Configure Claude Desktop
- Create or edit the
claude_desktop_config.jsonfile in/Users//Library/Application Support/Claude - Add the following configuration, replacing the placeholders with your actual values:
{
"mcpServers": {
安装
npx -y @smithery/cli install @bastienchabal/gmail-mcp --client claude配置
{
"mcpServers": {
"gmail-mcp": {
"command": "/<absolute-path>/gmail-mcp/.venv/bin/mcp",
"args": [
"run",
"/<absolute-path>/gmail-mcp/gmail_mcp/main.py:mcp"
],
"cwd": "/<absolute-path>/gmail-mcp",
"env": {
"PYTHONPATH": "/<absolute-path>/gmail-mcp",
"CONFIG_FILE_PATH": "/<absolute-path>/gmail-mcp/config.yaml",
"GOOGLE_CLIENT_ID": "<your-client-id>",
"GOOGLE_CLIENT_SECRET": "<your-client-secret>",
"TOKEN_ENCRYPTION_KEY": "<generate-a-random-key>"
}
}
}
}