Skip to main content
Glama
SendGrid MCP Server

SendGrid MCP Server

by bhoggard

SendGrid MCP サーバー

AIアシスタントがSendGridのWeb API v3を通じてメールの送信や連絡先の管理を行えるようにするPython製MCP(Model Context Protocol)サーバーです。

ツール

ツール

説明

send_email

1人以上の受信者にプレーンテキスト/HTMLメールを送信します

get_template_info

動的テンプレートの構造を確認します

send_template_email

置換データを使用して動的テンプレート経由で送信します

add_contact

マーケティング連絡先を追加/更新します(SendGridによって非同期で処理されます)

search_contacts

制限付きSGQLクエリで連絡先を検索します

get_contact_lists

名前付きマーケティング連絡先リストを一覧表示します

authenticate_domain

新しい送信ドメインのドメイン認証を開始し、追加するDNSレコードを返します

list_domain_authentications

ドメインとその検証ステータスを一覧表示します

validate_domain_authentication

レコード追加後にDNSを再チェックします

delete_domain_authentication

ドメイン認証を削除します

Related MCP server: sendcraft-mcp

セットアップ

  1. 仮想環境を作成して依存関係をインストールします:

    python -m venv venv
    source venv/bin/activate   # Windows: venv\Scripts\activate
    pip install -r requirements.txt
  2. .env.example を .env にコピーし、SendGrid APIキー(SendGridダッシュボードの「Settings > API Keys」)とデフォルトの送信者を入力します:

    cp .env.example .env
  3. 送信前にSendGridの「Settings > Sender Authentication」で送信者メールを検証してください。検証されていない送信者は拒否されます。

  4. (オプション)「Email API > Dynamic Templates」で動的テンプレートを作成し、.env に DEFAULT_TEMPLATE_ID を設定します。

実行

python main.py

これにより、Claude DesktopのようなMCPクライアントがローカルサブプロセスに期待するstdioトランスポートでサーバーが実行されます。

動作確認

python smoke_test.py

登録済みツールの一覧を表示し、SendGridアカウントに対して1回のライブ呼び出しを実行します。対話形式でのスキーマ/ツール検査には:

npx @modelcontextprotocol/inspector python main.py

Claude Desktopへの接続

claude_desktop_config.json に以下を追加します:

{
  "mcpServers": {
    "sendgrid-mcp": {
      "command": "python",
      "args": ["/path/to/twilio-sendgrid-mcp/main.py"],
      "cwd": "/path/to/twilio-sendgrid-mcp",
      "env": {
        "SENDGRID_API_KEY": "SG.your-actual-api-key-here"
      }
    }
  }
}

その後、Claude Desktopを再起動します。ツール呼び出しが失敗した場合は、~/Library/Logs/Claude/mcp*.log(macOS)でサーバーのstderr出力を確認してください。

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    A
    maintenance
    Enables comprehensive email marketing and transactional email operations through SendGrid's API v3. Supports contact management, campaign creation, email automation, list management, and email sending with built-in read-only safety mode.
    58
    322 npm
    4
    ISC
  • A
    license
    A
    quality
    D
    maintenance
    Enables AI agents to send emails, manage campaigns, subscribers, templates, and domains via the SendCraft email API.
    26
    3 npm
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI models to send emails, manage contacts, and interact with SendGrid's email platform via MCP.
    1
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables querying SendGrid email statistics, blocked addresses, and bounces through the SendGrid v3 API, allowing AI agents to retrieve delivery metrics and lists of problematic recipients.
    294 npm
    MIT