YG

ykuchiki/gmail-mcp

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

5 stars 5 forks 品質 74 トレンド 21MIT

MCP server for Gmail API implemented in Python. Enables AI Agents to send, receive, search emails and manage labels in Gmail.

概要

Gmail API for AI assistants using Model Context Protocol English | Español | 日本語 Pull requests to this repository are welcome. Gmail MCP is a server implementation that enables AI assistants to interact with Gmail through the MCP (Model Context Protocol). It provides tools for sending emails, managing drafts, reading emails, searching through your inbox, managing Gmail labels and manageing filters. - ✉️ Send emails and create drafts - 📬 Read and search emails - 🗑️ Delete emails - 🏷️ Manage Gmail labels (create, update, delete) - 🗂️ Manage Gmail filters (create, update, delete) - 🔐 OAuth2.0 authentication with Gmail API - Python 3.11 or higher - Gmail account - Google Cloud Platform project with Gmail API enabled - uv - Python package installer 2. Create and activate a virtual environment 4.

README

以下は原文 README の抜粋です。原文を見る。

Gmail MCP

Gmail API for AI assistants using Model Context Protocol English | Español | 日本語


📋 English Documentation

Pull requests to this repository are welcome.

📖 Table of Contents

🔍 Overview

Gmail MCP is a server implementation that enables AI assistants to interact with Gmail through the MCP (Model Context Protocol). It provides tools for sending emails, managing drafts, reading emails, searching through your inbox, managing Gmail labels and manageing filters.

✨ Features

  • ✉️ Send emails and create drafts
  • 📬 Read and search emails
  • 🗑️ Delete emails
  • 🏷️ Manage Gmail labels (create, update, delete)
  • 🗂️ Manage Gmail filters (create, update, delete)
  • 🔐 OAuth2.0 authentication with Gmail API

📋 Prerequisites

  • Python 3.11 or higher
  • Gmail account
  • Google Cloud Platform project with Gmail API enabled
  • uv - Python package installer

🚀 Setup

  1. Clone this repository
git clone https://github.com/ykuchiki/gmail-mcp.git
cd gmail-mcp
  1. Create and activate a virtual environment
uv init
  1. Install dependencies
uv pip install -r requirements.txt
  1. Set up OAuth credentials

    • Create a directory named credentials in the root of the project
    • Create a project in Google Cloud Console
    • Enable the Gmail API
    • Create OAuth credentials
    • Add the following URI to the Authorized redirect URIs:
      http://localhost:8080/
      
    • Download the credentials JSON file and save it as credentials/client_secret_gmail_oauth.json
  2. Add MCP server Please refer to your MCP client’s official documentation for specific instructions. Make sure to adjust the path according to your environment.

{
    "mcpServers": {
        "gmail-mcp": {
            "command": "uv",
            "args": [
                "--directory",
                "/path/to/your/gmail-mcp/src",
                "run",
                "main.py"
            ]
        }
    }
}
  1. Run the server
uv run main.py
GitHub で README 全文を見る

インストール

This server does not publish a one-line install command.

Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "gmail-mcp": { "command": "uv", "args": [ "--directory", "/path/to/your/gmail-mcp/src", "run", "main.py" ] } } }