mailtani

Gérez le marketing par e-mail mailtani depuis Claude, Cursor ou tout agent IA compatible MCP — contacts, listes, campagnes, segments et suivi des événements.

Documentation

Mailtani MCP Server

Manage your email marketing directly from Claude, Cursor, or any MCP-compatible AI agent.

The Mailtani MCP server exposes your contacts, lists, segments, campaigns, emails, tags, custom fields, and event tracking as native AI tools — so your agent can send campaigns, enroll contacts, and track events without leaving the chat.


What you can do

CategoryTools
ContactsList, create (or upsert), update, delete, unsubscribe from marketing
ListsList all, create, add contacts, remove contact
SegmentsList all, create with conditions, get matching contacts
CampaignsList, create broadcast/sequence/flow (as drafts), edit a broadcast/sequence/flow in place, mark a flow marketing or transactional, activate, archive
Sending rulesRead and set your frequency cap
EmailsList sent emails, send one-off transactional email (rich text or plain text)
InboxList conversation threads, read a thread's full history, reply into a thread
TagsList all, create, delete
Custom FieldsList all, create
EventsTrack a custom event (triggers flows)

Example prompts you can use

"Create a broadcast campaign called 'Q3 Newsletter' targeting my 'Leads' list."

"Create a contact for john@acme.com, tag him as VIP, and send him the onboarding email."

"Track a purchase_completed event for sarah@example.com with plan=pro."

"Show me all contacts added in the last 7 days."

"Set up a 3-step welcome sequence for new signups with delays of 0, 3, and 7 days."

"Create a flow that sends an email whenever a contact is added to my project."

"Mark my payment-failed and cancellation flows as transactional so they reach people who unsubscribed."

"Cap marketing email at 4 per week per contact."

Authentication

The MCP server uses the same API key system as the Mailtani REST API.

Every request requires two headers:

HeaderValue
AuthorizationBearer mk_YOUR_API_KEY
X-Project-IdYour project ID (found in Settings → API)

Generate an API key at Settings → API Keys inside your Mailtani account.


Setup

Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (Mac) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "mailtani": {
      "type": "http",
      "url": "https://mailtani.com/mcp",
      "headers": {
        "Authorization": "Bearer mk_YOUR_API_KEY",
        "X-Project-Id": "YOUR_PROJECT_ID"
      }
    }
  }
}

Restart Claude Desktop. You will see a hammer icon confirming the server connected.

Claude Code

Run in your terminal:

claude mcp add --transport http mailtani https://mailtani.com/mcp \
  --header "Authorization: Bearer mk_YOUR_API_KEY" \
  --header "X-Project-Id: YOUR_PROJECT_ID"

Cursor

Add to your Cursor MCP settings (Cursor → Settings → MCP):

{
  "mailtani": {
    "type": "http",
    "url": "https://mailtani.com/mcp",
    "headers": {
      "Authorization": "Bearer mk_YOUR_API_KEY",
      "X-Project-Id": "YOUR_PROJECT_ID"
    }
  }
}

Codex

Add to ~/.codex/config.json:

{
  "mcpServers": {
    "mailtani": {
      "type": "http",
      "url": "https://mailtani.com/mcp",
      "headers": {
        "Authorization": "Bearer mk_YOUR_API_KEY",
        "X-Project-Id": "YOUR_PROJECT_ID"
      }
    }
  }
}

Any MCP-compatible client

Endpoint:  POST https://mailtani.com/mcp
Protocol:  MCP over HTTP (JSON-RPC 2.0)
Auth:      Authorization: Bearer mk_...
Scope:     X-Project-Id: <id>
Rate limit: 30 requests / minute

Tool reference

Contacts

ToolDescription
list-contactsList contacts with optional search, list/tag/status filter, pagination
create-contactCreate or upsert a contact by email; optionally assign lists and tags
update-contactUpdate contact fields, lists, and tags by contact ID. unsubscribe: true unsubscribes them from marketing: their marketing campaigns stop, transactional flows keep reaching them
delete-contactPermanently delete a contact by ID
get-contact-historyGet a contact's full send/reply history by email — every send and reply across all their threads, merged chronologically

