BG

bastienchabal/gmail-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

0 stars 6 forks 质量 54 趋势 0

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

  1. Clone this repository:

    git clone https://github.com/bastienchabal/gmail-mcp.git
    cd gmail-mcp
    
  2. Set up a virtual environment using uv:

    pip install uv
    uv venv
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
    
  3. Install dependencies:

    uv pip install -e .
    

⚙️ Configuration

Step 1: Authenticate with Google

  1. Go to the Google Cloud Console
  2. Create a new project or select an existing one
  3. Enable Google APIs:
  4. Configure the OAuth consent screen:
    • Select “External” user type
    • Add your email as a test user
    • Add all the scopes of Gmail and Calendar
  5. 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

  1. Create or edit the claude_desktop_config.json file in /Users//Library/Application Support/Claude
  2. Add the following configuration, replacing the placeholders with your actual values:
{
  "mcpServers": {
在 GitHub 查看完整 README

安装

npx -y @smithery/cli install @bastienchabal/gmail-mcp --client claude
新手?先看 mcpskill.org 教程 →

配置

{ "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>" } } } }