Skip to main content
View as Markdown

MCP Server

The mailbot stdio MCP package lets local clients such as Claude Desktop, Claude Code, Cursor and Codex manage inboxes, send email and track engagement through structured tools. It runs locally with an integration API key.

Hosted Claude and ChatGPT connections require separate registration, routing and end-to-end verification; they are not announced as live. See Remote Connections for consent and unavailable states.

Published and candidate

Published. mailbot-mcp@0.1.0 is the version on npm (npm view mailbot-mcp version, 25 Nov 2026). In a test from a new account on 24 Nov 2026 its tools/list returned 12 tools: create_inbox, list_inboxes, get_inbox, send_message, list_messages, get_message, reply_to_message, list_threads, get_thread, replay_event, get_usage and get_engagement_stats. Two problems were found in that test: npx -y mailbot-mcp exited with code 0 without starting the server, and create_inbox failed because that version sends no Idempotency-Key.

Candidate, not published. The package source in this repository registers more tools (domains, approvals, webhook deliveries, key safeguards) than the published version. None of those, and no fix for the two problems above, is available from npm until a new version is published and checked on a fresh account. Until then, create inboxes with the REST API, which accepts an Idempotency-Key header, and treat the sections below as the candidate behavior.

Install​

npx mailbot-mcp

Or install globally:

npm install -g mailbot-mcp

Configuration​

Set your API key as an environment variable:

export MAILBOT_API_KEY=mb_your_api_key_here

Get your API key from the dashboard: create an integration key on the Billing page. It is shown once, so copy it and confirm in the dashboard that you saved it. The Dashboard sign-in entry in the key list only keeps your browser signed in and expires on its own; it does not work as MAILBOT_API_KEY. If you lose an integration key, create a new one and revoke the old one.

Claude Desktop​

Add this to your claude_desktop_config.json:

{
"mcpServers": {
"mailbot": {
"command": "npx",
"args": ["mailbot-mcp"],
"env": {
"MAILBOT_API_KEY": "mb_your_api_key_here"
}
}
}
}

Claude Code​

claude mcp add mailbot -- npx mailbot-mcp

Then set your API key in your environment.

Cursor​

Go to Settings > MCP Servers > Add Server and use the same config as Claude Desktop above.

Included Tools​

This list describes the candidate source (packages/mailbot-mcp/src/tools), not the published 0.1.0 package, which has only the 12 tools named at the top of this page. Parameters marked ? are optional.

Tools that create something or start a delivery take a required idempotency_key, a stable string of 8 to 255 characters. Generate it once per logical action and reuse it when you retry that action. The same key with the same payload returns the original result; the same key with a different payload is refused with IDEMPOTENCY_CONFLICT. Without a valid key the API answers 400 IDEMPOTENCY_KEY_REQUIRED.

ToolWhat it doesParameters
create_inboxCreate an inbox for sending and receivingusername, display_name?, domain?, idempotency_key
list_inboxesList inboxes in the accountpage?, limit?
get_inboxGet one inboxinbox_id
send_messageSend an email from an inboxinbox_id, to[], subject, body, cc[]?, bcc[]?, idempotency_key
reply_to_messageReply in the same threadinbox_id, message_id, body, idempotency_key
list_messagesList messages in an inboxinbox_id, since?, limit?, page?
get_messageGet one message with its stateinbox_id, message_id
list_threadsList conversations in an inboxinbox_id, limit?, page?
get_threadGet a thread with all its messagesinbox_id, thread_id
get_usageOutbound emails used this monthnone
get_engagement_statsOpens, clicks and bouncesinbox_id?, period?
replay_eventLegacy engagement replay; see limitationsevent_id, target_url?, idempotency_key
list_domainsList domains and verification freshnessnone
get_domainGet a domain with its verification expiry and missing DNS recordsdomain_id
add_domainAdd a custom domaindomain, idempotency_key
verify_domainRefresh DNS verification for a domaindomain_id
list_message_approvalsList outbound drafts waiting for approvalnone
get_message_approvalRead one approval draftmessage_id
approve_messageApprove and dispatch a held draftmessage_id, reason?, idempotency_key
reject_messageReject a held draftmessage_id, reason?, idempotency_key
get_message_status_historyInspect a message's delivery status historymessage_id
list_webhook_deliveriesInspect webhook delivery outcomeswebhook_id, status?, limit?, offset?
replay_webhook_deliveryReplay one failed webhook deliverywebhook_id, delivery_id, idempotency_key
get_api_key_safeguardsRead the safeguards of an API key you ownkey_id
update_api_key_safeguardsReplace the safeguards of an API key you ownkey_id, safeguards (canonical: { allowlist, budget, approval }; see below)
stop_api_keyStop sending for an API key you ownkey_id
resume_api_keyResume sending for an API key you ownkey_id

update_api_key_safeguards takes the canonical nested safeguards object. Flat top-level allowlist, budget and approval are accepted by stdio and remote as compatibility aliases only; new integrations should use safeguards.

{
"key_id": "00000000-0000-4000-8000-000000000000",
"safeguards": {
"allowlist": { "enforced": true, "emails": [], "domains": ["example.com"] },
"budget": { "per_hour": 100, "per_day": 1000 },
"approval": "required"
}
}

Remote clients need the mcp:write scope for every tool that is not a read.

Rules for agents:

  • Report an email as delivered only when get_message shows it delivered.
  • If a call got no answer, repeat the exact same call with the same idempotency_key: it returns the first result and never sends twice.
  • If a call came back with a server error (5xx), that key is locked. Check with get_message or list_messages. Send again, with a new idempotency_key, only if the message is not there.
  • If a call was refused (4xx), do not repeat it. The error names what to change. See Reading a Send Failure.
  • Engagement statistics can contain zero counts when signals are unavailable. Sandbox exposes delivered events only; missing opens or clicks do not prove zero engagement.

Example Usage​

Once connected, you can ask your AI assistant:

Adding and verifying a domain is available as tools. The DNS records themselves still have to be created at your DNS provider: see Custom Domain Setup.

Error Handling​

Every failed tool call returns the same lines, so an agent can read them without guessing:

The domain you send from is not verified yet.
Code: DOMAIN_NOT_VERIFIED (HTTP 400)
Where it stopped: sender domain, before anything was created
Retry: Do not retry yet. The same request fails again until you fix this.
Request ID: 3f9c1d2e
Next: Publish the DNS records for the domain, then run verify.

Retry is one of five answers: safe, wait, fix first, check first, or never. A server error or a dropped connection always says to read the message back before sending again. A request that got no answer says the same, because it may have arrived. The full list is in Reading a Send Failure.

Environment Variables​

VariableRequiredDefaultDescription
MAILBOT_API_KEYYes—Your mailbot API key (starts with mb_)
MAILBOT_API_URLNohttps://getmail.botAPI base URL