Docs

MCP

Use inboxes as MCP tools from Claude Code, Cursor, Codex and other MCP clients.

View as Markdown

The MCP server runs at https://api.mueslimail.com/mcp over streamable HTTP. It uses the same API key as REST, in X-Api-Key or Authorization: Bearer, and the same rules: plan limits, idempotency, organization isolation and scoped permissions. Tool calls are written to the audit log.

Claude Code

MCP (Claude Code)
claude mcp add --transport http mueslimail https://api.mueslimail.com/mcp --header "X-Api-Key: $KEY"

Cursor

Add the server to .cursor/mcp.json in your project, or to the global MCP settings:

MCP (Cursor)
{
  "mcpServers": {
    "mueslimail": {
      "url": "https://api.mueslimail.com/mcp",
      "headers": { "X-Api-Key": "${env:MAI_API_KEY}" }
    }
  }
}

Codex

MCP (Codex)
# ~/.codex/config.toml, sends the key as a bearer token
[mcp_servers.mueslimail]
url = "https://api.mueslimail.com/mcp"
bearer_token_env_var = "MAI_API_KEY"

Other clients: any MCP client that supports streamable HTTP with a custom header or a bearer token can connect with the same URL. Give agents a scoped key with only the permissions they need.

Tools

ToolWhat it does
create_inboxCreate an email inbox for an agent. Optional username, domain, display_name, client_id.
list_inboxesList inboxes, newest first.
delete_inboxDelete an inbox with all its mail. Irreversible; the address stays reserved for 90 days.
list_threadsList conversation threads of an inbox, or of all inboxes.
get_threadGet a thread with the messages the key may see, oldest first.
list_messagesList message metadata of an inbox (no bodies).
get_messageGet one message with body, extracted_text, authentication results and gatekeeper verdict.
send_messageSend a new email from an inbox. Starts a new thread. Accepts idempotency_key.
reply_to_messageReply in the same thread; threading headers are set for you. Accepts idempotency_key.
update_message_labelsAdd or remove custom labels to track workflow state.
create_draftSave an email as a draft for review or later sending; in_reply_to keeps the thread, send_at schedules it.
list_draftsList drafts of an inbox, newest first.
send_draftSend a draft now; it is deleted once queued. Accepts idempotency_key.
get_attachmentDownload an attachment: text files as text, others as base64 (max 5 MB).
list_domainsList domains usable for inboxes, with DNS records and verification status.
release_messageRelease a message held for security review. Needs message_release; meant for a human reviewer, not the agent.
create_ticketOpen a ticket on a thread so a human follows up. Needs ticket_write.
list_ticketsList the support queue, newest activity first. Filter by state, priority, assignee or text, or start from a saved view by name.
get_ticketRead one ticket with its timeline and internal notes.
update_ticketChange state, priority or tags. Needs ticket_write; refusals are explicit.
assign_ticketTake a ticket or hand it to a person. Needs ticket_write.
add_ticket_noteLeave an internal note for the human. It can never be emailed to the customer.
reply_ticketAnswer the customer on the ticket thread. Needs message_send, as any reply does.