Gmail MCP サーバー
Claude Desktop などの MCP クライアントに Gmail 統合機能を提供する MCP (Model Context Protocol) サーバー。
特徴
- Gmail の受信トレイから最近のメールを表示する
- Gmailの検索構文を使用してメールを検索する
- Gmail API による安全な OAuth2 認証
設定
1. Google Cloud プロジェクトのセットアップ
- https://console.cloud.google.com/で Google Cloud プロジェクトを作成します。
- Gmail APIを有効にする
- OAuth 2.0 認証情報を作成します。
- アプリケーションの種類: デスクトップ アプリケーション
- 資格情報を
credentials.json
としてダウンロードします。
2. インストール
3. Claudeデスクトップの設定
claude_desktop_config.json
に追加します:
/path/to/
を実際のパスに置き換えてください。トークンファイルは初回認証時に自動的に作成されます。
4. 初実行
Claude 経由で初めて Gmail にアクセスしようとすると、ブラウザでアプリケーションの承認を求められます。承認後、認証情報はトークンファイルに保存され、今後使用できるようになります。
利用可能なリソース
gmail://inbox/recent
- 最新のメール10件を返します
利用可能なツール
search_emails
- 説明: クエリでGmailメールを検索
- パラメータ:
query
(必須): Gmail 検索クエリ(Gmail の標準検索構文を使用)max_results
(オプション): 返される結果の最大数 (デフォルト: 10)
検索例:
安全
このサーバーは Gmail による OAuth2 認証を必要とします:
- 初回使用時にブラウザでアクセスを許可するように求められます
- 認証情報は指定されたトークンファイルにローカルに保存されます
- アクセスはGoogleアカウントの設定からいつでも取り消すことができます
- Gmail への読み取りアクセスのみが要求されます (書き込み権限はありません)
環境変数
GMAIL_CREDENTIALS_FILE
(必須): Google OAuth 認証情報ファイルへのパスGMAIL_TOKEN_FILE
(必須): 認証トークンを保存するパス
テストの場合は、サーバーを直接実行できます。
発達
サーバーはモデルコンテキストプロトコルを使用して以下を提供します。
- 最近のメールへのリソースアクセス
- メール検索ツールのサポート
- 安全なOAuth2認証フロー
- 自動トークン更新
ログ記録
サーバーは、次のような操作に関する詳細情報を stderr に記録します。
- サーバー起動情報
- 認証ステータス
- リソースとツールの使用
- エラーや問題
貢献
プルリクエストは大歓迎です!以下の点にご注意ください。
- 新しい機能のドキュメントを更新する
- 適切なエラー処理を追加する
- 新機能を使用した OAuth フローのテスト
- 既存のコードスタイルに従う
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
Claude Desktop に Gmail へのアクセスを提供する統合サーバー。これにより、ユーザーは自然言語コマンドを使用して最近のメールを表示したり、Gmail の受信トレイを検索したりできるようになります。
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityModel Context Protocol server for Gmail integration. This allows Claude Desktop (or any MCP client) to interact with your Gmail account through Google Apps Script.Last updated -378JavaScriptMIT License
- -securityAlicense-qualityServer for Gmail integration in Claude Desktop with auto authentication support. This server enables AI assistants to manage Gmail through natural language interactions.Last updated -57,424283JavaScriptMIT License
- -securityAlicense-qualityAn email assistant server that connects Claude Desktop to notmuch email databases, allowing users to search emails, view threads, compose new messages, and reply to conversations with markdown formatting.Last updated -2PythonMozilla Public License 2.0
- -securityAlicense-qualityA server that allows Claude to search and retrieve emails from your Gmail account, supporting functions like searching emails, retrieving full content of specific emails, and listing recent messages.Last updated -2PythonApache 2.0