Inbox
articleJuly 3, 20263 min read

Run AI marketing campaigns from any agent with the SESMetric MCP server

Connect Claude, Cursor, or any MCP-capable agent to SESMetric and let it manage contacts, build segments, generate campaigns, send them, and react to opens, clicks, and bounces — end to end, no dashboard required.

By SESMetric Team

Most email platforms bolted an "AI assistant" onto their dashboard. We did the opposite: we made the entire marketing platform available to your AI, wherever it runs.

SESMetric exposes a Model Context Protocol (MCP) server at ai.sesmetric.com/mcp. Any MCP-capable agent — Claude, Claude Code, Cursor, a custom agent built on the Anthropic SDK — can drive the full marketing loop through it: contacts, segments, AI-generated campaigns, drip sequences, sends, and the event stream that tells the agent what to do next.

Connect in one line

Issue an API key with the marketing:manage scope at Dashboard → API keys, then:

claude mcp add --transport http sesmetric https://ai.sesmetric.com/mcp \
  --header "X-API-Key: sk_live_..."

That's it. Your agent now has 28 tools. Marketing tools additionally require a verified domain identity on your account — the same gate the dashboard enforces, because unauthenticated marketing mail helps nobody.

The loop an agent can run

1. Build the audience. upsert_contact creates or enriches contacts with free-form metadata — {"plan": "free", "signup_source": "webinar"}. Every attribute key instantly becomes filterable. describe_segment_fields tells the agent exactly what it can filter on.

2. Segment with engagement data. SESMetric already tracks opens and clicks on every email you send. Those counters live on each contact (opens_count, clicks_count, last_open_at, last_click_at), so an agent can create a segment like "opened 3+ emails but still on the free plan" with one create_contact_list call:

{"all": [
  {"field": "opens_count", "op": "gt", "value": "2"},
  {"field": "attributes.plan", "op": "eq", "value": "free"}
]}

3. Generate the campaign. generate_campaign_content takes a one-line goal — "convince engaged free users to upgrade, friendly tone" — and returns a complete, inline-CSS, email-client-safe HTML email (or a multi-step drip sequence with cadence). create_campaign persists it as a draft.

4. Test, then send. test_send_campaign delivers the real rendered email — merge fields, unsubscribe footer and all — to your own inbox through the same delivery path real recipients get. Only then does send_campaign go out, either immediately or scheduled. Marketing mail routes through SESMetric's isolated sending pool, never your transactional reputation.

5. React to events. This is the part dashboards can't do. get_email_events streams per-recipient opens, clicks, bounces, and complaints. An agent watching that feed can:

  • Clean the list — a hard bounce triggers unsubscribe_contact, keeping deliverability healthy without a human in the loop.
  • Tag intent — a click on the pricing link becomes upsert_contact with {"clicked_pricing": "true"}, feeding sharper segments.
  • Follow up automatically — build a segment of clickers, generate a follow-up campaign, test-send it, and ask you for one approval before it goes out.

Engagement counters update automatically every few minutes, so segments built on them stay current between campaigns.

Guardrails are built in, not bolted on

Agents are powerful and occasionally overconfident, so the platform enforces the rules regardless of what the model does:

  • Every marketing email carries a one-click unsubscribe (RFC 8058) — the platform appends it; the agent can't forget it.
  • Unsubscribes and complaints are enforced at the relay, so a suppressed address can never re-enter a send.
  • The from address must be a verified domain you own.
  • Send tools instruct agents to test-send first and confirm with a human before emailing real people.
  • Marketing traffic is physically isolated from transactional email — a bad campaign can't dent your password-reset deliverability.

Why MCP instead of another SDK?

Because the agent is the interface now. An SDK still needs you to write the glue; an MCP server means the model discovers the tools, reads their contracts, and composes them toward whatever goal you set in plain language. "Re-engage everyone who's gone quiet since June with a three-step drip, show me step one before anything sends" is a complete, executable instruction.

Connect your agent, and let it run your next campaign: https://ai.sesmetric.com/mcp.

Tagsmcpaimarketingcampaignsagents