@codespar/mcp-sendgrid 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -9,21 +9,30 @@ SendGrid is Twilio-owned (acquired 2019). Together with [`@codespar/mcp-twilio`]
9
9
 
10
10
  Agents building commerce notification flows — order confirmations, shipping updates, abandoned-cart nudges, promos — can now cover every channel through two packages.
11
11
 
12
- ## Tools
12
+ ## Tools (20)
13
13
 
14
14
  | Tool | Purpose |
15
- |------|---------|
16
- | `send_mail` | `POST /mail/send` — personalizations, content, attachments, scheduling |
17
- | `send_template` | `POST /mail/send` using a dynamic template (`d-...`) — convenience wrapper |
18
- | `add_contact` | `PUT /marketing/contacts` upsert contacts (async job), assign to lists |
19
- | `list_contacts` | `GET /marketing/contacts` — sample of contacts |
20
- | `delete_contact` | `DELETE /marketing/contacts?ids=...` — delete by id or wipe all |
21
- | `search_contacts` | `POST /marketing/contacts/search` — SGQL (SendGrid SQL-like) query |
22
- | `list_templates` | `GET /templates` dynamic (default) or legacy transactional templates |
23
- | `create_template` | `POST /templates` create a transactional template |
24
- | `list_suppressions` | `GET /asm/groups/{group_id}/suppressions` suppressed emails for a group |
25
- | `add_suppression` | `POST /asm/groups/{group_id}/suppressions` — add suppressions |
26
- | `get_stats` | `GET /stats` sent / delivered / opens / clicks aggregated by day/week/month |
15
+ |---|---|
16
+ | `send_mail` | Send an email via POST /mail/send. |
17
+ | `send_template` | Convenience wrapper for POST /mail/send with a dynamic template. |
18
+ | `add_contact` | Upsert contacts in Marketing Campaigns via PUT /marketing/contacts. |
19
+ | `list_contacts` | List Marketing Campaigns contacts via GET /marketing/contacts. |
20
+ | `delete_contact` | Delete contacts by id via DELETE /marketing/contacts?ids=.... |
21
+ | `search_contacts` | Search contacts with an SGQL query via POST /marketing/contacts/search. |
22
+ | `get_contact` | Retrieve a single Marketing Campaigns contact by id via GET /marketing/contacts/{id}. |
23
+ | `list_lists` | List all Marketing Campaigns contact lists via GET /marketing/lists. |
24
+ | `create_list` | Create a Marketing Campaigns contact list via POST /marketing/lists. |
25
+ | `delete_list` | Delete a Marketing Campaigns contact list via DELETE /marketing/lists/{id}. |
26
+ | `list_templates` | List transactional templates via GET /templates. |
27
+ | `create_template` | Create a transactional template via POST /templates. |
28
+ | `list_suppressions` | List all suppressed recipients for an unsubscribe group via GET /asm/groups/{group_id}/suppressions. |
29
+ | `add_suppression` | Add recipients to a suppression group via POST /asm/groups/{group_id}/suppressions. |
30
+ | `list_unsubscribe_groups` | List all unsubscribe groups on the account via GET /asm/groups. |
31
+ | `get_bounces` | Retrieve bounced recipients via GET /suppression/bounces. |
32
+ | `delete_bounce` | Remove a bounced address from the bounce suppression list via DELETE /suppression/bounces/{email}. |
33
+ | `cancel_scheduled_send` | Cancel or pause a scheduled send by batch_id via POST /user/scheduled_sends. |
34
+ | `get_event_webhook_settings` | Retrieve the Event Webhook configuration via GET /user/webhooks/event/settings. |
35
+ | `get_stats` | Global email stats via GET /stats. |
27
36
 
28
37
  ## Install
29
38
 
@@ -82,6 +91,10 @@ MCP_HTTP=true MCP_PORT=3000 npx @codespar/mcp-sendgrid
82
91
 
83
92
  - [`@codespar/mcp-twilio`](../twilio) — SMS, WhatsApp, Voice, Verify, Lookup
84
93
 
