AI agents
MCP server
A hosted Model Context Protocol server that gives Claude, Cursor, VS Code and any other MCP client 68 typed tools covering the whole MailCraft API — sending, contacts, campaigns, automations, domains and analytics. Nothing to install.
Connect
The server speaks Streamable HTTP at https://mcp.mailcraft.host and authenticates with the same sk_… API keys as the REST API, sent as a Bearer token. Create a key under Settings → API keys — the dashboard shows this config with your key already filled in.
claude mcp add --transport http mailcraft https://mcp.mailcraft.host \
--header "Authorization: Bearer sk_live_••••••••"Prefer signing in? Clients that support OAuth — like claude.ai custom connectors — only need the URL. They open a MailCraft consent screen where you pick the workspace and what the agent may do, and a key is created for that connection. Revoke it under Settings → API keys to disconnect.
Claude Desktop's config file only launches local processes, so it connects through the mcp-remote bridge (requires Node.js). Keep keys out of files you commit.
Step-by-step guides
Exact config files, paths and checks for each client.
Claude Code
Anthropic’s agentic coding tool for the terminal.
Claude Desktop
The Claude app for macOS and Windows.
Cursor
The AI code editor.
Windsurf
The AI editor with Cascade.
VS Code
Visual Studio Code with Copilot agent mode.
GitHub Copilot
Copilot in your editor and the Copilot coding agent.
Gemini CLI
Google’s open-source AI agent for the terminal.
OpenCode
The open-source AI coding agent.
OpenAI Codex
OpenAI’s coding agent for the terminal and IDE.
Antigravity
Google’s agent-first development platform.
Scopes decide what an agent can do
Every tool except get_workspace needs one API key scope. Tools outside the key's scopes aren't listed, can't be found through search and can't be called — so a send-only key gives an agent exactly the email tools and nothing else. Each tool acts on the one workspace that owns the key.
How agents find tools
To keep your agent's context small, only the most-used tools are listed up front:
get_workspacesend_emaillist_emailsget_emailvalidate_email_addressget_email_metricsupsert_contactlist_templateslist_senders Everything else is one step away: the agent calls search_tools with a few words ("create campaign", "segment") to get exact names and input schemas, then runs up to ten of them in one execute_tools call. Clients handle this on their own — you just ask for what you want.
Errors
Failures are written for the agent to act on, not retry blindly.
- Missing, invalid or revoked key
- HTTP 401 with a WWW-Authenticate header — the client asks you to reconnect.
- Invalid arguments
- A tool error naming each field to fix, worded exactly like the REST API’s validation messages.
- Business rules
- Plan limits, unverified senders, suppressed recipients and blocked state changes come back as plain-English tool errors.
- Unknown or foreign ids
- “No contact with that id exists in this workspace” — another workspace’s records look exactly like missing ones.
- Rate limits
- Tool calls share your plan’s API rate limit; listing tools, initializing and pings are free.
All 68 tools
One tool per REST endpoint, with the same validation and the same response shapes — see the API reference for field-level detail. Tools that send email or can't be undone are marked, and well-behaved agents confirm them with you first.
Workspace
any scopeget_workspaceDescribe the MailCraft workspace this connection acts on: its name, plan and limits (null means unlimited), and which scopes the API key holds.
Always listedRead-only
Emails & metrics
emails:sendsend_emailSend one transactional email immediately.
Always listedSends / calls outlist_emailsList emails sent from the workspace, newest first, with delivery status, opens and clicks.
Always listedRead-onlyget_emailGet one sent email by id: status, recipients, subject, timestamps, opens, clicks and any error.
Always listedRead-onlyvalidate_email_addressCheck whether an address is worth sending to: valid format, a domain that accepts mail (MX record), and not a disposable inbox.
Always listedRead-onlyget_email_metricsDaily sending metrics — sent, delivered, opened, clicked, bounced, complained — plus totals for the period.
Always listedRead-onlyget_reputationThe workspace's bounce and complaint rates over the last 7 days, and whether they are within safe sending thresholds.
Read-only
Contacts, lists & segments
contacts:manageupsert_contactCreate a contact, or update the existing one with the same email.
Always listedWriteslist_contactsList the workspace's contacts, newest first, with subscription status and custom properties.
Read-onlyget_contactGet one contact with their subscription status and custom properties.
Read-onlydelete_contactDelete a contact from the workspace, removing them from all lists and automations.
Destructiveunsubscribe_contactUnsubscribe a contact and suppress their address, so no campaign or automation emails them again.
Writeslist_contact_listsList the lists a contact belongs to.
Read-onlyadd_contact_to_listsAdd a contact to one or more lists.
Writesremove_contact_from_listRemove a contact from one list.
Writeslist_propertiesList the workspace's custom contact properties (key, label, type).
Read-onlycreate_propertyRegister a typed custom contact property (e.g.
Writesdelete_propertyPermanently remove a custom contact property definition.
Destructivelist_listsList the workspace's contact lists (static lists, and dynamic lists backed by a segment).
Read-onlyget_listGet one contact list.
Read-onlycreate_listCreate a contact list, optionally with its properties.
Writesset_list_propertiesChoose the properties a list shows and collects, in order.
Writeslist_list_contactsList the contacts on a list with their property values.
Read-onlyadd_contact_to_listAdd or update a contact on a list, with property values.
Writesdelete_listPermanently delete a contact list.
Destructivelist_segmentsList the workspace's segments — saved contact filters — with how many contacts each matches.
Read-onlyget_segmentGet one segment, including its filter conditions and matching contact count.
Read-onlycreate_segmentSave a contact filter as a segment and count how many contacts match.
Writesdelete_segmentPermanently delete a segment.
Destructive
Templates
templates:managelist_templatesList the workspace's email templates.
Always listedRead-onlyget_templateGet one template with its subject, HTML and text bodies and variables.
Read-onlycreate_templateCreate an email template.
Writesupdate_templateUpdate a template.
Writesdelete_templatePermanently delete a template.
Destructivelist_template_foldersList the workspace's template folders.
Read-onlycreate_template_folderCreate a folder to organise templates.
Writesdelete_template_folderDelete a template folder.
Destructive
Campaigns
campaigns:managelist_campaignsList the workspace's campaigns with their status and send stats.
Read-onlyget_campaignGet one campaign: audience, template, sender, status and delivery stats.
Read-onlycreate_campaignCreate a draft campaign: one template sent from one sender to either a list or a segment (not both).
Writessend_campaignSend a draft campaign to its whole audience right now.
Sends / calls outdelete_campaignPermanently delete a campaign and its send history.
Destructive
Automations
automations:managelist_automationsList the workspace's automations with their status (draft, active, paused) and trigger.
Read-onlyget_automationGet one automation with its trigger, ordered steps, and how many contacts are active, waiting, completed, exited or failed.
Read-onlycreate_automationCreate a draft automation — a trigger plus a sequence of steps — in one call.
Writesupdate_automationRename an automation or change its trigger.
Writesset_automation_stepsReplace an automation's entire step sequence (pass every step, in order — omitted steps are removed).
Writesactivate_automationTurn an automation on.
Sends / calls outpause_automationPause an active automation.
Writesdelete_automationPermanently delete an automation.
Destructivelist_automation_enrollmentsList the contacts that have gone through an automation, newest first, with where each one is and why any exited or failed.
Read-onlyenroll_contactStart an existing contact on an active manual- or api-triggered automation, by contact id or email.
Sends / calls outremove_automation_contactsTake every contact that is partway through an automation out of it; they get no further steps.
Destructive
Domains
domains:managelist_domainsList the workspace's sending domains with their verification status and the DNS records each one needs.
Read-onlyget_domainGet one sending domain, including the DKIM/SPF DNS records to publish and whether it is verified.
Read-onlycreate_domainRegister a domain to send from.
Sends / calls outverify_domainRe-check a domain's DNS records now and update its verification status.
Sends / calls outdelete_domainPermanently remove a sending domain.
Destructive
Senders
senders:managelist_sendersList the workspace's sender addresses.
Always listedRead-onlyget_senderGet one sender address and whether it is verified.
Read-onlycreate_senderAdd a sender address on one of the workspace's domains (the address must be on that exact domain).
Writesdelete_senderPermanently remove a sender address.
Destructive
Suppressions
suppressions:managelist_suppressionsList addresses that will never be sent to — hard bounces, spam complaints, unsubscribes and manual blocks — newest first.
Read-onlyadd_suppressionBlock an address from receiving any email from this workspace.
Writesremove_suppressionTake an address off the suppression list so it can receive email again.
Destructive
Webhooks
webhooks:managelist_webhooksList the workspace's webhook endpoints and the events each one receives.
Read-onlycreate_webhookRegister an endpoint that receives signed POST requests when email or contact events happen (delivered, bounced, opened, contact created, …).
Writesdelete_webhookPermanently remove a webhook endpoint; it stops receiving events immediately.
Destructive