
paulfidika/gmail-mcp-server
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
Gmailでやりとりするための単一ファイルMCP-server。 Claudeデスクトップとカーザーで動作します.
概要
AIエージェントがGmailスレッドを検索したり、メールライティングスタイルを理解したり、メールのドラフトを作成したりできるMCPサーバーです。 1。 Google Cloud Console 2に移動します。 トップ3で「プロジェクトを選択」ドロップダウンをクリックします。 「新規プロジェクト」4をクリックします。 プロジェクト名(例「Gmail MCP Server」)5 をクリックします。 1。 あなたの新しいプロジェクトでは、「API&サービス」→「ライブラリ」2に移動します。 「Gmail API」の検索 3. 「Gmail API」をクリックし、「Enable」をクリックします。 1. 「APIとサービス」→「認証」→「認証」→「認証」→「OAuthクライアントID」3をクリックします。 プロンプトが表示された場合、OAuth 同意画面の設定: - [外部] ユーザタイプ - 必須フィールドに記入 (アプリ名、ユーザーサポートメール、開発者メール) - 「テストユーザー」セクションにメールを追加 - すべてのステップで保存して続行します 4. クレデンシャルに戻り、「クレデンシャルの作成」→「OAuth Client ID」5をクリックします。アプリケーションタイプ6で「デスクトップアプリケーション」を選択します。 お名前(例:「Gmail MCP Client」)7 をクリックします.
概要(AI 翻訳)
AIエージェントがGmailスレッドを検索したり、メールライティングスタイルを理解したり、メールのドラフトを作成したりできるMCPサーバーです。
#1. Google認証の取得
ステップ1:Googleクラウドプロジェクトを作成する
1。 Googleクラウドコンソールに行く 2. 「プロジェクトを選択」ドロップダウンをクリックします。 3. 「新規プロジェクト」をクリック 4. プロジェクト名(例「Gmail MCP Server」)を入力してください。 5. 「作成」をクリック
ステップ2:Gmail APIを有効にする
- 新規プロジェクトで「API&サービス」→「ライブラリ」に移動
- 「Gmail API」で検索
- 「Gmail API」をクリックし、「有効」をクリックします。
ステップ3: OAuth2認証情報を作成する
- 「APIとサービス」→「認証」に移動
- 「認証」→「OAuth Client ID」をクリック
- プロンプトが表示された場合、OAuth 同意画面を設定します。
- 「外部」ユーザータイプを選択してください
- 必須項目を入力してください(アプリ名、ユーザーサポートメール、開発者メール)
- 「テストユーザー」セクションにメールを追加する
- すべてのステップで保存して続行する
- 認証情報に戻り、「認証」→「OAuth Client ID」をクリックします。
- アプリケーションタイプとして「デスクトップアプリケーション」を選択します
- お名前(例:「Gmail MCP Client」)を入力してください。
- 「作成」をクリック
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
Gmail MCP Server
An MCP server that lets AI agents search Gmail threads, understand your email writing style, and create draft emails.
1. Get Google Authentication
Step 1: Create a Google Cloud Project
- Go to Google Cloud Console
- Click “Select a project” dropdown at the top
- Click “New Project”
- Enter a project name (e.g., “Gmail MCP Server”)
- Click “Create”
Step 2: Enable Gmail API
- In your new project, go to “APIs & Services” → “Library”
- Search for “Gmail API”
- Click on “Gmail API” and click “Enable”
Step 3: Create OAuth2 Credentials
- Go to “APIs & Services” → “Credentials”
- Click “Create Credentials” → “OAuth Client ID”
- If prompted, configure the OAuth consent screen:
- Choose “External” user type
- Fill in required fields (App name, User support email, Developer email)
- Add your email to “Test users” section
- Save and continue through all steps
- Back in Credentials, click “Create Credentials” → “OAuth Client ID”
- Choose “Desktop application” as the application type
- Enter a name (e.g., “Gmail MCP Client”)
- Click “Create”
- Important: Copy the Client ID and Client Secret from the confirmation dialog (you’ll need these for configuration)
Step 4: Grant OAuth Scopes
When you first run the server, it will open your browser for authorization. The server requests only these minimal permissions:
What We Request:
-
✅ Gmail Readonly Access (
gmail.readonly)- Search and read your email messages
- Download email attachments
- View email metadata (subjects, senders, dates)
-
✅ Gmail Compose Access (
gmail.compose)- Create email drafts
- Update existing drafts
- Delete drafts
- Send emails (permission granted but not used by this server)
What This Server Actualy Implements:
- ✅ Search and read emails - Full search capabilities
- ✅ Extract attachment text - Safe PDF/DOCX/TXT text extraction
- ✅ Create/update drafts - Smart draft management with thread awareness
- ❌ Send emails - Server doesn’t implement sending (though permission is granted)
- ❌ Delete emails - Server doesn’t implement deletion
- ❌ Modify labels - Server doesn’t implement label management
2. Add to MCP Clients
Build the server first: go build .
You’ll want to add this to your agent’s configuration file:
{
"mcpServers": {
"gmail": {
"command": "C:/path/to/your/auto-gmail.exe",
"env": {
"GMAIL_CLIENT_ID": "your_client_id_here.apps.googleusercontent.com",
"GMAIL_CLIENT_SECRET": "your_client_secret_here",
"OPENAI_API_KEY": "your_openai_api_key_here"
}
}
}
}
⚡ Persistent HTTP Mode (Recommended to Avoid OAuth Popups)
Problem: In stdio mode, Cursor starts a fresh server process each time (and for each tab), causing OAuth popup spam.
インストール
This server does not publish a one-line install command.
Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →設定
{
"mcpServers": {
"gmail": {
"command": "C:/path/to/your/auto-gmail.exe",
"env": {
"GMAIL_CLIENT_ID": "your_client_id_here.apps.googleusercontent.com",
"GMAIL_CLIENT_SECRET": "your_client_secret_here",
"OPENAI_API_KEY": "your_openai_api_key_here"
}
}
}
}