mcp-google

by Ejb503
Verified

local-only server

The server can only run on the client’s local machine because it depends on local resources.

Integrations

  • Enables AI agents to read, send, manage drafts and attachments, search and filter emails, and handle email threads through MCP commands

  • Allows AI agents to create and manage events, handle event invitations, search and filter calendar events, and manage multiple calendars through MCP commands

  • Provides read-only access to Google Drive content through MCP, allowing AI agents to interact with files and documents

システムプロンプト-mcp-google

ウェブサイト|ドキュメント|ブログ

Google サービス(Gmail、Google カレンダーなど)を AI ワークフローに統合する専用の Model Context Protocol(MCP)サーバーです。このサーバーにより、MCP を介して Google サービスへのシームレスなアクセスが可能になり、AI エージェントが Gmail、Google カレンダー、その他の Google サービスと連携できるようになります。

デモ

YouTubeデモ

前提条件

このサーバーを使用する前に、次のものが必要です。

  1. Systemprompt API キー (無料):
    • systemprompt.io/consoleでサインアップ
    • 新しいAPIキーを作成する
    • サーバーを実行するために必要
  2. MCP 互換クライアントの例:
  3. Google Cloud プロジェクトのセットアップ:
    • Google Cloud アカウント
    • 必要なサービス(Gmail、カレンダーなど)への API アクセスが有効になっています
    • OAuth2 認証情報が設定されている

設定

