About Google Workspace MCP Server
Google Workspace MCP Server exposes Gmail and Google Calendar operations to AI clients. It is for users who want to manage email and schedules through MCP, with tools for searching and sending mail, changing labels, and maintaining calendar events.
Key features
- 01List and search emails with filters
- 02Send email with CC and BCC
- 03Manage email labels and status
- 04List, create, update, and delete events
Use cases
- 01Filter unread mail or find messages with attachments
- 02Send and organize email through an AI client
- 03Review events within a date range
- 04Create or change meetings with attendees
MCP support
As an MCP server, it provides MCP clients with Gmail and Google Calendar tools for querying and managing email and calendar events.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEGoogle Workspace MCP Server
このプロジェクトは以下のリポジトリをベースに作成しています: epaproditus/google-workspace-mcp-server
Google Workspace の機能(カレンダー、メール)を MCP サーバーとして提供するアプリケーション
機能
Gmail 機能
list_emails: 受信トレイから最近のメールをフィルタリング付きで一覧表示search_emails: Gmail クエリ構文を使用した高度なメール検索send_email: CC、BCC 対応のメール送信modify_email: メールラベルの管理(アーカイブ、ゴミ箱、既読/未読)
カレンダー機能
list_events: 日付範囲指定付きの予定一覧表示create_event: 参加者付きの予定作成update_event: 既存予定の更新delete_event: 予定の削除
必要条件
- Node.js: Node.js 20 以上をインストール
- Google Cloud Console 設定:
- Google Cloud Consoleにアクセス
- 新規プロジェクトの作成または既存プロジェクトの選択
- Gmail API と Google Calendar API の有効化:
- "APIs & Services" > "Library"に移動
- "Gmail API"を検索して有効化
- "Google Calendar API"を検索して有効化
- OAuth 2.0 認証情報の設定:
- "APIs & Services" > "Credentials"に移動
- "Create Credentials" > "OAuth client ID"をクリック
- "Desktop application"を選択
- "Authorized redirect URIs"に
http://localhost:4100/codeを追加 - Client ID と Client Secret をメモ
セットアップ手順
-
リポジトリのクローンとインストール:
git clone https://github.com/Yulikepython/gogole-workspace-mcp-server-by-itc.git cd google-workspace-mcp-server-by-itc npm install -
認証情報の設定:
# credentials.json.exampleをコピー cp credentials.json.example credentials.jsoncredentials.jsonを以下のように編集:{ "web": { "client_id": "YOUR_CLIENT_ID", "client_secret": "YOUR_CLIENT_SECRET", "redirect_uris": ["http://localhost:4100/code"], "auth_uri": "https://accounts.google.com/o/oauth2/auth", "token_uri": "https://oauth2.googleapis.com/token" } } -
リフレッシュトークンの取得:
node get-refresh-token.jsこれにより:
- ブラウザが開き、Google OAuth 認証が実行されます
- 以下の権限が要求されます:
https://www.googleapis.com/auth/gmail.modifyhttps://www.googleapis.com/auth/calendarhttps://www.googleapis.com/auth/gmail.send
- 認証情報が
token.jsonに保存されます - コンソールにリフレッシュトークンが表示されます
-
MCP 設定の構成: MCP 設定ファイルにサーバー設定を追加:
- VSCode Claude 拡張機能:
~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json - Claude デスクトップアプリ:
~/Library/Application Support/Claude/claude_desktop_config.json
mcpServersオブジェクトに以下を追加:{ "mcpServers": { "google-workspace": { "command": "node", "args": ["/path/to/google-workspace-server/build/index.js"], "env": { "GOOGLE_CLIENT_ID": "your_client_id", "GOOGLE_CLIENT_SECRET": "your_client_secret", "GOOGLE_REFRESH_TOKEN": "your_refresh_token" } } } } - VSCode Claude 拡張機能:
-
ビルドと実行:
npm run build -
デプロイ設定の追加 (.env):
deployスクリプトを使用するには.envファイルが必要です。cp .env.example .env.envに以下の環境変数を設定してください:SSH_USER=your_ssh_user SSH_HOST=your.ssh.host SSH_PATH=/your/deploy/path
npm scripts
| コマンド | 説明 |
|---|---|
npm run build | バンドルを作成し、実行可能権限を付与 |
npm run start | ローカルでビルド&実行 |
npm run clean | ビルド成果物を削除 |
npm run deploy | ビルド後、本番環境にファイルをデプロイ |
npm run logs | 本番環境のアプリケーションログをリアルタイムで表示 |
使用例
Gmail 操作
-
最近のメール一覧:
{ "maxResults": 5, "query": "is:unread" } -
メール検索:
{ "query": "from:[email protected] has:attachment", "maxResults": 10 } -
メール送信:
{ "to": "[email protected]", "subject": "Hello", "body": "Message content", "cc": "[email protected]", "bcc": "[email protected]" } -
メールラベルの変更:
{ "id": "message_id", "addLabels": ["UNREAD"], "removeLabels": ["INBOX"] }
カレンダー操作
-
予定一覧:
{ "maxResults": 10, "timeMin": "2024-01-01T00:00:00Z", "timeMax": "2024-12-31T23:59:59Z" } -
予定作成:
{ "summary": "Team Meeting", "location": "Conference Room", "description": "Weekly sync-up", "start": "2024-01-24T10:00:00Z", "end": "2024-01-24T11:00:00Z", "attendees": ["[email protected]"] } -
予定更新:
{ "eventId": "event_id", "summary": "Updated Meeting Title", "location": "Virtual", "start": "2024-01-24T11:00:00Z", "end": "2024-01-24T12:00:00Z" } -
予定削除:
{ "eventId": "event_id" }
トラブルシューティング
-
認証の問題:
- 必要な OAuth スコープが付与されているか確認
- Client ID と Secret が正しいか確認
- リフレッシュトークンが有効か確認
-
API エラー:
- Google Cloud Console で API クォータと制限を確認
- プロジェクトで API が有効化されているか確認
- リクエストパラメータが正しい形式か確認
ライセンス
MIT
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.