Connect an AI assistant (MCP)

Give Claude, Cursor or any MCP client your project's API through the hosted MCP server, with your API key.

exx.sh hosts a Model Context Protocol server at https://api.exx.sh/mcp. An assistant connected to it can send email, read your logs and received mail, and manage domains, webhooks, templates, contacts, segments, topics and broadcasts and workflows of one project: the project of the API key you give it. Nothing runs on your machine; the client talks Streamable HTTP to the API and sends your key as a bearer token.

Pick a key

The assistant can do what the key can do, and nothing more:

  • A full access key exposes every tool below.
  • A sending access key exposes send_email and send_batch only. Restricted to a domain, it sends from that domain only.

Create a key for the assistant alone in the dashboard (API keys), so you can see its calls in the request logs and revoke it without touching your applications. Start with sending access if sending is all you need.

Set up your client

Keep the key out of files you share: each example reads it from the EXX_API_KEY environment variable.

Claude Code

claude mcp add --transport http exx https://api.exx.sh/mcp \
  --header "Authorization: Bearer $EXX_API_KEY"

Run /mcp in Claude Code to check that exx is connected and list its tools.

Cursor

In ~/.cursor/mcp.json (every project) or .cursor/mcp.json (one project):

{
  "mcpServers": {
    "exx": {
      "url": "https://api.exx.sh/mcp",
      "headers": { "Authorization": "Bearer ${env:EXX_API_KEY}" }
    }
  }
}

Claude Desktop

Claude Desktop's custom connectors cannot send an API key header. Run the open-source mcp-remote bridge from claude_desktop_config.json instead; it runs on your machine and holds the key there:

{
  "mcpServers": {
    "exx": {
      "command": "npx",
      "args": ["mcp-remote", "https://api.exx.sh/mcp", "--header", "Authorization:${EXX_AUTH}"],
      "env": { "EXX_AUTH": "Bearer exx_your_key" }
    }
  }
}

Any other client

Point it at https://api.exx.sh/mcp with the header Authorization: Bearer <key>. The server is stateless: no session, JSON answers to POST, no SSE stream. A request from a web page (one with an Origin header) is refused.

The tools

Each tool is one operation of the API reference, named by its operationId (send_email, list_received_emails, create_contact, send_broadcast, ...). Its arguments are the operation's path and query parameters, body for its JSON body, idempotency_key where the operation takes an Idempotency-Key, and confirm for a destructive tool. The result is {status, data} with the API's answer, or {status, error} with the API's error when it refuses.

Not available over MCP: creating API keys and rotating a webhook's or a workflow's signing secret (all return a secret), and the deprecated Audiences API (use segments). Every result leaves out what works without a key: signing secrets (of webhooks and workflows) and signed links (the download links of sent and received attachments and of a received email's raw message, the link to a shared broadcast report) are replaced by a note. Read or download them in the dashboard or over the REST API.

Safety

  • Destructive tools need confirm: true. Deleting anything, erasing a contact, canceling an email, a broadcast or workflow runs, sending a broadcast (or creating one with send: true), picking an A/B test's winner, removing a suppression, revoking a key, creating a webhook or changing its endpoint, events or domains, publishing or resuming a workflow, starting a workflow run, and subscribing a contact again (unsubscribed: false, or opting them in to a topic) are refused without it, with a message saying what would happen; nothing runs. Only confirm: true itself counts, not "true". Sending email (send_email, send_batch, a broadcast test) needs no confirmation: it stays within the key's sending domain, your quotas, the suppression list and the rate limits. A client can still set confirm itself, so the key's permission is the real limit.
  • Email and contact content is data, not instructions. Tools that return mail, contacts, templates, transcripts, DNS answers or webhook payloads say so in their description and label their result as untrusted, an error result too. Someone can email your receiving address text written to steer an assistant; review what the assistant proposes before you approve a send or a deletion.
  • Same rules as the API. Every call runs the REST operation with your key: the same validation, plan rate, quotas, sending domains and test mode. Each call appears in the request logs under its operation, and every change, and every refused attempt at a destructive tool, is in the audit log as mcp.tool_call (the tool, whether it was confirmed and the outcome; never a body). Tool calls count against your plan's request rate like REST requests.
  • Limits. Each key has its own MCP rate and a cap on requests in flight (a call counts until it finishes, even if the client has gone); past them the server answers 429 rate_limit_exceeded with retry-after. One MCP request is at most 1 MiB (413 past it), much less than the REST API takes: send large attachments by path (a URL) or over REST. One request is one call: a JSON-RPC batch is refused. A result too large to return asks for a smaller page (limit); a change whose result is too large still ran, and says so.

Revoke the assistant's key in the dashboard to cut it off at once.

On this page