# agent-mail [Health: Active]

**Category:** 💬 Communication  
**Repository:** https://github.com/mailkite/mailkite-mcp  
**GitHub Stars:** 0  
**npm Downloads (last month):** 865  
**Views:** 1  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/agent-mail

## Description
Give an AI agent its own inbox — receive email as a webhook, send over a verified domain.

## Tools
Capabilities this server exposes over MCP:

- **mailkite_send** — Send a message over a verified domain. Pass `templateId` (+ optional `templateData`) to send from a saved or base template. Requires an API key (mk_live_…).
- **mailkite_send_batch** — Send one personalized message per recipient (up to 50) in a single call. Shared fields form the base message; each `recipients[]` entry gets its own message to exactly one address, with per-recipient `templateData` and `headers` merged over the shared ones. Every message passes the same gates as send() and gets its own id; the response reports each recipient's outcome in order, so a batch can partially succeed. Pass `scheduledAt` to park the whole batch for later (one cancelable ssnd_… per recipient). Requires an API key (mk_live_…).
- **mailkite_send_event** — Record one application-level fact about a user — `user.created`, `trial.expiring`, `payment.failed`. THE primary way a sequence starts on a developer platform: your application already knows when a payment failed, so it says so, and every enabled trigger listening for that name enrolls the contact with the payload as its input. Identify the subject with `email` or `contactId` (never both). Pass a `dedupeKey` to make retries idempotent: a repeat returns the original event with `duplicate: true` rather than enrolling anyone twice. Requires an API key (mk_live_…).
- **mailkite_list_events** — List recorded events, newest first — the surface for confirming a POST landed and for debugging a sequence that did not trigger. Filter by `name` and/or `email`. Requires an API key (mk_live_…).
- **mailkite_list_event_names** — List the distinct event names this account works with, so an editor can offer them instead of asking you to remember one. Returns both events actually posted (with a count and when one last arrived) and events your sequences already trigger on or wait for but that may never have been sent — sequences are routinely written before the application emits the event, so a list of only-what-you-have-sent would be a trap. Requires an API key (mk_live_…).
- **mailkite_list_sequences** — List your sequences, newest first, each with live enrollment counts. Archived sequences are omitted. Requires an API key (mk_live_…).
- **mailkite_create_sequence** — Create a sequence: a declared input shape, the steps a contact walks over time, and zero or more triggers. A sequence is a function — `input` is its signature, and every door must satisfy it, so a step's {{input.field}} means the same thing however it was started. Created as a draft unless you pass status "active". The whole definition is validated up front and every problem is reported at once, so you fix a program in one pass rather than one 400 at a time. Requires an API key (mk_live_…).
- **mailkite_get_sequence** — Get one sequence with its definition and live enrollment counts. Requires an API key (mk_live_…).
- **mailkite_update_sequence** — Edit a sequence. Changing the STEPS bumps its version and contacts already in flight keep walking the version they started on, so an edit can never make someone skip or repeat a step. Nothing else re-pins anybody — a rename, a pause, the input signature, and the trigger set are all editable while people are mid-flight. Archiving retires everyone in flight; pausing deliberately does not, so unpausing resumes rather than restarts. Requires an API key (mk_live_…).
- **mailkite_delete_sequence** — Delete a sequence and retire every contact still walking it. The response reports how many were canceled. Requires an API key (mk_live_…).
- **mailkite_list_triggers** — List the triggers attached to a sequence — the doors into it. Requires an API key (mk_live_…).
- **mailkite_create_trigger** — Attach a trigger: when this event arrives, enroll the contact it is about. Attaching never bumps the sequence's version and never touches anyone already in flight — a trigger is a fact about the outside world, a sequence is a program, and they change on different rhythms. The sequence needs a `from` address first, since an event-triggered enrollment has no message to inherit a sender from. Requires an API key (mk_live_…).
- **mailkite_update_trigger** — Edit a trigger, or toggle `enabled` to switch the door off without deleting it. Either way, everyone already walking the sequence carries on. Requires an API key (mk_live_…).
- **mailkite_delete_trigger** — Detach a trigger. Stops future enrollments through that door and nothing else. Requires an API key (mk_live_…).
- **mailkite_start_sequence** — Start a sequence for one contact, directly — when your code already knows WHICH sequence it wants. Takes a sequence NAME or id, so "start the dunning sequence" needs no lookup. Returns the enrollment it created: the run you then inspect, follow, or cancel. Refused with 409 when the address is suppressed, is already running on a `reentry: "once"` sequence, or is missing a required input — and the response says which. Reach for sendEvent instead when your code only knows what HAPPENED and policy should decide what reacts. Requires an API key (mk_live_…).
- **mailkite_stop_sequence** — Stop whatever is chasing someone. Pass the `cancelKey` you set when starting — so you cancel with your own invoice or order id and never store ours — or pass `sequence` and `email` together when you did not set one. Always answers 200 with a count, so it is safe to fire blindly from a webhook. Requires an API key (mk_live_…).
- **mailkite_list_enrollments** — List who is in a sequence and where each of them is. Filter with `status`. Requires an API key (mk_live_…).
- **mailkite_get_enrollment** — Get one enrollment — which sequence, which step, and what happens next. Requires an API key (mk_live_…).
- **mailkite_list_enrollment_runs** — Every step this enrollment has executed, with the outcome and the reason for it. This is the "why didn't step 3 fire" view. Requires an API key (mk_live_…).
- **mailkite_cancel_enrollment** — Cancel one specific run by its enrollment id — the per-row action when you are looking at the enrollments table. To stop whatever is chasing a contact without knowing which run, use stopSequence. Requires an API key (mk_live_…).
- **mailkite_upload_attachment** — Upload a file to MailKite storage and get back a secure, time-limited URL. Reference the returned `url` as an attachment in send() (`{ filename, url }`) or link it inline in your HTML — instead of base64-inlining large files on every send. Give the file ONE of four ways: a local `path` (read and streamed as raw bytes by the CLI/SDK/local MCP), a remote `url` (MailKite fetches and re-hosts it), base64 `content`, or — over raw HTTP — the file bytes as the POST body with `?filename=`. `retentionDays` (7/30/90/365, default 7) sets how long the file and URL live. Requires an API key (mk_live_…).
- **mailkite_list_templates** — List your saved email templates (light metadata only — no body). Use getTemplate for the full template. Requires a management session token.
- **mailkite_list_base_templates** — List the premade base templates (light metadata). Clone one with createTemplate({ baseId }) or send from it directly via send({ templateId }). Requires a management session token.
- **mailkite_get_template** — Get one template (full: subject, html, text, theme). Works for your templates (tpl_…) and base templates (base_…). Requires a management session token.
- **mailkite_create_template** — Create a template. Pass `baseId` to clone a base template into your own, or provide name/subject/html/text/theme directly. Requires a management session token.
- **mailkite_list_domains** — List your domains, each with its webhook URL. Requires a management session token.
- **mailkite_create_domain** — Add a domain. Returns the domain + DNS records. Paid plans may pass `email_provider_id` to choose a provider (list available providers with listEmailProviders); free plans are always pinned to the platform default (SES US East 2 production). Requires a management session token.
- **mailkite_suggest_subdomain** — Suggest a free, currently-unclaimed subdomain label to prefill the input with, plus the `base` zone it would live on. Read-only — suggesting does not reserve the name. Always take the zone from `base` rather than hard-coding it: which zones are on offer changes over time. Requires a management session token.
- **mailkite_check_subdomain** — Check whether a free subdomain label can be claimed. Read-only and cheap — call it as the user types. `reason` explains a rejection and is safe to show verbatim. Requires a management session token.
- **mailkite_claim_subdomain** — Claim a free MailKite subdomain — a `<label>.<base>` host on a zone we run (call suggestSubdomain for the current `base`; the pool changes over time and more than one may be offered). The fastest path to a sending identity: we host the zone, so it comes back already verified with an empty `dns` array — nothing for the customer to publish. Use it when you want onboarding to work without asking anyone to touch DNS; bring your own domain with createDomain when you want mail to come from your own name. Requires a management session token.
- **mailkite_get_domain** — Get one domain with DNS records + webhook. Requires a management session token.
- **mailkite_delete_domain** — Remove a domain. Requires a management session token.
- **mailkite_verify_domain** — Check DNS and update status. Requires a management session token.
- **mailkite_set_webhook** — Set or replace the domain's catch-all webhook. Requires a management session token.
- **mailkite_set_tracking_webhook** — Set or replace the domain's dedicated tracking-event webhook: an HTTPS endpoint that receives signed email.* engagement events (email.sent / email.bounced / email.complained / email.opened / email.clicked, shaped per the tracking-event schema) SEPARATELY from inbound mail. This is the split-endpoint override for consumers that keep engagement events away from their inbound webhook (e.g. django-anymail's paired views); most consumers should prefer setWebhookEvents, which delivers everything to the one inbound webhook. When both are configured, this URL wins for engagement events. Returns the signing secret (the same account secret as inbound deliveries). Requires a management session token.
- **mailkite_delete_tracking_webhook** — Remove the domain's tracking-event webhook (engagement events stop). Requires a management session token.
- **mailkite_set_webhook_events** — Opt the domain's inbound webhook into engagement events — one webhook, all events. Pass "all" or a list of email.* tracking types (email.sent / email.bounced / email.complained / email.opened / email.clicked) and MailKite delivers them to the same webhook route that receives the domain's inbound mail; consumers switch on the payload's `type` (inbound mail is type email.received, engagement events follow the tracking-event schema). Off by default, so existing inbound consumers never see event types they didn't opt into. Events at the inbound webhook are signed with that route's secret (account secret fallback) — the same key inbound deliveries already use. If a dedicated tracking webhook URL is set (setTrackingWebhook), engagement events go there instead. Requires a management session token.
- **mailkite_delete_webhook_events** — Opt the domain's inbound webhook back out of engagement events (inbound email.received only — the default). Requires a management session token.
- **mailkite_delete_webhook** — Remove the domain's webhook. Requires a management session token.
- **mailkite_test_webhook** — Send a signed test event to the domain's webhook. Requires a management session token.
- **mailkite_check_domain_availability** — Check whether a domain is available to register, and at what price. Read-only — no charge. Requires a management session token.
- **mailkite_register_domain** — Register (buy) a domain on the customer's behalf; provisions mail DNS and adds it to the account in one call. Charges the registrar. Requires a management session token. Does NOT register automatically — returns a dashboard link for the user to review the price and confirm. An assistant can never purchase a domain on its own.
- **mailkite_list_routes** — List inbound routing rules. Requires a management session token.
- **mailkite_create_route** — Create a route (match, action, destination). Requires a management session token.
- **mailkite_delete_route** — Delete an inbound routing rule by id. Pair with createRoute to register and tear down a webhook destination — e.g. an automation platform subscribing on enable and cleaning up on disable. Requires a management session token.
- **mailkite_agent** — Send a message to one of your inbox agents and get its reply. Defaults to the account's default agent; pass `routeId` or `address` to target a specific agent, or `model` to override the model. This is separate from inbound routing — it does not match or override routes. Requires an API key (mk_live_…).
- **mailkite_route** — Route a message to one of your registered routes (by `routeId` or `address`), running that route's action — agent, webhook, or forward. The route must already exist on your account; arbitrary destinations are not allowed. Requires an API key (mk_live_…).
- **mailkite_list_messages** — List stored messages, newest first. Optionally filter with `search` (matches sender, recipient, or subject) and page with `before` (a `received_at` cursor) and `limit`; omit all for the default newest 100. Response is a bare array — paginate by passing the last row's `received_at` as the next `before`. Requires a management session token.
- **mailkite_get_message** — Get a message with deliveries + attachments. Requires a management session token.
- **mailkite_retry_delivery** — Re-deliver a stored message to its webhook. Requires a management session token.
- **mailkite_retry_deliveries** — Replay a whole selection of webhook deliveries in one call — the bulk form of retryDelivery. Pass `deliveryIds` (replay those exact deliveries), `messageIds` (replay each message's most recent delivery per route), and/or `threadIds` (expanded server-side to every message in the conversation); they combine. At most 50 ids per request, so send larger selections as sequential batches. Always answers 200 with a per-id `results` array — one unreachable endpoint never hides the outcomes of the rest — so branch on `ok` and `results`, not the HTTP status. An id you don't own is reported as skipped with reason `not_found`, exactly as the single-delivery endpoint 404s. Requires a management session token.
- **mailkite_list_delivery_attempts** — Every captured attempt for one delivery, newest first: the request headers and payload we POSTed, and the status, headers, and body that came back. This is the per-attempt record behind a webhook post-mortem, fetched without pulling the whole message. Captures are retained for 45 days. Requires a management session token.
- **mailkite_deliver_to_route** — POST stored messages to one webhook route — including messages that arrived BEFORE the route existed, which no retry can reach (a retry replays an existing delivery row, and a new route has none). Use listRouteCandidates to find what a route could be sent. Webhook routes only: a forward would re-send real mail to a third party and an agent would re-spend model tokens, so both answer 400 `route_action`. At most 50 ids per request; same per-id `results` contract as retryDeliveries. Requires a management session token.
- **mailkite_list_route_candidates** — Stored inbound messages this route could be asked to deliver, newest first — the preview for replaying mail to a route defined after that mail arrived. Each row carries `delivered_here`, so you can send a route only what it has never seen. Page with `before` (the response's `nextBefore`); because matching happens after a bounded scan, a page can come back shorter than `limit` while more still remain — keep going until `nextBefore` is null. Requires a management session token.
- **mailkite_create_realtime_token** — Mint a short-lived, single-use token that authorises one Realtime API connection. For browsers: EventSource cannot set headers, so this is what a page passes as ?token= instead of putting an API key in a URL. Inherits the calling credential's scope, expires in five minutes, and burns on first use. The stream itself is GET /v1/realtime — a subscription, not a request/response call, so it is contracted in sdks/spec/realtime.json rather than here. Requires an API key (mk_live_…).
- **mailkite_list_lists** — List your contact lists (static, curated broadcast audiences), each with its member count. Requires a management session token.
- **mailkite_create_list** — Create a contact list. Returns the list with its id (lst_…); add contacts with addListContacts. Requires a management session token.
- **mailkite_get_list** — Get one contact list with its member count. Requires a management session token.
- **mailkite_update_list** — Rename a contact list. Requires a management session token.
- **mailkite_delete_list** — Delete a contact list. The list is removed; the contacts themselves are kept. Requires a management session token.
- **mailkite_list_list_contacts** — List the contacts that are members of a list, newest first. Optionally page with `before` (a `last_seen_at`/`created_at` cursor) and `limit`. Response is a bare array — paginate by passing the last row's `last_seen_at` (or `created_at`) as the next `before`. Requires a management session token.
- **mailkite_add_list_contacts** — Add contacts (by id, ctr_…) to a list. Returns how many were newly added; contacts already on the list are ignored. Requires a management session token.
- **mailkite_remove_list_contact** — Remove one contact from a list (the contact itself is kept). Requires a management session token.
- **mailkite_list_broadcasts** — List your broadcasts (one-to-many sends) with status and send stats. Requires a management session token.
- **mailkite_create_broadcast** — Create a broadcast draft. `from` is required; set `audience` to { type: "all" } or { type: "list", id: "lst_…" }. Returns the broadcast with its id (bct_…). Send it with sendBroadcast. Requires a management session token.
- **mailkite_get_broadcast** — Get one broadcast with its status and recipient summary. Requires a management session token.
- **mailkite_update_broadcast** — Edit a draft broadcast (any of from/subject/audience/html/… ). Drafts only. Requires a management session token.
- **mailkite_delete_broadcast** — Delete a broadcast draft. Requires a management session token.
- **mailkite_send_broadcast** — Send a broadcast now, or pass an ISO 8601 `scheduledAt` to schedule it. A one-click unsubscribe is always added. Returns the status and resolved audience count. Requires a management session token. Does NOT register automatically — returns a dashboard link for the user to review the price and confirm. An assistant can never purchase a domain on its own.
- **mailkite_verify_webhook** — Verify the `x-mailkite-signature` header on an inbound webhook delivery. Runs entirely locally (HMAC-SHA256 over `${t}.${payload}`) — no network call. Returns true only when the signature matches and the event is within the freshness window. Runs locally (no API call) — no credentials needed.
- **mailkite_semantic_search** — Semantic search over the MailKite documentation — returns the most relevant doc sections for a natural-language query (hybrid vector + keyword search over https://mailkite.dev/docs). Public; no authentication required. Requires an API key (mk_live_…).
- **mailkite_register_oauth_client** — Register an OAuth client for this installation (RFC 7591 dynamic client registration) — step 1 of linking an existing MailKite account to your app. No pre-shared secret and no manual app review: you get a client_id back immediately and prove yourself with PKCE. Register once per install and keep the client_id. Requires a management session token.
- **mailkite_exchange_oauth_token** — Exchange an authorization code for an access token (or rotate a refresh token) — step 3 of linking. Between steps you send the user's browser to /oauth/authorize with your client_id, redirect_uri, state, and an S256 code_challenge; they sign in with whatever method they already use and approve, and the code comes back to your redirect_uri. Then call getApiKey with the access token and store the key. Requires a management session token.
- **mailkite_get_api_key** — Get the account's unrestricted API key (mk_live_…). Read-or-create: the first call mints it. Requires a management session token.
- **mailkite_rotate_api_key** — Rotate the account API key: the old key stops working immediately and a fresh one is returned. The plaintext is only shown here. Requires a management session token.
- **mailkite_list_scoped_keys** — List the account's domain-scoped API keys. A scoped key can send and manage only its one domain — hand one to each site or CI job so a leak burns only that surface. Requires a management session token.
- **mailkite_create_scoped_key** — Create a key scoped to one domain. Ideal for per-site installs (e.g. a WordPress plugin) — the site never holds the account master key. Requires a management session token.
- **mailkite_delete_scoped_key** — Revoke a domain-scoped key. Takes effect immediately. Requires a management session token.
- **mailkite_list_app_passwords** — List the account's app passwords. Each one opens a mailbox over IMAP and/or the mailbox API, scoped to a domain and an address pattern within it. Requires a management session token.
- **mailkite_create_app_password** — Create an app password for one domain and address pattern. Hand it to a mail client or an agent — the secret is returned once and never again. Requires a management session token.
- **mailkite_update_app_password** — Change what an app password covers — its label, address pattern, or protocols. The domain is fixed for the life of the password: repointing a live credential would hand its holder mail they were never granted, so create a new password instead. Requires a management session token.
- **mailkite_rotate_app_password** — Replace an app password's secret, keeping its scope. The old secret stops authenticating immediately; the new one is returned once. Use after a leak, when revoking would mean reconfiguring every client. Requires a management session token.
- **mailkite_delete_app_password** — Revoke an app password. Takes effect immediately — any IMAP session or API call using it stops authenticating. Requires a management session token.
- **mailkite_list_mailbox_messages** — List a mailbox's messages, newest first. Authenticated with an app password granting `api` — this is how an agent reads its own inbox without an IMAP client. Requires a management session token.
- **mailkite_get_mailbox_message_raw** — Fetch one message's raw RFC822 bytes from a mailbox. Same app password auth as the list. Requires a management session token.
- **mailkite_set_mailbox_message_flags** — Replace a message's IMAP flags (e.g. mark it `Seen`). Flags set here are the same ones an IMAP client sees. Requires a management session token.
- **mailkite_get_usage** — Current billing-period usage: emails used vs the plan's included bucket (null = unlimited), AI actions, and the overage state that gates sending. Powers quota meters in dashboards and integrations. Requires a management session token.
- **mailkite_list_suppressions** — List suppressed addresses (unsubscribes, hard bounces, spam complaints, manual). Sends to a suppressed address are dropped before delivery. Requires a management session token.
- **mailkite_add_suppression** — Suppress an address so this account never sends to it again (reason defaults to manual). Requires a management session token.
- **mailkite_remove_suppression** — Remove an address from the suppression list (URL-encode the email in the path). Removing an unsuppressed address is a no-op success. Requires a management session token.
- **mailkite_register** — Create a MailKite account from just an email — no password. Returns the new account's API key immediately; a verification link is emailed, and SENDING stays blocked until the address is verified (poll me()). An existing email returns 409 account_exists with no credentials. Powers plugin/CLI onboarding. Requires a management session token.
- **mailkite_me** — The account behind this credential: email, whether it is verified (sending is blocked until it is), and plan. Use to poll verification state after register(). Requires an API key (mk_live_…).

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "agent-mail": {
    "command": "npx",
    "args": ["-y","@mailkite/mcp"],
    "env": {
      "MAILKITE_API_KEY": ""
    }
  }
}
```

**Requires environment variables:** `MAILKITE_API_KEY` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What the agent-mail MCP server does

The agent-mail MCP server exposes MailKite's email API through the Model Context Protocol. Agents can send individual messages or personalized batches, upload attachments, read stored messages, and retry webhook delivery. Sending is tied to a verified MailKite domain.

The server also covers the configuration around email delivery. It can create, inspect, verify, and remove domains; check domain availability; register a domain; and manage DNS information returned by MailKite. Template tools list saved and base templates, retrieve full template content, and create new templates.

Inbound email can be connected to a catch-all webhook or routed with rules. Routes can send a message to an inbox agent, webhook, or forwarding destination. The available agent and route tools also let an AI workflow invoke an inbox agent directly or run a registered route. Contact-list inspection is available through the list tool.

## How the agent-mail MCP server works

The package is generated from MailKite's shared API contract, with one MCP tool for each supported API method. An MCP client invokes those tools, while MailKite performs the underlying email, domain, routing, and storage operations.

Two connection patterns are documented. The local option starts `@mailkite/mcp` with `npx` and passes `MAILKITE_API_KEY`. The hosted option uses `https://mcp.mailkite.dev/mcp` over HTTP and supports browser authentication through OAuth, so a locally copied API key is not needed for that setup.

Webhook configuration supports more than inbound delivery. A domain can use a separate HTTPS tracking webhook for signed engagement events such as sends, bounces, complaints, opens, and clicks. Alternatively, engagement events can be enabled on the inbound webhook. The server can send a signed test event and remove either webhook configuration.

## Setup and configuration

For a local MCP configuration, run the package with `npx -y @mailkite/mcp` and set `MAILKITE_API_KEY` to a MailKite live key. This mode is suitable for local use, offline workflows, and CI where a static key is available.

For the hosted setup, add the MailKite MCP endpoint to a compatible client and authenticate in the browser when prompted. Before sending mail, configure a domain and complete its DNS verification; domain tools expose the relevant DNS records and webhook URL.

## Tools and capabilities

The agent-mail MCP server includes tools for:

- Sending one message or up to 50 personalized recipient messages in one call.
- Uploading attachments and receiving secure, time-limited URLs.
- Creating and retrieving templates, including subject, HTML, text, and theme fields.
- Managing domains, availability checks, registration, DNS verification, and webhooks.
- Creating and deleting inbound routes and executing a route by ID or address.
- Listing stored messages, retrieving delivery and attachment details, and retrying delivery.
- Calling inbox agents and listing contact lists with member counts.

_Full upstream README: https://allmcps.com/mcp/agent-mail/readme_

