MCP

Operate Send & Retain from Claude Code or claude.ai over MCP.

Send & Retain is built to be driven over MCP — from Claude Code or a claude.ai connector — so you can set up domains, author templates, send email, and build automations in natural language. The same tools power the in-app copilot chat.

Connecting and scope

MCP takes two credentials. A person connects over OAuth 2.1 — there is no token to mint, copy, or store. Point a client at https://sendandretain.com/api/mcp and it discovers the authorization server itself, then sends you to a browser to approve. A headless agent sends an aem_ API key as the Bearer instead — the same key the REST API takes, verified by the same code, so revoking it stops both surfaces. See Connecting for the per-client steps.

MCP personal access tokens (aiem_…) were removed. If a client config still sends an Authorization: Bearer aiem_… header, delete the header — it no longer authenticates anything. A headless client sends an aem_ key instead.

An OAuth session is always workspace-scoped with write access: every company in the org, every email_* tool. Because of that, project-scoped tools need an explicit projectId — call email_list_projects first and pass the company's projectId on each call. An aem_ key is pinned to one company and carries its own scope, expiry and send grant — without that grant it cannot send mail or enable an automation.

What you can do

The toolset (email_*) covers the whole product. A sampling:

  • Setup — email_get_connection_status (returns the settings URL where a human connects the provider and mints API keys), email_create_domain, email_verify_domain, email_create_sender, email_register_webhooks.
  • Templates — email_create_template, email_render_template, email_publish_template_version, email_send_template_test.
  • Sending & observability — email_send_email (one recipient, published template), email_get_message, email_search_messages, email_get_email_metrics.
  • Contacts & events — email_upsert_contact, email_import_contacts, email_emit_contact_event.
  • Automations — email_create_automation, email_add_automation_steps, email_set_automation_status, email_set_ab_test.
  • Suppression — email_list_suppressions, email_add_suppression, email_remove_suppression.

Guardrails

There's no approval queue — guardrails are built into the tools instead:

  • Automations are created paused; enabling is a separate confirm: true call.
  • Credentials never cross MCP — email_get_connection_status hands back the settings-page URL where a human connects the provider and mints API keys.
  • Each project has a sendsPaused kill switch plus daily and monthly send caps.
  • Complaint suppressions are never removable.

Production events should come through POST /api/v1/events from your app. email_emit_contact_event is for test-driving automation triggers by hand.

On this page