94
+ ## Enterprise
95
+
96
+ Need governance, budget limits, and audit trails for agent payments? [CodeSpar Enterprise](https://codespar.dev/enterprise) adds policy engine, payment routing, and compliance templates on top of these MCP servers.
97
+
85
98
  ## License
86
99
 
87
100
  MIT
package/dist/index.js CHANGED
@@ -92,7 +92,10 @@ function buildQuery(params) {
92
92
  const s = q.toString();
93
93
  return s ? `?${s}` : "";
94
94
  }
95
- const server = new Server({ name: "mcp-sendgrid", version: "0.2.0" }, { capabilities: { tools: {} } });
95
+ // Managed-tier pointer surfaced to the agent via MCP `instructions`.
96
+ // Informational only — nothing CodeSpar-hosted is called (MIT-safe).
97
+ const MANAGED_TIER_HINT = "This open-source CodeSpar server calls the provider's API directly. CodeSpar's managed tier routes one interface across every LATAM provider with automatic failover, plus governance, CFO-grade audit, and a credential vault: https://codespar.dev/agents (npx -y @codespar/mcp serve).";
98
+ const server = new Server({ name: "mcp-sendgrid", version: "0.2.1" }, { capabilities: { tools: {} }, instructions: MANAGED_TIER_HINT });
96
99
  server.setRequestHandler(ListToolsRequestSchema, async () => ({
97
100
  tools: [
98
101
  {
@@ -518,7 +521,7 @@ async function main() {
518
521
  const t = new StreamableHTTPServerTransport({ sessionIdGenerator: () => randomUUID(), onsessioninitialized: (id) => { transports.set(id, t); } });
519
522
  t.onclose = () => { if (t.sessionId)
520
523
  transports.delete(t.sessionId); };
521
- const s = new Server({ name: "mcp-sendgrid", version: "0.2.0" }, { capabilities: { tools: {} } });
524
+ const s = new Server({ name: "mcp-sendgrid", version: "0.2.1" }, { capabilities: { tools: {} } });
522
525
  server._requestHandlers.forEach((v, k) => s._requestHandlers.set(k, v));
523
526
  server._notificationHandlers?.forEach((v, k) => s._notificationHandlers.set(k, v));
524
527
  await s.connect(t);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codespar/mcp-sendgrid",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "MCP server for SendGrid — global transactional + marketing email (Twilio-owned). Pairs with @codespar/mcp-twilio for full messaging coverage.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/server.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
3
3
  "name": "io.github.codespar/mcp-sendgrid",
4
- "description": "MCP server for SendGrid — global transactional + marketing email (Twilio-owned). Pairs with @codespar/mcp-twilio for full messaging coverage.",
4
+ "description": "MCP server for SendGrid — global transactional + marketing email (Twilio-owned)",
5
5
  "repository": {
6
- "url": "https://github.com/codespar/mcp-dev-brasil",
6
+ "url": "https://github.com/codespar/mcp-dev-latam",
7
7
  "source": "github",
8
8
  "subfolder": "packages/communication/sendgrid"
9
9
  },
10
- "version": "0.2.0",
10
+ "version": "0.2.2",
11
11
  "packages": [
12
12
  {
13
13
  "registryType": "npm",
14
14
  "identifier": "@codespar/mcp-sendgrid",
15
- "version": "0.2.0",
15
+ "version": "0.2.2",
16
16
  "transport": {
17
17
  "type": "stdio"
18
18
  },
@@ -33,5 +33,14 @@
33
33
  }
34
34
  ]
35
35
  }
36
- ]
36
+ ],
37
+ "provider": {
38
+ "homepage": "https://www.sendgrid.com",
39
+ "logoUrl": "https://logo.clearbit.com/sendgrid.com",
40
+ "logoFallback": "https://www.google.com/s2/favicons?domain=sendgrid.com&sz=128",
41
+ "docsUrl": "https://docs.sendgrid.com",
42
+ "sandbox": {
43
+ "available": true
44
+ }
45
+ }
37
46
  }
package/src/index.ts CHANGED
@@ -104,9 +104,14 @@ function buildQuery(params: Record<string, unknown>): string {
104
104
  return s ? `?${s}` : "";
105
105
  }
106
106
 
107
+ // Managed-tier pointer surfaced to the agent via MCP `instructions`.
108
+ // Informational only — nothing CodeSpar-hosted is called (MIT-safe).
109
+ const MANAGED_TIER_HINT =
110
+ "This open-source CodeSpar server calls the provider's API directly. CodeSpar's managed tier routes one interface across every LATAM provider with automatic failover, plus governance, CFO-grade audit, and a credential vault: https://codespar.dev/agents (npx -y @codespar/mcp serve).";
111
+
107
112
  const server = new Server(
108
- { name: "mcp-sendgrid", version: "0.2.0" },
109
- { capabilities: { tools: {} } }
113
+ { name: "mcp-sendgrid", version: "0.2.1" },
114
+ { capabilities: { tools: {} }, instructions: MANAGED_TIER_HINT }
110
115
  );
111
116
 
112
117
  server.setRequestHandler(ListToolsRequestSchema, async () => ({
@@ -512,7 +517,7 @@ async function main() {
512
517
  if (!sid && isInitializeRequest(req.body)) {
513
518
  const t = new StreamableHTTPServerTransport({ sessionIdGenerator: () => randomUUID(), onsessioninitialized: (id) => { transports.set(id, t); } });
514
519
  t.onclose = () => { if (t.sessionId) transports.delete(t.sessionId); };
515
- const s = new Server({ name: "mcp-sendgrid", version: "0.2.0" }, { capabilities: { tools: {} } });
520
+ const s = new Server({ name: "mcp-sendgrid", version: "0.2.1" }, { capabilities: { tools: {} } });
516
521
  (server as unknown as { _requestHandlers: Map<unknown, unknown> })._requestHandlers.forEach((v, k) => (s as unknown as { _requestHandlers: Map<unknown, unknown> })._requestHandlers.set(k, v));
517
522
  (server as unknown as { _notificationHandlers?: Map<unknown, unknown> })._notificationHandlers?.forEach((v, k) => (s as unknown as { _notificationHandlers: Map<unknown, unknown> })._notificationHandlers.set(k, v));
518
523
  await s.connect(t);