Skip to main content
SE

SendGrid

v0.2.1API Key

Email (transaccional + marketing), del grupo Twilio. Completa la cobertura de canales: Twilio maneja SMS/WhatsApp/Voz, SendGrid maneja email. Enviar mail, templates, CRUD de contactos, suppressions, stats.

20 herramientas2 env vars🌐 GLOBALestable en npm

Qué puede hacer tu agente

SendGrid le da a tu agente 20 tools que llama directo — elegí las que necesite, en Claude, Cursor o cualquier cliente MCP.

  • send_mailSend an email via POST /mail/send. Supply at least one `personalization` with `to` recipients, a `from` address (falls back to SENDGRID_FROM_EMAIL), and either `content` blocks or a `template_id` with `dynamic_template_data`. Returns 202 on success.
  • send_templateConvenience wrapper for POST /mail/send with a dynamic template. Equivalent to send_mail with `template_id` set. Supply `to`, `template_id`, and `dynamic_template_data`; content is rendered from the template.
  • add_contactUpsert contacts in Marketing Campaigns via PUT /marketing/contacts. Matches on email. Returns a job_id — ingestion is async. Optionally assign to list_ids.
Ejemplo de llamada
// Your agent calls a tool directly — no glue code.
// CodeSpar's managed tier handles OAuth2, token rotation and rate limits.
const result = await session.call("send_mail", { /* ... */ });

Instalar

terminal
$ npm install @codespar/mcp-sendgrid

Quickstart

Agregá esta entrada a tu claude_desktop_config.json (o a la config de cualquier cliente compatible con MCP).

claude_desktop_config.json
{
  "mcpServers": {
    "sendgrid": {
      "command": "npx",
      "args": [
        "-y",
        "@codespar/mcp-sendgrid"
      ],
      "env": {
        "SENDGRID_API_KEY": "<your_sendgrid_api_key>"
      }
    }
  }
}

Después de reiniciar, tu agente puede llamar cualquiera de las 20 herramientas de abajo — probá send_mail primero.

Variables de entorno · 2

Necesarias para autenticar el server. Almacenadas cifradas al usar el hosting gestionado de CodeSpar.

SENDGRID_API_KEY
obligatoriosecret

SendGrid API key. Used as Bearer token in the Authorization header.

SENDGRID_FROM_EMAIL
opcional

Optional default From address used by send_mail / send_template when `from.email` is omitted. Must be a Verified Sender or authenticated domain.

Herramientas disponibles · 20

Cada herramienta es independiente — tu agente carga solo lo que necesita para reducir contexto y tiempo de respuesta.

WRITEsend_mail
Send an email via POST /mail/send. Supply at least one `personalization` with `to` recipients, a `from` address (falls back to SENDGRID_FROM_EMAIL), and either `content` blocks or a `template_id` with `dynamic_template_data`. Returns 202 on success.
WRITEsend_template
Convenience wrapper for POST /mail/send with a dynamic template. Equivalent to send_mail with `template_id` set. Supply `to`, `template_id`, and `dynamic_template_data`; content is rendered from the template.
WRITEadd_contact
Upsert contacts in Marketing Campaigns via PUT /marketing/contacts. Matches on email. Returns a job_id — ingestion is async. Optionally assign to list_ids.
READlist_contacts
List Marketing Campaigns contacts via GET /marketing/contacts. Returns up to 50 sample contacts; for full export use a Contacts Export job.
DELETEdelete_contact
Delete contacts by id via DELETE /marketing/contacts?ids=.... Pass a comma-separated list of contact UUIDs, or set delete_all_contacts=true to wipe all contacts (irreversible).
READsearch_contacts
Search contacts with an SGQL query via POST /marketing/contacts/search. Example: `email LIKE '%@codespar.com' AND CONTAINS(list_ids, 'abc-123')`.
READget_contact
Retrieve a single Marketing Campaigns contact by id via GET /marketing/contacts/{id}. Returns full contact record including custom fields and list_ids.
READlist_lists
List all Marketing Campaigns contact lists via GET /marketing/lists. Returns list UUIDs, names, and contact_count. Supports pagination.

Frameworks compatibles

MCP es un protocolo — cualquier framework que lo hable puede montar este server.

Claude Agent SDKAnthropic
OpenAI AgentsOpenAI
Vercel AI SDKVercel
LangChainLangChain
LlamaIndexLlamaIndex
CrewAICrewAI
MastraMastra
Cualquier cliente MCPProtocolo

Preguntas frecuentes

Corré `npx -y @codespar/mcp-sendgrid` y agregá el bloque de config de arriba a tu cliente MCP — Claude, Cursor, VS Code o cualquier cliente compatible con MCP. Sin build, sin SDK. ¿Preferís hosted? El tier gestionado de CodeSpar lo corre por vos, con la auth resuelta.
SendGrid — MCP server · 20 tools | CodeSpar