DG

diegomaldonadorosas/gmail-mcp

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

4 stars 5 forks 品質 49 トレンド 5

複数のGmailアカウントとGoogleカレンダーをClaude Desktopに接続するローカルモデルコンテキストプロトコル(MCP)サーバー。 マシン上で完全に実行 — 必要なクラウドホスティングなし.

概要

複数のGmailアカウントとGoogleカレンダーをClaude Desktopに接続するローカルモデルコンテキストプロトコル(MCP)サーバー。 マシン上で完全に実行 — 必要なクラウドホスティングなし。 - - 必要に応じて多くのGmailまたはGoogleワークスペースアカウントに接続します - - - Gmailのフルクエリの構文ですべてのアカウントを同時に検索 - - 個々のメッセージとスレッド全体を読みます - - - - 電子メールを構成し、送信するか、任意のアカウントからドラフトを保存します - - - リストラベル、読み込み/未読のマーク、スターメッセージ - - - リストカレンダー、次のイベントを参照し、キーワードで検索 - macOS (macOS 14+ でテスト済み) - Python 3.11 + - Gmail API と Calendar API が有効になっている Google Cloud プロジェクト - Claude Desktop これは仮想環境を作成し、すべてのPythonの依存関係をインストールします。 設定例をコピーし、アカウントに記入します。 アカウントキー(個人、仕事)は、Claude に特定のアカウントとやり取りする際に使用する名前です。 1。 Google Cloud Console 2に移動します.

概要(AI 翻訳)

複数のGmailアカウントとGoogleカレンダーをClaude Desktopに接続するローカルモデルコンテキストプロトコル(MCP)サーバー。 マシン上で完全に実行 — 必要なクラウドホスティングなし。

##特徴

-複数のアカウント — 必要に応じて多くのGmailまたはGoogleワークスペースアカウントに接続 -Unified email search — Gmail のフルクエリ構文で、すべてのアカウントを同時に検索

  • 完全な読み取りアクセス — 個々のメッセージとスレッド全体を読み込む
  • 送信&ドラフト - 電子メールを構成し、送信するか、または任意のアカウントからドラフトを保存します
  • ラベル管理 — リストラベル、読み取り/未読のマーク、スターメッセージ
  • Google Calendar — リストカレンダー、今後のイベントの閲覧、キーワードで検索

要件

  • macOS (macOS 14+ でテスト済み)
  • Python 3.11 +
  • Gmail API と Calendar API が有効になっている Google Cloud プロジェクト(無料)
  • クロードデスクトップ

インストール

##1. リポジトリのクローン化

##2. セットアップスクリプトを実行

これは仮想環境を作成し、すべてのPythonの依存関係をインストールします。

##3. アカウントの構成

設定例をコピーし、アカウントに記入します。

編集 [config.json]:

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

Gmail & Calendar Multi-Account MCP Server

A local Model Context Protocol (MCP) server that connects multiple Gmail accounts and Google Calendars to Claude Desktop. Runs entirely on your machine — no cloud hosting required.

Features

  • Multiple accounts — connect as many Gmail or Google Workspace accounts as you need
  • Unified email search — search across all accounts simultaneously with Gmail’s full query syntax
  • Full read access — read individual messages and entire threads
  • Send & draft — compose and send emails, or save drafts, from any account
  • Label management — list labels, mark as read/unread, star messages
  • Google Calendar — list calendars, browse upcoming events, search by keyword

Requirements

  • macOS (tested on macOS 14+)
  • Python 3.11+
  • A Google Cloud project with the Gmail API and Calendar API enabled (free)
  • Claude Desktop

Installation

1. Clone the repository

git clone https://github.com/DiegoMaldonadoRosas/gmail-mcp.git
cd gmail-mcp

2. Run the setup script

bash setup.sh

This creates a virtual environment and installs all Python dependencies.

3. Configure your accounts

Copy the example config and fill in your accounts:

cp config.json.example config.json

Edit config.json:

{
  "accounts": {
    "personal": {
      "email": "[email protected]",
      "description": "Personal Gmail"
    },
    "work": {
      "email": "[email protected]",
      "description": "Work account"
    }
  },
  "credentials_dir": "./credentials"
}

The account keys (personal, work) are the names you’ll use when asking Claude to interact with a specific account.

4. Get Google OAuth credentials

  1. Go to Google Cloud Console
  2. Create a project and enable both the Gmail API and the Google Calendar API
  3. Go to APIs & Services → Credentials → + Create Credentials → OAuth 2.0 Client ID
  4. Choose Desktop app as the application type
  5. Download the JSON file and save it as credentials/client_secret.json
  6. Go to APIs & Services → OAuth consent screen → Test users and add every email address you configured in config.json

5. Authenticate your accounts

source .venv/bin/activate
python setup_auth.py

A browser window will open for each account. Sign in with the correct Google account. Tokens are saved locally and refreshed automatically — you only need to do this once per account.

Note: If you previously authenticated for Gmail only, you must re-run setup_auth.py after adding Calendar support so the tokens include the new Calendar permissions.

6. Add the server to Claude Desktop

Open ~/Library/Application Support/Claude/claude_desktop_config.json and add:

{
  "mcpServers": {
    "gmail": {
      "command": "/absolute/path/to/gmail-mcp/.venv/bin/python",
      "args": ["/absolute/path/to/gmail-mcp/server.py"]
    }
GitHub で README 全文を見る

インストール

This server does not publish a one-line install command.

Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "gmail": { "command": "/absolute/path/to/gmail-mcp/.venv/bin/python", "args": ["/absolute/path/to/gmail-mcp/server.py"] } } }