Gmail MCP Server

by zacco16

Integrations

  • Enables comprehensive email operations including listing, reading, and sending emails, as well as draft management with creation, reading, updating, and deletion capabilities

  • Provides calendar functionality for listing, reading, and creating events with support for filtering, timezone handling, and attendee management

  • Supports calendar synchronization with iOS devices, allowing events created or modified through the MCP to appear on Apple mobile devices

Gmail MCP サーバー

Gmail API 統合用のモデル コンテキスト プロトコル (MCP) サーバー実装。AI アシスタントが Gmail サービスと対話できるようになります。

特徴

コア機能

  • メール操作
    • 高度なフィルタリングでメールをリストする
    • 特定のメールを全文で読む
    • 新しいメールを作成して送信する
  • ドラフト管理
    • 新しい下書きを作成する
    • 既存の下書きを一覧表示する
    • 下書きコンテンツを読む
    • 下書きコンテンツと受信者を更新する
    • 下書きを削除する
  • カレンダー操作
    • 今後のカレンダーイベントを一覧表示する
    • 詳細なイベント情報を読む
    • 新しいカレンダーイベントを作成する
    • イベントのフィルタリングと検索
    • タイムゾーンのサポート
    • iOSカレンダー同期のサポート

検索とフィルタリング

  • Gmail 検索クエリのサポート
  • ラベルベースのフィルタリング
  • カスタマイズ可能な結果制限
  • カレンダーイベント検索機能

安全

  • Google OAuth2.0統合
  • 安全な資格情報管理
  • リフレッシュトークンの処理
  • マルチスコープ認証のサポート

クイックスタート

前提条件

  • Node.js (v14以上)
  • npm (v6以上)
  • Gmail とカレンダー API が有効になっている Google Cloud Platform アカウント
  • 適切なスコープを持つ OAuth 2.0 認証情報

インストール

  1. 依存関係をクローンしてインストールします。
    git clone [repository-url] cd gmail-mcp-server npm install
  2. 環境を構成する:
    # Create .env file cp .env.example .env # Add your credentials: GOOGLE_CLIENT_ID="your_client_id" GOOGLE_CLIENT_SECRET="your_client_secret" REDIRECT_URI="http://localhost:4100/code" GOOGLE_REFRESH_TOKEN="your_refresh_token"
  3. ビルドして実行:
    npm run build npm start

発達

利用可能なスクリプト

  • npm run dev - ウォッチモードでビルドして実行する
  • npm run build - プロジェクトをビルドする
  • npm run clean - ビルド成果物をクリーンアップする
  • npm run watch - 変更を監視する

プロジェクト構造

gmail-mcp-server/ ├── src/ │ ├── config/ # Configuration and setup │ ├── services/ # Core business logic │ │ ├── gmail/ # Gmail services │ │ └── calendar/ # Calendar services │ ├── tools/ # MCP tool implementations │ │ ├── calendar/ # Calendar tools │ │ ├── drafts/ # Draft management tools │ │ └── messages/ # Email tools │ ├── types/ # TypeScript definitions │ └── index.ts # Server entry point ├── dist/ # Compiled JavaScript └── tests/ # Test files (pending)

APIインターフェース

メッセージの一覧
listEmails({ maxResults?: number, // Default: 10 query?: string, // Gmail search query labelIds?: string[], // Filter by labels verbose?: boolean // Include details })
メッセージを読む
readEmail({ messageId: string // Message ID to fetch })
ドラフト運営
// List Drafts listDrafts({ maxResults?: number, // Default: 10 query?: string, // Search query verbose?: boolean // Include details }) // Read Draft readDraft({ draftId: string // Draft ID to fetch }) // Create Draft draftEmail({ to: string[], subject: string, body: string, cc?: string[], bcc?: string[], isHtml?: boolean }) // Update Draft updateDraft({ draftId: string, // Draft ID to update to?: string[], // New recipients cc?: string[], // New CC recipients bcc?: string[], // New BCC recipients subject?: string, // New subject body?: string, // New body content isHtml?: boolean // Content type flag }) // Delete Draft deleteDraft({ draftId: string // Draft ID to delete })
メールを送信
sendEmail({ to: string[], subject: string, body: string, cc?: string[], bcc?: string[], isHtml?: boolean, draftId?: string // Optional: send existing draft })
カレンダー操作
// List Events listEvents({ maxResults?: number, // Default: 25 timeMin?: string, // Start time (ISO 8601) timeMax?: string, // End time (ISO 8601) query?: string, // Text search term timeZone?: string // Default: Australia/Brisbane }) // Read Event Details readEvent({ eventId: string, // Event ID to fetch details timeZone?: string // Default: Australia/Brisbane }) // Create Event createEvent({ summary: string, // Event title start: { dateTime: string, // ISO 8601 start time timeZone?: string // Start time timezone }, end: { dateTime: string, // ISO 8601 end time timeZone?: string // End time timezone }, description?: string, // Optional event description location?: string, // Optional event location attendees?: Array<{ // Optional attendees email: string, displayName?: string, optional?: boolean }>, status?: 'confirmed' | 'tentative' | 'cancelled', sendNotifications?: boolean })

エラー処理

サーバーは、以下に対する包括的なエラー処理を実装します。

  • 認証失敗
  • API レート制限
  • 無効なリクエスト
  • ネットワークの問題
  • カレンダーの同期の問題
  • イベントIDの検証
  • タイムゾーンの検証

貢献

ガイドラインについてはCONTRIBUTING.mdをご覧ください。

変更履歴

バージョン履歴と更新については、 CHANGELOG.md を参照してください。

ロードマップ

計画されている機能と改善についてはBacklog.md を参照してください。

ライセンス

MIT ライセンス - 詳細についてはライセンスを参照してください。

-
security - not tested
F
license - not found
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

AI アシスタントが Gmail サービスと対話できるようにし、Google API 統合を通じてメール操作、下書き管理、カレンダー機能をサポートするモデル コンテキスト プロトコル サーバー。

  1. 特徴
    1. コア機能
    2. 検索とフィルタリング
    3. 安全
  2. クイックスタート
    1. 前提条件
    2. インストール
  3. 発達
    1. 利用可能なスクリプト
    2. プロジェクト構造
    3. APIインターフェース
  4. エラー処理
    1. 貢献
      1. 変更履歴
        1. ロードマップ
          1. ライセンス

            Related MCP Servers

            • -
              security
              F
              license
              -
              quality
              A specialized Model Context Protocol (MCP) server that integrates Google services (Gmail, Calendar, etc.) into your AI workflows. This server enables seamless access to Google services through MCP, allowing AI agents to interact with Gmail, Google Calendar, and other Google services.
              Last updated -
              10
              3
              TypeScript
            • -
              security
              F
              license
              -
              quality
              A versatile Model Context Protocol server that enables AI assistants to manage calendars, track tasks, handle emails, search the web, and control smart home devices.
              Last updated -
              2
              Python
              • Apple
              • Linux
            • -
              security
              A
              license
              -
              quality
              A Model Context Protocol server that enables AI assistants like Claude to interact with Gmail through natural language, providing comprehensive email management capabilities including sending, reading, organizing, searching, and managing drafts and labels.
              Last updated -
              Python
              GPL 3.0
              • Apple
            • -
              security
              F
              license
              -
              quality
              A Model Context Protocol server that enables AI assistants to access and manage email through IMAP, supporting browsing, searching, reading, and organizing emails while learning user preferences over time.
              Last updated -
              2
              Python
              • Linux
              • Apple

            View all related MCP servers

            ID: y8y96hd64p