Skip to main content
Glama
ajbr0wn

Gmail MCP Server

by ajbr0wn

Gmail MCP サーバー

Claude Desktop などの MCP クライアントに Gmail 統合機能を提供する MCP (Model Context Protocol) サーバー。

特徴

  • Gmail の受信トレイから最近のメールを表示する

  • Gmailの検索構文を使用してメールを検索する

  • Gmail API による安全な OAuth2 認証

Related MCP server: Gmail MCP

設定

1. Google Cloud プロジェクトのセットアップ

  1. https://console.cloud.google.com/で Google Cloud プロジェクトを作成します。

  2. Gmail APIを有効にする

  3. 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 フローのテスト

  • 既存のコードスタイルに従う

A
license - permissive license
-
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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

  • A
    license
    -
    quality
    F
    maintenance
    Server for Gmail integration in Claude Desktop with auto authentication support. This server enables AI assistants to manage Gmail through natural language interactions.
    26,678
    1,165
    MIT
  • A
    license
    -
    quality
    D
    maintenance
    A 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.
    7
    Apache 2.0
  • A
    license
    B
    quality
    F
    maintenance
    MCP server that connects Claude with Gmail to read, send, delete, and manage messages and labels via the Google Gmail API.
    3
    MIT

View all related MCP servers

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.

View all MCP Connectors

Latest Blog Posts

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