Connect Mailprompt to an MCP client
The Mailprompt MCP server exposes the same 36 tools as the Studio assistant: account overview, catalog, segments, flows, campaigns, email copy, images, coupons, forms, results, audits, suggestions and approval requests.
confirm: true; without it the call is a dry run that changes nothing.Hosted connector (OAuth)
The hosted server is a stateless Streamable HTTP endpoint at https://app.mailprompt.ai/api/mcp. It accepts POST only; a GET returns 405. Authentication is OAuth 2.1 with dynamic client registration, PKCE and a consent screen, so a client only ever holds a scoped token rather than an account key.
- Add
https://app.mailprompt.ai/api/mcpas a connector in the client. - The client discovers the authorization server from the protected-resource metadata and registers itself.
- Sign in to Mailprompt and approve the requested scopes. Only an owner or admin can authorize a connector.
- The client receives a one-hour access token and a rotating refresh token.
Clients request the read-only scopes by default: profiles:read, flows:read, campaigns:read, results:read. The authorization server advertises the full set below so a write scope can be granted deliberately.
| Scope | Used for |
|---|---|
profiles:read | Reading account data. |
profiles:write | Creating or changing drafts and data. |
events:write | Creating or changing drafts and data. |
lists:write | Creating or changing drafts and data. |
flows:read | Reading account data. |
flows:write | Creating or changing drafts and data. |
campaigns:read | Reading account data. |
campaigns:write | Creating or changing drafts and data. |
results:read | Reading account data. |
webhooks:read | Reading account data. |
webhooks:write | Creating or changing drafts and data. |
Revoking the connector in the client stops new tokens. An owner can also remove the client from the account. Each authorization emails the owner, so an unexpected connector is visible.
Local stdio package
The local server runs on your machine and proxies to the public API through the SDK. It reads MAILPROMPT_API_KEY and, optionally, MAILPROMPT_API_URL (default https://api.mailprompt.ai). A capability with no API endpoint answers tool_unavailable_in_stdio instead of pretending to work; use the hosted connector for those.
npx -y @mailprompt/mcpRead-only keys are the safer default for a local client. A key with write scopes can create drafts, and a key with no approval capability still cannot approve.
Claude Desktop
Add the server to the Claude Desktop configuration file, then restart the app. On macOS the file is ~/Library/Application Support/Claude/claude_desktop_config.json; on Windows it is %APPDATA%\Claude\claude_desktop_config.json.
{
"mcpServers": {
"mailprompt": {
"command": "npx",
"args": ["-y", "@mailprompt/mcp"],
"env": {
"MAILPROMPT_API_KEY": "mp_live_your_key"
}
}
}
}Claude Code
Use the CLI to register the local server with its environment variable:
claude mcp add mailprompt \
-e MAILPROMPT_API_KEY=mp_live_your_key \
-- npx -y @mailprompt/mcpOr add the hosted connector and complete the OAuth consent flow in the browser:
claude mcp add --transport http mailprompt https://app.mailprompt.ai/api/mcpCursor
Add the hosted connector to .cursor/mcp.json in the project (or the global Cursor config). Cursor opens the consent screen the first time the server is used.
{
"mcpServers": {
"mailprompt": {
"url": "https://app.mailprompt.ai/api/mcp"
}
}
}For the local package, use the same mcpServers block as Claude Desktop.
Tool list
Generated from the shared tool registry, so the list cannot drift from what the server actually exposes. 14 of 36 tools can cost credits and take a confirm flag.
| Tool | Scope | Credits | Description |
|---|---|---|---|
get_account_overview | read | Free | Read the account profile, plan, credit balance, brand kit summary, catalog/profile counts, flows, campaigns, forms, stores and sending domains. Read-only and free. |
crawl_site | write | May cost | Crawl the store homepage plus up to five same-origin pages (robots.txt respected, 2 MB per page) and rebuild the draft brand kit: logo, colours, fonts, voice sample, social links and postal address. The first crawl per account is free; later crawls cost 5 credits. |
update_brand_kit | write | Free | Update the draft brand kit (name, logo, colours, fonts, voice). Existing fields are merged, not replaced. Free and never sets an email live. |
list_products | read | Free | List catalog products for this store, filtered by search, stock, published state, collection, price range, sale, new arrivals, type or tag. Read-only and free. |
list_collections | read | Free | List collections and categories in this store, optionally filtered by title/handle, kind or published state. Read-only and free. Use the returned ids and URLs for collection links. |
find_link_targets | read | Free | Find the best product and collection pages in this store to link to, ranked for an email intent and keywords. Returns URLs, ids, prices and plain-English reasons. Read-only and free. Call it before writing any link. |
get_product | read | Free | Get one catalog product by id, store id or handle, including variants, collections, stock and its last-30-day performance. Read-only and free. |
get_collection | read | Free | Get one collection or category by id, store id or handle, with its URL, published state, in-stock product count, a few products and last-30-day performance. Read-only and free. |
create_segment | ai | May cost | Create a draft segment from a validated definition. Every referenced list, tag, metric, property, product, collection and segment is checked against this account and unknown names come back with the closest match. The deterministic plain-English summary is stored with it. Costs 1 credit and never emails anyone. |
preview_segment | read | Free | Validate a proposed segment definition (or a saved segmentId) and return the plain-English summary, a real count, ten sample profiles with masked emails, and validation errors with the closest matching name. Read-only and free. Uses a 5 second statement timeout and reports slow: true instead of hanging. |
preview_segment_count | read | Free | Count the profiles a saved segment (segmentId) or a proposed segment definition would match. Read-only and free. Prefer preview_segment: it also returns the summary and masked samples. Above 5,000 profiles a send needs human approval. |
describe_audience | read | Free | Describe this account's real audience catalog: profile counts by consent, lists, tags, metrics seen in the last year with their top event properties, profile properties with fill rate and samples, collections, top products by orders, spend percentiles and order-count distribution. Call this before building a segment. Cached 10 minutes and free. |
update_segment | ai | May cost | Save a new version of an existing segment. When a live flow or a scheduled campaign uses the segment, the change is stored as a pending human approval instead of being applied. Costs 1 credit. |
explain_segment | read | Free | Explain a segment in plain English and why one person is or is not in it, condition by condition. Read-only and free. Use the customer's email or a profile id from preview_segment. |
suggest_segments | read | Free | Return the built-in segment recipes that fit this account and have at least 20 real people (VIP, repeat buyers, win-back, cart abandoners, inactive, birthday, local and more), each with its definition, plain-English summary and count. Read-only and free. |
create_list | write | Free | Create a contact list (a group people join from a form, checkout, import or manual addition). A list records consent; it is not a rule. Free. |
add_to_list | write | Free | Add people to a list from explicit emails/profile ids, a segment snapshot or an import. Never grants marketing consent without evidence: pass consentEvidence with consented: true only when the source really captured it (form, confirmed import column, store opt-in); otherwise people stay never_subscribed and the response says so. Adding 1,000 or more people requires human approval. Free. |
remove_from_list | write | Free | Soft-remove people from a list. This does not unsubscribe them and does not delete their consent evidence. Free. |
import_contacts | write | Free | Import up to 5,000 contacts as profiles (consent status and timestamp preserved) and optionally add them to a list. Above 1,000 contacts the import needs a human approval: the tool returns the exact snapshot to pass to request_approval, then accepts approvalId. Free. |
create_flow | ai | May cost | Create a DRAFT flow (never live) from a trigger, audience and 1-50 steps. Every send step must reference an existing draft email document. Costs 10 credits. Going live needs a human approval. |
update_flow_step | write | May cost | Replace one step in a DRAFT flow by dot path (e.g. "0", "2.then.1"). Live flows refuse the edit: their changes need a human approval through request_approval. Costs 1 credit. |
create_campaign | ai | May cost | Create a DRAFT campaign from an existing email document and optional segment/schedule. Never sends; sending needs a human approval. Costs 5 credits. |
write_email | ai | May cost | Write a complete draft email block document from a brief, using the brand kit, real catalog product ids and coupon rule ids. Validates the contract, repairs once on a validation error, renders it and returns the pre-send + guardrail checks. Costs 1 credit. Never sends. |
rewrite_copy | ai | May cost | Rewrite a piece of email copy to a given instruction and tone. Returns plain text only. Costs 1 credit. |
generate_subject_lines | ai | May cost | Generate 1-10 subject-line options for a brief or an existing draft. Returns plain strings. Costs 1 credit. |
generate_image | ai | May cost | Generate a hero/lifestyle image, or a product scene that MUST start from a real catalog photo. Stored in our own storage and returned as our URL, never a provider URL. Costs 3 credits (fast) or 10 (premium/product scene). |
generate_image_from_attachment | ai | May cost | Generate or edit an image from an image the user attached. Use this for "make a lifestyle shot of this product" and "generate an image like this". Costs 3 credits (fast) or 10 (premium/product scene). The source attachment must exist in this account. |
upload_attachment | write | Free | Upload an image (base64, at most 10 MB, or a public https URL fetched through the SSRF guard) and return its attachmentId. Uploading is free. Use the id with tools that accept an attachmentId. |
create_coupon_rule | write | Free | Create a coupon rule (percentage or fixed amount off) that emails can reference. Never issues or sends a code. Free. |
create_form | ai | May cost | Create a DRAFT signup form (popup, flyout, embed, full page, spin-to-win) with AI-written copy from a brief, or explicit copy, plus display targeting. Never publishes the form. Costs 1 credit when a brief is used, otherwise free. |
get_results | read | Free | Read sent/opened/clicked counts, click-based attributed revenue and order counts for the last N days, optionally filtered to one flow or campaign. Read-only and free. |
explain_results | ai | May cost | Explain the numbers from get_results in plain language, with a concrete suggested next step. Never invents causes. Costs 1 credit. |
run_audit | read | Free | Run the free account audit: signup form and popup presence, SPF/DMARC/DKIM, and missing welcome/abandonment/browse/winback flows. Returns a 0-100 score and a fixable list. Free. |
suggest_this_week | ai | May cost | Produce 3-5 draft suggestions for what to send this week, based on real store data (best sellers, stock, flow gaps, recent campaign results). Creates Suggestion rows, never a campaign or send. Costs 1 credit. |
request_approval | approvals | Free | Create a pending Approval with a snapshot for a human OWNER/ADMIN to approve: taking a draft flow live, changing a live flow, sending a campaign or importing over 1,000 contacts. This is the ONLY tool that touches approvals, and it cannot approve anything itself. A campaign send approval already shows its recipient count, so it is the single human gate for a large audience. Failing guardrails block the request. Free. |
get_deliverability | read | Free | Read sending-domain status and health, account pause/warm-up state, and recent bounce and complaint counts. Read-only and free. |