Skip to main content
Glama
Garoth

SendGrid MCP Server

by Garoth

SendGrid MCP サーバー

電子メール マーケティングと連絡先管理用の SendGrid のマーケティング API へのアクセスを提供するモデル コンテキスト プロトコル (MCP) サーバー。https ://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api

デモ

このデモでは、Cline SendGridエージェントに新しい連絡先リストを作成し、そこに私のメールを追加し、Lost Citiesに関するテンプレートを自動生成して、リストにメールを送信するよう指示します。このプロセスで、Clineは検証済みの送信者と、使用する配信停止グループを知る必要があることを自動的に認識します。美しいメールが私の受信トレイに届き、Lost Citiesの素晴らしさに感動しました!

Related MCP server: MCP Email Server

APIサポートに関する重要な注意事項

このサーバーはSendGridのv3 APIのみをサポートしており、従来の機能はサポートしていません。これには以下が含まれます。

  • 動的テンプレートのみ - レガシーテンプレートはサポートされていません

  • すべての連絡先と連絡先リストの操作のためのマーケティング API v3

  • 一括メール送信用の Single Sends API

利用可能なツール

連絡先管理

連絡先リスト

SendGrid アカウント内のすべての連絡先を一覧表示します。

// No parameters required

連絡先を追加

SendGrid マーケティング連絡先に連絡先を追加します。

{
  email: string;           // Required: Contact email address
  first_name?: string;     // Optional: Contact first name
  last_name?: string;      // Optional: Contact last name
  custom_fields?: object;  // Optional: Custom field values
}

連絡先を削除する

SendGrid アカウントから連絡先を削除します。

{
  emails: string[];  // Required: Array of email addresses to delete
}

リストで連絡先を取得する

SendGrid リスト内のすべての連絡先を取得します。

{
  list_id: string;  // Required: ID of the contact list
}

リスト管理

連絡先リスト

SendGrid アカウント内のすべての連絡先リストを一覧表示します。

// No parameters required

連絡先リストを作成する

SendGrid に新しい連絡先リストを作成します。

{
  name: string;  // Required: Name of the contact list
}

削除リスト

SendGrid から連絡先リストを削除します。

{
  list_id: string;  // Required: ID of the contact list to delete
}

リストに連絡先を追加する

既存の SendGrid リストに連絡先を追加します。

{
  list_id: string;    // Required: ID of the contact list
  emails: string[];   // Required: Array of email addresses to add
}

リストから連絡先を削除する

SendGrid リストから連絡先を削除せずに削除します。

{
  list_id: string;    // Required: ID of the contact list
  emails: string[];   // Required: Array of email addresses to remove
}

メール送信

メールを送信

SendGrid を使用して電子メールを送信します。

{
  to: string;                             // Required: Recipient email address
  subject: string;                        // Required: Email subject line
  text: string;                          // Required: Plain text content
  from: string;                          // Required: Verified sender email address
  html?: string;                         // Optional: HTML content
  template_id?: string;                  // Optional: Dynamic template ID
  dynamic_template_data?: object;        // Optional: Template variables
}

リストに送信

SendGrid Single Sends を使用して連絡先リストに電子メールを送信します。

{
  name: string;                          // Required: Name of the single send
  list_ids: string[];                    // Required: Array of list IDs to send to
  subject: string;                       // Required: Email subject line
  html_content: string;                  // Required: HTML content
  plain_content: string;                 // Required: Plain text content
  sender_id: number;                     // Required: ID of the verified sender
  suppression_group_id?: number;         // Required if custom_unsubscribe_url not provided
  custom_unsubscribe_url?: string;       // Required if suppression_group_id not provided
}

テンプレート管理(動的テンプレートのみ)

テンプレートの作成

新しい動的電子メール テンプレートを作成します。

{
  name: string;           // Required: Name of the template
  subject: string;        // Required: Default subject line
  html_content: string;   // Required: HTML content with handlebars syntax
  plain_content: string;  // Required: Plain text content with handlebars syntax
}

リストテンプレート

すべての動的電子メール テンプレートを一覧表示します。

// No parameters required

get_template

ID でテンプレートを取得します。

{
  template_id: string;  // Required: ID of the template to retrieve
}

テンプレートの削除

動的テンプレートを削除します。

{
  template_id: string;  // Required: ID of the template to delete
}

分析と検証

取得統計

SendGrid 電子メールの統計を取得します。

{
  start_date: string;                          // Required: Start date (YYYY-MM-DD)
  end_date?: string;                           // Optional: End date (YYYY-MM-DD)
  aggregated_by?: 'day' | 'week' | 'month';    // Optional: Aggregation period
}

検証メール

SendGrid を使用して電子メール アドレスを検証します。

{
  email: string;  // Required: Email address to validate
}

アカウント管理

検証済み送信者リスト

検証済みの送信者の ID をすべて一覧表示します。

// No parameters required

リスト抑制グループ

すべての登録解除グループを一覧表示します。

// No parameters required

インストール

git clone https://github.com/Garoth/sendgrid-mcp.git
cd sendgrid-mcp
npm install

構成

  1. SendGrid API キーを取得します。

    • SendGridアカウントにログイン

    • 設定 > APIキーに移動します

    • フルアクセス権限を持つ新しいAPIキーを作成する

    • APIキーは再度表示されないため、安全に保管してください。

  2. VSCode の設定内の Cline MCP 設定ファイルに追加します (例: ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json):

{
  "mcpServers": {
    "sendgrid": {
      "command": "node",
      "args": ["/path/to/sendgrid-mcp/build/index.js"],
      "env": {
        "SENDGRID_API_KEY": "your-api-key-here"
      },
      "disabled": false,
      "autoApprove": [
        "list_contacts",
        "list_contact_lists",
        "list_templates",
        "list_single_sends",
        "get_single_send",
        "list_verified_senders",
        "list_suppression_groups",
        "get_stats",
        "validate_email"
      ]
    }
  }
}

注: データを変更するツール (電子メールの送信や連絡先の削除など) は、安全のため、意図的に自動承認から除外されています。

発達

テストの設定

テストでは実際のAPI呼び出しを使用し、正確なレスポンスを保証します。テストを実行するには、以下の手順に従ってください。

  1. サンプル環境ファイルをコピーします。

    cp .env.example .env
  2. .envを編集し、SendGrid API キーを追加します。

    SENDGRID_API_KEY=your-api-key-here

    注: 機密情報のコミットを防ぐため、 .envファイルは gitignored されます。

  3. テストを実行します。

    npm test

建物

npm run build

重要な注意事項

  • リストにメールを送信する場合、メール規制に準拠するために、suppression_group_id または custom_unsubscribe_url のいずれかを指定する必要があります。

  • 送信者のメールアドレスは、メールを送信する前にSendGridで検証する必要があります。

  • すべてのテンプレートは、ハンドルバー構文をサポートする動的テンプレートとして作成されます (例: {{variable_name}})

  • Single Sends APIは、より優れた追跡および管理機能を提供するため、すべての一括メール操作に使用されます。

  • SendGrid APIは「結果的に一貫性がある」ため、データの変更(連絡先の追加やリストの更新など)は、変更後すぐには反映されない場合があります。

ライセンス

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

SendGridロゴの著作権/所有者はTwilioです

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Garoth/sendgrid-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server