@kazuph/mcp-gmail-gas

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Integrations

  • Allows Claude Desktop to interact with Gmail accounts through Google Apps Script, enabling capabilities like searching emails, retrieving email content and details, and downloading attachments.

  • Uses Google Apps Script as the backend service to interface with Gmail, requiring users to deploy a script to their Google account that provides the necessary API endpoints for Gmail interaction.

MCP Gmail

Gmail統合用のモデルコンテキストプロトコルサーバー。これにより、Claude Desktop(または任意のMCPクライアント)はGoogle Apps Scriptを介してGmailアカウントとやり取りできるようになります。

クイックスタート(ユーザー向け)

前提条件

  • Node.js 18+ ( brew install nodeでインストール)
  • Gmailアカウント
  • Google Apps Scriptのデプロイメント
  • Claude Desktop ( https://claude.ai/desktopからインストール)

構成

  1. Google Apps Scriptをデプロイする
  • Google Apps Scriptにアクセスして新しいプロジェクトを作成します
  • code.gsの内容全体をコピーし、スクリプトエディタに貼り付けます。
  • 「デプロイ」>「新しいデプロイ」をクリックします
  • 展開タイプとして「Webアプリ」を選択します
  • 次の設定を構成します。
    • 実行者: 私
    • アクセスできるユーザー: 誰でも
    • 「デプロイ」をクリック
  • プロンプトが表示されたら、アプリを確認して Gmail アカウントへのアクセスを許可します。
  • デプロイURLをコピーし、セキュリティのためにランダムなAPIキーを生成します

注: このスクリプトにはGmailへのアクセス権限が必要です。スクリプトを初めてデプロイして実行する際、Googleからこれらの権限の確認と付与を求められます。以下の点にご注意ください。

  1. 「権限を確認」をクリックします
  2. Googleアカウントを選択してください
  3. 警告が表示された場合は「詳細設定」をクリックしてください
  4. [プロジェクト名] に移動 (安全ではありません)」をクリックします。
  5. 「許可」をクリックして、必要なGmail権限を付与します
  6. Claude Desktop 構成ファイルを開きます: ~/Library/Application Support/Claude/claude_desktop_config.json

これは、Claude デスクトップ メニューから見つけることができます。

  1. クロードデスクトップを開く
  2. MacのメニューバーでClaudeをクリック
  3. 「設定」をクリック
  4. 「開発者」をクリック
  5. 設定に以下を追加します。
{ "tools": { "gmail": { "command": "npx", "args": ["-y", "@kazuph/mcp-gmail-gas"], "env": { "GAS_ENDPOINT": "YOUR_DEPLOYMENT_URL", "VALID_API_KEY": "YOUR_API_KEY" } } } }

注: YOUR_DEPLOYMENT_URLYOUR_API_KEY実際の値に置き換えてください。

開発者向け

前提条件

  • Node.js 18+ ( brew install nodeでインストール)
  • Gmailアカウント
  • Google Apps スクリプト
  • Claude Desktop ( https://claude.ai/desktopからインストール)
  • tsx ( npm install -g tsxでインストール)

インストール

git clone https://github.com/kazuph/mcp-gmail-gas.git cd mcp-gmail-gas npm install npm run build

開発構成

  1. Claude Desktop がインストールされ、実行されていることを確認してください。
  2. まだインストールしていない場合は、tsx をグローバルにインストールします。
npm install -g tsx # or pnpm add -g tsx
  1. Claude Desktop の設定を変更してください: ~/Library/Application Support/Claude/claude_desktop_config.json

MCP クライアントの構成に以下を追加します。

{ "tools": { "gmail": { "args": ["tsx", "/path/to/mcp-gmail-gas/index.ts"], "env": { "GAS_ENDPOINT": "YOUR_DEPLOYMENT_URL", "VALID_API_KEY": "YOUR_API_KEY" } } } }

利用可能なツール

  • gmail_search_messages : Gmailの検索クエリ構文を使用してメールを検索します(例: "subject:Meeting newer_than:1d")
  • gmail_get_message : 特定のメールの全内容と詳細を取得します
  • gmail_download_attachment : 特定のメールから添付ファイルをダウンロードする

セキュリティに関する注意事項

VALID_API_KEYは常に秘密にし、バージョン管理にコミットしないでください。このキーは、Google Apps Script の導入を通じて、承認されたクライアントのみが Gmail にアクセスできるようにするために役立ちます。

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

Gmail統合用のモデルコンテキストプロトコルサーバー。これにより、Claude Desktop(または任意のMCPクライアント)はGoogle Apps Scriptを介してGmailアカウントとやり取りできるようになります。

  1. Quick Start (For Users)
    1. Prerequisites
    2. Configuration
  2. For Developers
    1. Prerequisites
    2. Installation
    3. Development Configuration
  3. Available Tools
    1. Security Note
      ID: 7awla69pjq