
theposch/gmail-mcp
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
Gmail MCP サーバー
概要
Pythonで書かれているGmailの統合のための強力で機能豊富なモデルコンテキストプロトコル(MCP)サーバー。 ClaudeのようなAIアシスタントが自然言語でGmailとやり取りし、包括的なメール管理機能を提供します。 - カスタマイズ可能な件名、コンテンツ、および受信者でメールを送信 - 完全なメタデータでメールコンテンツを読み込み、取得 - 確認でメールをゴミ箱に移動 - マークメールを読み取り/アンレッド - ブラウザで直接メールを開く - 後でレビューのためのドラフトメールを作成する - すべてのドラフトメールをリスト - 既存のドラフトを編集する - すべての利用可能なラベルをリスト - カスタムラベルを作成する - メールからラベルを適用する/削除 - 既存のラベルの名前を変更 - 未使用ラベルを削除 - ラベルで電子メールを検索 - 新しいフォルダ(Gmailラベルとして実装)を作成する - フォルダ間のメールの移動 - 利用可能なすべてのフォルダのリスト - Gmailの高度なクエリ構文を使用してメールを検索 - 電子メールフィルタの作成、管理、削除 - 送信者、受信者、対象、コンテンツによるフィルタリング、およびその他 -...
概要(AI 翻訳)
Pythonで書かれているGmailの統合のための強力で機能豊富なモデルコンテキストプロトコル(MCP)サーバー。 ClaudeのようなAIアシスタントが自然言語でGmailとやり取りし、包括的なメール管理機能を提供します。
✔ キー機能
完全な電子メール管理
- カスタマイズ可能な主題、内容および受取人の電子メールを送って下さい
- フルメタデータでメールコンテンツを読み込み、取得
- 確認でメールをゴミ箱に移動
- 読み込み/未読のメールをマークする
- ブラウザで直接メールを開く
リリース
- 後でレビューのためのドラフトメールを作成する
- すべてのドラフトメールのリスト
- 既存の草案を編集する
️️ 高度なラベル管理
- すべての利用可能なラベルをリスト
- カスタムラベルを作成する
- メールからラベルを適用する/削除
- 既存のラベルの名前を変更する
- 未使用のラベルを削除
- ラベルでメールを検索
📁フォルダ組織
- 新しいフォルダを作成する(Gmailラベルとして実装)
- フォルダ間のメールの移動
- 利用可能なすべてのフォルダのリスト
の強力な検索とフィルタリング
- Gmailの高度なクエリ構文を使用してメールを検索する
- メールフィルタの作成、管理、削除
- 送信者、受取人、被写体、コンテンツなどによるフィルタリング
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
Enhanced Gmail MCP Server
A powerful and feature-rich Model Context Protocol (MCP) server for Gmail integration, written in Python. This server enables AI assistants like Claude to interact with Gmail through natural language, providing comprehensive email management capabilities.
🌟 Key Features
📧 Complete Email Management
- Send emails with customizable subject, content, and recipients
- Read and retrieve email content with full metadata
- Move emails to trash with confirmation
- Mark emails as read/unread
- Open emails directly in browser
📝 Draft Management
- Create draft emails for later review
- List all draft emails
- Edit existing drafts
🏷️ Advanced Label Management
- List all available labels
- Create custom labels
- Apply/remove labels from emails
- Rename existing labels
- Delete unused labels
- Search emails by label
📁 Folder Organization
- Create new folders (implemented as Gmail labels)
- Move emails between folders
- List all available folders
🔍 Powerful Search & Filtering
- Search emails using Gmail’s advanced query syntax
- Create, manage, and delete email filters
- Filter by sender, recipient, subject, content, and more
- Customize search results with flexible parameters
🗄️ Archive Management
- Archive emails (remove from inbox without deleting)
- Batch archive multiple emails matching search criteria
- List all archived emails
- Restore archived emails to inbox
🚀 Getting Started
Prerequisites
- Python 3.12+
- Python MCP SDK >= 2.0
- Google Cloud project with Gmail API enabled
- OAuth 2.0 credentials
Installation
# Clone the repository
git clone https://github.com/theposch/gmail-mcp.git
cd gmail-mcp
# Set up a virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install the package
pip install -e .
Google Cloud Setup
- Create a new Google Cloud project
- Enable the Gmail API
- Configure the OAuth consent screen:
- Select “External” user type
- Add your email as a test user
- Add the scope:
https://www.googleapis.com/auth/gmail/modify
- Create OAuth 2.0 credentials:
- Choose “Desktop app” as the application type
- Download the JSON credentials file
Configuration
Store your credentials securely and specify their location when running the server:
# Example directory structure for credentials
mkdir -p ~/.gmail-mcp
# Move your downloaded credentials file
mv ~/Downloads/client_secret_*.json ~/.gmail-mcp/credentials.json
🔧 Usage
Running with Claude Desktop
Add the following to your Claude Desktop configuration file (typically at ~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
インストール
npx @modelcontextprotocol/inspector uv run /path/to/gmail-mcp/src/gmail/server.py --creds-file-path /path/to/credentials.json --token-path /path/to/tokens.json設定
{
"mcpServers": {
"gmail": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/gmail-mcp",
"run",
"gmail",
"--creds-file-path",
"/absolute/path/to/credentials.json",
"--token-path",
"/absolute/path/to/tokens.json"
]
}
}
}