Gmail MCP Server
Gmail MCP サーバー
Claude Desktop などの MCP クライアントに Gmail 統合機能を提供する MCP (Model Context Protocol) サーバー。
特徴
Gmail の受信トレイから最近のメールを表示する
Gmailの検索構文を使用してメールを検索する
Gmail API による安全な OAuth2 認証
Related MCP server: Gmail MCP
設定
1. Google Cloud プロジェクトのセットアップ
https://console.cloud.google.com/で Google Cloud プロジェクトを作成します。
Gmail APIを有効にする
OAuth 2.0 認証情報を作成します。
アプリケーションの種類: デスクトップ アプリケーション
資格情報を
credentials.jsonとしてダウンロードします。
2. インストール
# Create a conda environment
conda create -n mcp-gmail python=3.12
conda activate mcp-gmail
# Install the package
cd gmail-mcp-server
pip install -e .3. Claudeデスクトップの設定
claude_desktop_config.jsonに追加します:
{
"mcpServers": {
"gmail": {
"command": "/path/to/conda/envs/mcp-gmail/bin/python",
"args": ["-m", "gmail_mcp_server.server"],
"env": {
"PYTHONPATH": "/path/to/gmail-mcp-server/src",
"GMAIL_CREDENTIALS_FILE": "/path/to/credentials.json",
"GMAIL_TOKEN_FILE": "/path/to/token.json"
}
}
}
}/path/to/を実際のパスに置き換えてください。トークンファイルは初回認証時に自動的に作成されます。
4. 初実行
Claude 経由で初めて Gmail にアクセスしようとすると、ブラウザでアプリケーションの承認を求められます。承認後、認証情報はトークンファイルに保存され、今後使用できるようになります。
利用可能なリソース
gmail://inbox/recent- 最新のメール10件を返します
利用可能なツール
search_emails説明: クエリでGmailメールを検索
パラメータ:
query(必須): Gmail 検索クエリ(Gmail の標準検索構文を使用)max_results(オプション): 返される結果の最大数 (デフォルト: 10)
検索例:
Could you show me any emails from sanrio in the last two days?安全
このサーバーは Gmail による OAuth2 認証を必要とします:
初回使用時にブラウザでアクセスを許可するように求められます
認証情報は指定されたトークンファイルにローカルに保存されます
アクセスはGoogleアカウントの設定からいつでも取り消すことができます
Gmail への読み取りアクセスのみが要求されます (書き込み権限はありません)
環境変数
GMAIL_CREDENTIALS_FILE(必須): Google OAuth 認証情報ファイルへのパスGMAIL_TOKEN_FILE(必須): 認証トークンを保存するパス
テストの場合は、サーバーを直接実行できます。
GMAIL_CREDENTIALS_FILE="/path/to/credentials.json" \
GMAIL_TOKEN_FILE="/path/to/token.json" \
python -m gmail_mcp_server.server発達
サーバーはモデルコンテキストプロトコルを使用して以下を提供します。
最近のメールへのリソースアクセス
メール検索ツールのサポート
安全なOAuth2認証フロー
自動トークン更新
ログ記録
サーバーは、次のような操作に関する詳細情報を stderr に記録します。
サーバー起動情報
認証ステータス
リソースとツールの使用
エラーや問題
貢献
プルリクエストは大歓迎です!以下の点にご注意ください。
新しい機能のドキュメントを更新する
適切なエラー処理を追加する
新機能を使用した OAuth フローのテスト
既存のコードスタイルに従う
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityFmaintenanceServer for Gmail integration in Claude Desktop with auto authentication support. This server enables AI assistants to manage Gmail through natural language interactions.26,6781,165MIT
- Alicense-qualityDmaintenanceA 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.7Apache 2.0
- Alicense-qualityDmaintenanceAn MCP server that enables Gmail integration, allowing users to manage emails (send, receive, read, trash, mark as read) directly through MCP clients like Claude Desktop.1MIT
- AlicenseBqualityFmaintenanceMCP server that connects Claude with Gmail to read, send, delete, and manage messages and labels via the Google Gmail API.3MIT
Related MCP Connectors
Manage Gmail end-to-end: search, read, send, draft, label, and organize threads. Automate workflow…
Manage Gmail messages, threads, labels, drafts, and settings from your workflows. Send and organiz…
Shipmail MCP server for AI agent custom-domain email inboxes with REST API and webhooks.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ajbr0wn/gmail-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server