1. Google Cloud のセットアップ

  1. Google Cloud Consoleでプロジェクトを作成する
  2. 必要な API を有効にします。
    • Gmail API(読み取り、送信、作成、変更、ラベル)
    • Google カレンダー API (イベントの読み取り)
    • Google ドライブ API (読み取り専用)
  3. OAuth2 資格情報を作成します。
    • 「APIとサービス」>「認証情報」に移動します
    • OAuth 2.0クライアントIDを作成する
    • 承認済みリダイレクト URI を設定する ( http://localhost:3333/oauth2callbackを含める)
    • 認証情報 JSON ファイルをダウンロードし、 credentials/google-credentials.jsonとして保存します。

2. サーバー構成

  1. パッケージをインストールします。
npm install systemprompt-mcp-google
  1. 資格情報ディレクトリを作成します。
mkdir -p credentials
  1. 認証スクリプトを実行します。
npm run auth-google

これにより、次のようになります。

  • Google OAuth認証用のデフォルトのブラウザを開きます
  • OAuthコールバックを処理するためにポート3333でローカルサーバーを起動します
  • トークンを生成し、 credentials/google-token.jsonに保存します。
  • 認証が完了すると自動的に閉じます

スクリプトは次の権限を要求します。

  • Gmail: ラベルの閲覧、送信、作成、変更、管理
  • カレンダー: イベントとカレンダーを読む
  • ドライブ: 読み取り専用アクセス

3. MCPクライアントのセットアップ

ご希望の MCP クライアントを選択してください:

Systemprompt MCPクライアントの使用

  1. セットアップ手順に従ってクライアントをインストールして構成します
  2. クライアントの MCP 構成に、次のサーバーを追加します。
{ "servers": { "google": { "type": "stdio", "command": "SYSTEMPROMPT_API_KEY=your_api_key npx systemprompt-mcp-google" } } }

注: your_api_keysystemprompt.io/consoleからの実際の Systemprompt API キーに置き換えます。

Claudeデスクトップの使用

  1. Claude Desktopをインストールする
  2. API キーを使用して、Claude の MCP 構成セクションにこのサーバーを追加します。
    { "command": "SYSTEMPROMPT_API_KEY=your_api_key npx systemprompt-mcp-google" }
  3. stdioモードを使用するように接続を構成する

特徴

Google サービス統合

  • Gmail統合
    • MCP コマンドを使用して電子メールを読み取り、送信する
    • 下書きと添付ファイルを管理する
    • メールの検索とフィルタリング
    • メールスレッドを処理する
  • カレンダー統合
    • MCP コマンドを使用してイベントを作成および管理する
    • イベント招待の取り扱い
    • カレンダーイベントの検索とフィルタリング
    • 複数のカレンダーを管理する

MCP統合

  • 標準MCPインターフェース
    • MCP準拠のクライアントと互換性あり
    • 構造化されたコマンド応答
    • エラー処理とステータスレポート
    • セッション管理

セキュリティと認証

  • 安全なOAuth2認証フロー
  • 自動トークン更新
  • さまざまなサービスへのスコープアクセス
  • 環境ベースの構成

開発機能

  • 完全なTypeScriptサポート
  • 包括的なエラー処理
  • 広範なテスト範囲
  • MCP互換インターフェース

構成

  1. Google Cloud プロジェクトと OAuth2 認証情報を設定します。
    • Google Cloud Consoleでプロジェクトを作成する
    • GmailとカレンダーAPIを有効にする
    • OAuth2認証情報を作成する
    • 資格情報ファイルをダウンロード
  2. 環境変数を設定します。
GOOGLE_CLIENT_ID=your_client_id GOOGLE_CLIENT_SECRET=your_client_secret GOOGLE_REDIRECT_URI=your_redirect_uri
  1. 認証スクリプトを実行します。
npm run auth-google

使用法

MCPクライアントを通じて

設定が完了すると、任意のMCPクライアントからこのサーバーにコマンドを送信できるようになります。インタラクションの例:

Gmailの操作

// Example MCP command structure for sending an email { "command": "gmail.sendEmail", "parameters": { "to": "recipient@example.com", "subject": "Hello from MCP", "body": "This email was sent via MCP!" } } // Example MCP command for listing messages { "command": "gmail.listMessages", "parameters": { "maxResults": 10 } }

カレンダー操作

// Example MCP command for creating an event { "command": "calendar.createEvent", "parameters": { "summary": "Team Meeting", "start": "2024-03-01T10:00:00", "end": "2024-03-01T11:00:00", "attendees": ["team@company.com"] } } // Example MCP command for listing events { "command": "calendar.listEvents", "parameters": { "timeMin": "2024-03-01T00:00:00Z", "maxResults": 10 } }

テスト

このプロジェクトには、MCP プロトコル処理と Google サービス統合の両方に関する包括的なテストが含まれています。

# Run all tests npm test # Watch mode for development npm run test:watch # Generate coverage report npm run test:coverage

MCP通信のデバッグ

MCP サーバーは stdio 経由で通信するため、デバッグには特別な考慮が必要です。

  1. MCP インスペクターを使用します。
npm run inspector
  1. デバッグ ログを有効にする:
# Set environment variable DEBUG=mcp:* npm run dev
  1. 提供されているテスト クライアントを使用します。
npm run test:client

ライセンス

マサチューセッツ工科大学

関連プロジェクト

発達

ローカル開発のセットアップ

  1. リポジトリをクローンします。
git clone https://github.com/yourusername/systemprompt-mcp-google.git cd systemprompt-mcp-google
  1. 依存関係をインストールします:
npm install
  1. 環境変数を設定します。
# Copy example environment file cp .env.example .env # Edit .env and add: SYSTEMPROMPT_API_KEY=your_api_key # Required - get from systemprompt.io/console
  1. Google 認証情報を設定します。
  • Google OAuth認証情報をcredentials/google-credentials.jsonとして保存します。
  • Googleで認証するには、 npm run auth-googleします。
  1. 開発サーバーを起動します:
npm run dev
-
security - not tested
F
license - not found
-
quality - not tested

Google サービス(Gmail、Google カレンダーなど)を AI ワークフローに統合する専用の Model Context Protocol(MCP)サーバーです。このサーバーにより、MCP を介して Google サービスへのシームレスなアクセスが可能になり、AI エージェントが Gmail、Google カレンダー、その他の Google サービスと連携できるようになります。

  1. Demo
    1. Prerequisites
      1. Setup
        1. 1. Google Cloud Setup
        2. 2. Server Configuration
        3. 3. MCP Client Setup
      2. Features
        1. Google Service Integration
        2. MCP Integration
        3. Security & Authentication
        4. Development Features
        5. Configuration
      3. Usage
        1. Through MCP Client
        2. Testing
        3. Debugging MCP Communication
      4. License
        1. Related Projects
          1. Development
            1. Local Development Setup
          ID: 0ixu86x2zs