Lists

ToolDescription
list-listsList all contact lists with contact counts
create-listCreate a new contact list
add-contact-to-listAdd up to 500 contacts to a list at once
remove-contact-from-listRemove a single contact from a list

Segments

ToolDescription
list-segmentsList all segments with contact counts
create-segmentCreate a segment with filter conditions (max 50)
get-segment-contactsGet paginated contacts matching a segment

Campaigns

Campaigns are always created as drafts. Open the Mailtani app to review and activate them.

ToolDescription
list-campaignsList campaigns filtered by type, status or category (marketing / transactional)
create-campaignCreate a new campaign (broadcast, sequence, or flow) as a draft
create-broadcastCreate a one-time email blast draft and enroll its audience. Requires send_all or at least one of list_ids/segment_ids/tag_ids
create-sequenceCreate a multi-step drip sequence draft with per-step delays and enroll its audience. Requires send_all or at least one of list_ids/segment_ids/tag_ids
create-flowCreate a simple flow draft (single trigger to send). Triggers: contact_added, contact_updated, contact_added_to_list, event_received, form_submitted. Takes a category (see below)
create-advanced-flowCreate a flow draft with branches, waits, and campaign start/stop nodes. Use this instead of create-flow whenever the flow needs to branch on a contact property or stop another campaign. Takes a category
update-campaignEdit an existing broadcast or sequence in place (schedule, name, sending email, content) instead of recreating it. Also enrolls contacts (list/segment/tag/send_all) — needed to fix a campaign created with no audience, since it can't otherwise be activated
update-flowEdit an existing flow in place (nodes, edges, settings, status, category) instead of recreating it. Settings, including category, can change while the flow is active
inspect-email-bodyCheck an email body before saving it to a campaign — markdown that will render literally, unbalanced tags, dead links, unresolved merge variables
simulate-flowWalk a flow for a specific contact and report the exact path it would take, without sending anything. Also says when an unsubscribed contact would still get a transactional flow, and when the frequency cap would hold the next email
enroll-contactEnroll a single active contact into a campaign
activate-campaignActivate a draft or paused campaign, making it ready to send
bulk-update-campaign-statusArchive or activate up to 100 campaigns at once

Marketing or transactional flows. Every flow has a category. marketing (the default) is for onboarding, nudges and offers: it only reaches subscribed contacts, follows your frequency cap and stops when they unsubscribe. transactional is for email about something the contact did or owns (a failed payment, a cancellation): it also reaches contacts who unsubscribed from marketing, isn't held back by the cap and doesn't count toward it, and keeps going if they unsubscribe. Only event-triggered flows can be transactional, and no promotions belong in them. ignore_frequency_cap is deprecated in favour of category.

Sending rules

ToolDescription
get-sending-rulesRead the frequency cap: the most marketing emails one contact can get in a rolling window
update-sending-rulesSet the cap (max_emails 1 to 100 with days_window 1 to 90), or clear: true to switch it off. Applies to marketing flows, sequences and broadcasts, never to transactional flows

Emails

ToolDescription
list-emailsList sent emails, optionally filtered by contact
send-emailSend a one-off transactional email to any address (rich text or plain text)
update-emailEdit an unsent one-off email, and optionally send or schedule it

Inbox

ToolDescription
list-threadsList inbox conversation threads, filterable by contact, unread, category, address, or date
get-threadRead one thread's full message history in order — outbound sends, campaign steps, and inbound replies
reply-to-threadReply into an existing thread, threaded and sent from the right address automatically

Tags

ToolDescription
list-tagsList all tags with contact counts
create-tagCreate a new tag
delete-tagDelete a tag by ID

Custom Fields

ToolDescription
list-custom-fieldsList all custom fields
create-custom-fieldCreate a custom field (idempotent by name)

Events

ToolDescription
track-eventTrack a custom event for a contact; persists properties and triggers flows

Security

  • All operations are scoped to your project via X-Project-Id — no tool can read or modify another project's data
  • API keys are SHA-256 hashed at rest; plaintext is never stored
  • Rate limited to 30 requests per minute
  • Daily email send limits are enforced per your plan

Links