MCP Google Workspace Server
MCP Google Workspace サーバー
Google Workspace サービス用のモデルコンテキストプロトコル(MCP)サーバー。このサーバーは、MCP プロトコルを介して Gmail や Google カレンダーと連携するためのツールを提供します。
特徴
複数のGoogleアカウントのサポート
複数の Google アカウントの使用と切り替え
各アカウントにはカスタムメタデータと説明を設定できます
Gmail統合
高度な検索でメールを検索する
メールの全文と添付ファイルを読む
下書きの作成と管理
メールに返信する
メールをアーカイブする
ハンドルアタッチメント
一括操作のサポート
カレンダー統合
利用可能なカレンダーを一覧表示する
カレンダーイベントを表示
新しいイベントを作成する
イベントを削除する
複数のカレンダーのサポート
カスタムタイムゾーンのサポート
Related MCP server: mcp-gsuite
プロンプトの例
AI アシスタントで次のサンプルプロンプトを試してください。
Gメール
「最新の未読メッセージを取得する」
「スクラムマスターからのメールを検索する」
「経理部からすべてのメールを取得する」
「ABCについてのメールを要約してください」
「アリスの最後のメールに素敵な返信を書いて、下書きをアップロードしてください」
「ボブのメールにお礼のメッセージを添えて返信します。下書きとして保存します。」
カレンダー
「明日の予定は何だろう?」
「来週の私のプライベートアカウントのファミリー予定を確認してください」
「来週、ティムと2時間のイベントを計画する必要があります。時間帯を提案してください。」
前提条件
Node.js >= 18
Gmail とカレンダー API が有効になっている Google Cloud プロジェクト
Google API の OAuth 2.0 認証情報
インストール
リポジトリをクローンします。
git clone https://github.com/j3k0/mcp-google-workspace.git cd mcp-google-workspace依存関係をインストールします:
npm installTypeScript コードをビルドします。
npm run build
構成
OAuth 2.0 のセットアップ
Google Workspace(G Suite)API には OAuth2 認証が必要です。認証を設定するには、以下の手順に従ってください。
OAuth2 資格情報を作成する:
Google Cloud Consoleにアクセスします
新しいプロジェクトを作成するか、既存のプロジェクトを選択してください
プロジェクトで Gmail API と Google カレンダー API を有効にする
「認証情報」→「認証情報の作成」→「OAuthクライアントID」に移動します
アプリケーションの種類として「デスクトップアプリ」または「Webアプリケーション」を選択します
必要な情報を入力してOAuth同意画面を設定する
承認されたリダイレクト URI を追加します (ローカル開発の場合は
http://localhost:4100/codeを含めます)
必要な OAuth2 スコープ:
[ "openid", "https://mail.google.com/", "https://www.googleapis.com/auth/calendar", "https://www.googleapis.com/auth/userinfo.email" ]Google OAuth 2.0 認証情報を使用して、プロジェクト ルートに
.gauth.jsonファイルを作成します。{ "installed": { "client_id": "your_client_id", "project_id": "your_project_id", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "token_uri": "https://oauth2.googleapis.com/token", "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "client_secret": "your_client_secret", "redirect_uris": ["http://localhost:4100/code"] } }サーバーを使用できる Google アカウントを指定するには、
.accounts.jsonファイルを作成します。{ "accounts": [ { "email": "your.email@gmail.com", "account_type": "personal", "extra_info": "Primary account with Family Calendar" } ] }複数のアカウントを指定できます。Google Auth アプリでアカウントにアクセス権があること
extra_info確認してください。extra_info フィールドは特に便利で、アカウントについて AI に伝えたい情報(特定のカレンダーがあるかどうかなど)を追加できます。
クロードデスクトップ構成
Claude Desktop を mcp-google-workspace サーバーを使用するように構成します。
MacOSの場合: ~/Library/Application\ Support/Claude/claude_desktop_config.jsonを編集します。
Windowsの場合: %APPDATA%/Claude/claude_desktop_config.jsonを編集します。
{
"mcpServers": {
"mcp-google-workspace": {
"command": "<dir_to>/mcp-google-workspace/launch"
}
}
}{
"mcpServers": {
"mcp-google-workspace": {
"command": "npx",
"args": [
"mcp-google-workspace"
]
}
}
}使用法
サーバーを起動します。
npm startオプションの引数:
--gauth-file: OAuth2 資格情報ファイルへのパス (デフォルト: ./.gauth.json)--accounts-file: アカウント設定ファイルへのパス (デフォルト: ./.accounts.json)--credentials-dir: OAuth 認証情報を保存するディレクトリ (デフォルト: 現在のディレクトリ)
サーバーが起動し、stdin/stdout 経由で MCP コマンドをリッスンします。
各アカウントの初回実行時には次のようになります。
OAuth2認証用のブラウザウィンドウを開く
OAuth2コールバックをポート4100でリッスンする
将来使用するために、資格情報を
.oauth2.{email}.jsonという名前のファイルに保存します。
利用可能なツール
アカウント管理
gmail_list_accounts/calendar_list_accounts設定されているすべてのGoogleアカウントを一覧表示する
アカウントのメタデータと説明を表示する
ユーザーIDは不要です
Gmailツール
gmail_query_emailsGmail のクエリ構文を使用してメールを検索します (例: 'is:unread'、'from: example@gmail.com '、'newer_than:2d'、'has:attachment')
メールを逆時系列で返します
メタデータとコンテンツの概要が含まれています
gmail_get_emailIDでメールの全コンテンツを取得する
メッセージ本文と添付ファイルの全情報が含まれます
gmail_bulk_get_emails1回のリクエストでID別に複数のメールを取得する
バッチ処理に効率的
gmail_create_draft新しいメールの下書きを作成する
CC受信者のサポート
gmail_delete_draftIDで下書きメールを削除する
gmail_reply既存のメールに返信する
すぐに送信するか下書きとして保存するかを選択
CC経由の「全員に返信」のサポート
gmail_get_attachmentメールの添付ファイルをダウンロードする
ディスクに保存するか、埋め込みリソースとして返す
gmail_bulk_save_attachments1回の操作で複数の添付ファイルを保存する
gmail_archive/gmail_bulk_archive受信トレイからメールを移動する
個別または一括操作のサポート
カレンダーツール
calendar_listアクセス可能なすべてのカレンダーを一覧表示する
カレンダーのメタデータ、アクセスロール、タイムゾーン情報が含まれます
calendar_get_events日付範囲内のイベントを取得する
複数のカレンダーのサポート
フィルター オプション (削除されたイベント、最大結果)
タイムゾーンのカスタマイズ
calendar_create_event新しいカレンダーイベントを作成する
出席者と通知のサポート
場所と説明フィールド
タイムゾーンの処理
calendar_delete_eventIDでイベントを削除する
キャンセル通知のオプション
発達
ソースコードはTypeScriptで
src/ディレクトリにありますビルド出力は
dist/ディレクトリに保存されますモジュール性を高めるためにESモジュールを使用
Google API のベスト プラクティスに準拠
プロジェクト構造
mcp-google-workspace/
├── src/
│ ├── server.ts # Main server implementation
│ ├── services/
│ │ └── gauth.ts # Google authentication service
│ ├── tools/
│ │ ├── gmail.ts # Gmail tools implementation
│ │ └── calendar.ts # Calendar tools implementation
│ └── types/
│ └── tool-handler.ts # Common types and interfaces
├── .gauth.json # OAuth2 credentials
├── .accounts.json # Account configuration
├── package.json # Project dependencies
└── tsconfig.json # TypeScript configuration開発コマンド
npm run build: TypeScript コードをビルドするnpm start: サーバーを起動するnpm run dev: 自動リロード付きの開発モードで起動する
貢献
リポジトリをフォークする
機能ブランチを作成する
変更をコミットする
ブランチにプッシュする
プルリクエストを作成する
ライセンス
MITライセンス - 詳細はLICENSEファイルを参照
This server cannot be deployed
Maintenance
Related MCP Connectors
Email infrastructure for AI agents — send, receive, search, and reply to email over MCP.
Hosted email MCP for your own Gmail, Outlook.com, Microsoft 365, iCloud or IMAP inbox: read, search, draft, reply in thread, forward and file mail. It moves or flags up to 500 messages in one call, and a send leaves exactly one copy in Sent. A calendar is a separate connection, and connecting one adds diary and scheduling tools.
Your Gmail, Calendar, Drive, GitHub, Oura, wallet and confirmed profile facts in any MCP client.
Permissioned access to Gmail, Drive and Calendar via the user's own Google account
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceEnables managing Gmail inbox and Google Calendar through MCP, with tools for email operations and calendar events.9 npm1AGPL 3.0
- AlicenseNot gradedqualityDmaintenanceMCP server to interact with Google Gmail and Calendar APIs. Supports multiple accounts, email search and drafting, and calendar event management.MIT
- FlicenseNot gradedqualityDmaintenanceEnables interaction with Gmail and Google Docs via MCP, including email search, read, send, and document read/create operations.-
- AlicenseBqualityDmaintenanceMCP server for interacting with Google Gmail and Calendar via natural language, supporting multiple accounts.359MIT
Appeared in Searches
- Multi-user Google Calendar and Sheets MCP server with OAuth token authentication
- Multi-user production MCP server for Google Calendar and Sheets
- A tool for managing and scheduling calendar appointments
- A service or tool for sending emails and managing calendars
- Google: A web search engine and online services platform