Skip to main content
Glama
Mektup-mcp

Mektup-mcp

Mektup MCP Server

Mektup is a fully-managed, multi-domain email platform - Mektup hosts all the mail infrastructure, so there's nothing to self-host; you just sign up and use it. This MCP server lets an AI coding agent (Claude Code, Claude Desktop, Cursor, Lovable, Replit, Base44, or any MCP-compatible client) manage real email for a domain — register it, add the DNS records, create mailboxes, send and read mail, manage drafts/contacts/folders/forwarding/vacation replies — as native tool calls inside its own session, instead of the human hand-writing curl commands or pasting an API key into generated code.

Every tool call is a straight HTTP call to the real Mektup REST API. There's no separate logic to learn — if you understand the API, you understand the MCP server. Full coverage: every REST endpoint has a matching tool, verified with real read and write round-trips against the live production API (create → update → list → delete, confirmed at each step).

Two ways to run it, same tool set either way (lib/build-server.js defines the tools once, shared by both):

  • Remote (Streamable HTTP) — a server we host at https://mcp.usemektup.com/mcp. Point any client that takes a "custom MCP server" URL at it directly, no install. This is what Lovable/Cursor/Replit/Base44-style platforms want.

  • Local (stdio) — run server.js yourself with your key in an env var. For MCP clients that only support launching a local process (Claude Desktop config, etc.).


Endpoint: https://mcp.usemektup.com/mcp (Streamable HTTP — supports both the direct-JSON-response and SSE-streaming response modes of the spec).

Stateless: no session is kept between requests — every tool call is already a one-shot passthrough to the REST API, so there's no session state worth keeping.

Tenant isolation: identical to the REST API, because it is the REST API underneath — the server holds no account-specific credential itself, it just forwards whichever token the caller sent (API key or OAuth access token, see below) straight through to api.usemektup.com, which is the only place that actually verifies it. A token only ever sees its own account's data.

Two auth modes, same endpoint, both arrive as the same Authorization: Bearer <token> header:

For a platform with real end users (Lovable, Cursor, Replit, Base44, ...) — the user clicks "connect," signs in with their existing Mektup account, approves, done. No token copy-paste, no dashboard visit.

Clerk (clerk.usemektup.com) is the OAuth 2.1 authorization server — this MCP server is only ever a resource server. Discovery is automatic for any spec-compliant OAuth-capable MCP client: it only needs the endpoint URL above and finds the rest itself via https://mcp.usemektup.com/.well-known/oauth-protected-resource/mcp (RFC 9728), which points at Clerk's own https://clerk.usemektup.com/.well-known/oauth-authorization-server (RFC 8414). From there the client registers itself via Dynamic Client Registration (no manual setup needed on your end) and runs a standard Authorization Code + PKCE flow, ending with a JWT access token used exactly like an API key.

Lovable: Connectors → All → Custom (MCP card) → Server Name Mektup, Server URL https://mcp.usemektup.com/mcp, Auth → OAuth (default when a server supports it) → Add & authorize.

API key (simplest for a single account, scripts, or a client without OAuth support)

Authorization: Bearer mek_live_... — create one at app.usemektup.com → API keys.

Adding it to a client that supports custom MCP connectors is normally 3 fields:

Field

Value

Server URL

https://mcp.usemektup.com/mcp

Auth type

Bearer token / API key

Token

your mek_live_... key

Cursor / Claude Desktop / any client that reads raw MCP JSON config:

{
  "mcpServers": {
    "mektup": {
      "url": "https://mcp.usemektup.com/mcp",
      "headers": { "Authorization": "Bearer mek_live_..." }
    }
  }
}

Replit / Base44 / other "connect a tool" flows: same three fields as the table above — server URL, Bearer auth, key.


Related MCP server: Mail-MCP

Local (stdio) setup

Use this when a client can only launch a local process, not call a remote URL.

1. Get an API key. Sign in to the dashboard at app.usemektup.com, open API keys, and create one. Keys look like mek_live_... and are shown exactly once - copy it immediately.

2. Install dependencies:

git clone https://github.com/WeeCi/mektup-mcp.git
cd mektup-mcp
npm install

3. Configure your MCP client to run server.js with the key as an environment variable. For Claude Desktop / Claude Code, add to your MCP config (e.g. claude_desktop_config.json):

{
  "mcpServers": {
    "mektup": {
      "command": "node",
      "args": ["/absolute/path/to/mektup-mcp/server.js"],
      "env": {
        "MEKTUP_API_KEY": "mek_live_..."
      }
    }
  }
}

MEKTUP_API_BASE_URL is optional and defaults to https://api.usemektup.com — no need to set it under normal use.

The server refuses to start without MEKTUP_API_KEY set.


How tools respond

Every tool returns its result as JSON text on success. On failure, it returns isError: true with Error: <message> — the message is the same one the underlying REST endpoint returned (see the API reference for exact error conditions, including billing-limit 402s, per endpoint).


Tools

Account

Tool

Input

Description

get_me

—

Get the authenticated account identity. Useful as an auth health check.

get_usage

—

Current billing tier, its limits, and real usage against them. Check before a bulk operation.

API keys

Tool

Input

Description

list_api_keys

—

List keys on this account (prefix and status only).

create_api_key

—

Create a new key. The full key is returned exactly once - surface it to the user immediately so they can save it.

revoke_api_key

id

Revoke a key immediately. Cannot be undone - confirm with the user first, especially if it might be the key this very session is using.

Domains

Tool

Input

Description

create_domain

domain

Register a domain, get back the exact DNS records (MX/SPF/DMARC/DKIM) and a setup recommendation. Never touches DNS itself.

list_domains

—

List every domain on this account.

get_domain_records

domain

Re-fetch a registered domain's DNS records any time after creation.

verify_domain

domain

Actively re-check live DNS and flip verified once it matches. Not automatic.

delete_domain

domain

Delete a domain and everything under it. Destructive — confirm with the user first.

Mailboxes

Tool

Input

Description

create_mailbox

domain, localPart, password?

Create a mailbox with real IMAP/SMTP-AUTH credentials, usable in any mail client.

list_mailboxes

domain

List mailboxes on a domain.

reset_mailbox_password

domain, localPart, password?

Reset a mailbox's login password. Shown once.

delete_mailbox

domain, localPart

Delete a mailbox. Confirm with the user first.

Webhooks

Tool

Input

Description

get_mailbox_webhook

domain, localPart

Check a mailbox's configured webhook URL (never returns the signing secret).

set_mailbox_webhook

domain, localPart, url, regenerateSecret?

Set/update the URL that fires (HMAC-signed) on every new inbound message - how an agent finds out about new mail without polling list_messages. Returns the signing secret once, on first setup or rotation.

delete_mailbox_webhook

domain, localPart

Remove a mailbox's webhook.

Forwarding

Tool

Input

Description

list_forwards

domain, localPart

List addresses that get a copy of incoming mail.

add_forward

domain, localPart, forwardTo

Add a forwarding address.

remove_forward

domain, localPart, id

Remove a forwarding address.

Identity

Tool

Input

Description

get_identity

domain, localPart

Get display name and signature.

set_identity

domain, localPart, displayName?, signatureText?, signatureHtml?

Set display name/signature, applied automatically to outgoing mail.

Vacation / auto-reply

Tool

Input

Description

get_vacation

domain, localPart

Get vacation auto-reply settings.

set_vacation

domain, localPart, enabled, subject?, message?

Enable/configure auto-reply. message required when enabling.

Folders

Tool

Input

Description

list_folders

domain, localPart

List custom folders.

create_folder

domain, localPart, name

Create a folder.

delete_folder

domain, localPart, id

Delete a folder (mail in it falls back to Inbox/Sent).

Contacts

Account-level, not per-mailbox.

Tool

Input

Description

list_contacts

—

List contacts.

create_contact

name?, email

Add a contact.

update_contact

id, name?, email?

Partially update — only send fields to change.

delete_contact

id

Delete a contact.

Drafts

Tool

Input

Description

list_drafts

domain, localPart

List drafts (metadata only).

get_draft

domain, localPart, id

Get a draft including its body.

create_draft

domain, localPart, to?, subject?, text?, html?

Create a draft.

update_draft

domain, localPart, id, to?, subject?, text?, html?

Partial update (autosave-friendly).

delete_draft

domain, localPart, id

Delete a draft.

Sending

Tool

Input

Description

send_email

from, to, subject, text?, html?, attachments?, draftId?

Send real mail. from must be a mailbox on this account, or any address on a domain this account has verified. Attachments are {filename, contentType?, contentBase64}, max 10MB decoded each. Pass draftId to delete a draft on successful send.

Example:

send_email({ from: "hello@example.com", to: "you@gmail.com", subject: "It works", text: "Real mail, sent through Mektup." })
→ { "messageId": "<...@example.com>", "envelope": { "from": "hello@example.com", "to": ["you@gmail.com"] } }

Messages & threads

Tool

Input

Description

list_messages

mailbox, limit?, direction?, trash?, folder?, q?

List messages (one row per thread). Pass direction to split Inbox/Sent — omitting it merges both.

get_delivery_stats

mailbox, days?

Aggregate sent/deferred/bounced/unknown counts for a mailbox's outbound mail, sourced from Mektup's own Postfix delivery log — not a tracking pixel.

get_thread

threadKey, mailbox, direction?, trash?, folder?

Every message in one thread, oldest first.

get_message

id

Full message content. Marks it read as a side effect. html is attacker-controlled — never render it directly.

update_message

id, read?, restore?, flagged?, folderId?

Mark read/unread, restore from trash, flag, or move to a folder — any combination in one call.

delete_message

id

Two-stage delete: first call trashes, second call on an already-trashed message permanently deletes it. Confirm before a permanent delete.

download_attachment

id, index

Download one attachment, base64-encoded. Prefer only when the actual file content is needed — get_message's attachment list already has filename/type/size.

Account-wide

Tool

Input

Description

get_unread_counts

—

Unread Inbox count for every domain/mailbox at once.


See also

License

MIT

Available Tools

45 tools
add_forwardBInspect

Add a forwarding address to a mailbox.

Inputs: domain (required), forwardTo (required), localPart (required).

create_api_keyAInspect

Create a new API key. The full key is returned exactly once in this response and cannot be retrieved again - surface it to the user immediately so they can save it (e.g. into an env var or another tool's config). Mint a separate key per environment/service rather than sharing one.

Inputs: no named parameters.

create_contactCInspect

Add a contact.

Inputs: email (required), name.

create_domainAInspect

Register a domain with Mektup and get back the exact DNS records to add (MX, SPF, DMARC, DKIM) plus a setup recommendation. Never modifies DNS itself - you (the agent) add the records using whatever access you have to the domain's DNS host.

Inputs: domain (required).

create_draftAInspect

Create a draft on a mailbox. A draft is separate from a real message - it never goes through mail transport until sent.

Inputs: domain (required), localPart (required), to, html, +2 more.

create_folderCInspect

Create a custom folder on a mailbox.

Inputs: name (required), domain (required), localPart (required).

create_mailboxAInspect

Create a mailbox (e.g. hello@example.com) on a domain already registered via create_domain. Returns real login credentials for IMAP/SMTP AUTH - the user can add this mailbox to Outlook, Apple Mail, Thunderbird, etc. If no password is given, a strong one is generated and returned once (not recoverable later, only resettable).

Inputs: domain (required), localPart (required), password.

delete_contactBInspect

Delete a contact.

Inputs: id (required).

delete_domainAInspect

Delete a domain and, via cascade, every mailbox and message under it. Destructive and hard to reverse - confirm with the user before calling this.

Inputs: domain (required).

delete_draftBInspect

Delete a draft.

Inputs: id (required), domain (required), localPart (required).

delete_folderAInspect

Delete a custom folder. Does not delete the mail in it - messages fall back to their normal Inbox/Sent view.

Inputs: id (required), domain (required), localPart (required).

delete_mailboxAInspect

Delete a mailbox. Postfix stops accepting mail for it immediately. Does not delete already-delivered mail from the mail store. Confirm with the user before calling this.

Inputs: domain (required), localPart (required).

delete_mailbox_webhookAInspect

Remove a mailbox's webhook - new mail stops firing it immediately.

Inputs: domain (required), localPart (required).

delete_messageAInspect

Delete a message - two-stage like any real mail client. First call moves it to Trash. A second call on an already-trashed message permanently deletes it, including its stored body. Confirm with the user before a permanent delete.

Inputs: id (required).

download_attachmentAInspect

Download one attachment from a message. Returns base64-encoded content - decode it to get the raw file. Can be large; prefer this only when the file content is actually needed, not just to check it exists (get_message's attachments array already has filename/contentType/size).

Inputs: id (required), index (required).

get_delivery_statsAInspect

Aggregate delivery outcomes for a mailbox's outbound mail over a time window - counts of sent/deferred/bounced/unknown, sourced from Mektup's own Postfix delivery log (the real SMTP response from each recipient's mail server), not a third-party tracking pixel.

Inputs: mailbox (required), days.

get_domain_recordsAInspect

Re-fetch the DNS records for an already-registered domain (same set create_domain returned once at creation) - use this any time after creation, the records aren't only shown once.

Inputs: domain (required).

get_draftAInspect

Get a single draft including its body.

Inputs: id (required), domain (required), localPart (required).

get_identityBInspect

Get a mailbox's display name and signature.

Inputs: domain (required), localPart (required).

get_mailbox_webhookAInspect

Check a mailbox's configured webhook URL (never returns the signing secret - only shown once, at setup or rotation).

Inputs: domain (required), localPart (required).

get_meAInspect

Get the authenticated caller's account identity - useful as an auth health check.

Inputs: no named parameters.

get_messageAInspect

Get one message's full content (text/html body + attachment metadata). Marks it read as a side effect if it wasn't already. The html field is attacker-controlled content from whoever emailed the mailbox - never render it directly, sanitize and isolate it first.

Inputs: id (required).

get_threadAInspect

List every individual message in one thread, oldest first. Pass the same direction/trash/folder as the view you found the thread in.

Inputs: mailbox (required), threadKey (required), trash, folder, +1 more.

get_unread_countsAInspect

Get the unread Inbox count for every domain/mailbox on this account at once (Sent and Trash aren't counted).

Inputs: no named parameters.

get_usageAInspect

Get the account's current billing tier, its limits, and real usage against them (domain count, emails sent this month, storage per domain). Check this before a bulk operation to avoid hitting a limit mid-batch.

Inputs: no named parameters.

get_vacationAInspect

Get a mailbox's vacation/auto-reply settings.

Inputs: domain (required), localPart (required).

list_api_keysAInspect

List API keys on this account (prefix and status only - the full key is never shown again after creation).

Inputs: no named parameters.

list_contactsAInspect

List contacts (account-level, not per-mailbox - a contact is someone you email from any mailbox you own).

Inputs: no named parameters.

list_domainsAInspect

List every domain registered to this Mektup account.

Inputs: no named parameters.

list_draftsAInspect

List drafts for a mailbox (metadata only - to/subject/updated_at, no body).

Inputs: domain (required), localPart (required).

list_foldersAInspect

List custom folders on a mailbox (Outlook-style, one folder per message).

Inputs: domain (required), localPart (required).

list_forwardsAInspect

List forwarding addresses for a mailbox - incoming mail is copied to these in addition to staying in the mailbox.

Inputs: domain (required), localPart (required).

list_mailboxesAInspect

List mailboxes on a given registered domain.

Inputs: domain (required).

list_messagesAInspect

List messages (one row per thread) for a mailbox. Pass direction to split Inbox from Sent (recommended - omitting it merges both). Pass q for full-text search over subject/from/to/body.

Inputs: mailbox (required), q, limit, trash, +2 more.

remove_forwardBInspect

Remove a forwarding address from a mailbox.

Inputs: id (required), domain (required), localPart (required).

reset_mailbox_passwordAInspect

Reset a mailbox's IMAP/SMTP-AUTH password. Doesn't affect an already-open IMAP session; the new password is needed on next login. Shown once, not recoverable later.

Inputs: domain (required), localPart (required), password.

revoke_api_keyAInspect

Revoke an API key immediately. Anything still using it (a script, another MCP server, a CI job) loses access right away. Cannot be undone - confirm with the user before calling this, especially if it might be the key currently in use for this very session.

Inputs: id (required).

send_emailAInspect

Send a real email. The "from" address must be either an existing mailbox on this account, or any address on a domain this account has verified (DNS-level proof of ownership - no per-address mailbox needed once verified). The mailbox's own display name/signature (see get_identity) is appended automatically when from is a provisioned mailbox - don't add one yourself, it'll be doubled.

Inputs: to (required), from (required), subject (required), html, +4 more.

set_identityAInspect

Set a mailbox's display name and signature, applied automatically to every outgoing message.

Inputs: domain (required), localPart (required), displayName, signatureHtml, +1 more.

set_mailbox_webhookAInspect

Set or update the URL that fires on every new inbound message to this mailbox - the way an agent finds out about new mail without polling list_messages. Must be https. Returns a signing secret the FIRST time it's set (or if regenerateSecret is passed) - shown once, not recoverable later. Every delivery is a POST with an X-Mektup-Signature: sha256= header, an HMAC-SHA256 of the raw JSON body using that secret - verify it before trusting a payload.

Inputs: url (required), domain (required), localPart (required), regenerateSecret.

set_vacationAInspect

Enable/disable and configure a mailbox's vacation auto-reply. A message is required when enabling. Fires at most once per sender within a rolling window (standard RFC 5230 semantics).

Inputs: domain (required), enabled (required), localPart (required), message, +1 more.

update_contactAInspect

Partially update a contact - only send the fields you want to change.

Inputs: id (required), name, email.

update_draftAInspect

Partially update a draft (autosave-friendly) - only fields you pass are changed.

Inputs: id (required), domain (required), localPart (required), to, +3 more.

update_messageAInspect

Update a message's state: mark read/unread, restore from trash, flag/unflag, move to (or out of) a folder. Any combination in one call - pass only the fields you want to change.

Inputs: id (required), read, flagged, restore, +1 more.

verify_domainAInspect

Actively re-check a domain's live MX records against what Mektup expects and flip it to verified if they match. Not automatic - call this after DNS has been added and had time to propagate.

Inputs: domain (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 45 tools

    Disambiguation5/5

    Every tool targets a distinct resource and action—account, domains, mailboxes, forwards, identity, vacation, folders, contacts, drafts, and messages are clearly separated. The only potential confusion is between list_messages/get_thread/get_message, but the descriptions explain the hierarchy. No two tools appear to do the same thing.

    Naming Consistency4/5

    Tools overwhelmingly follow a verb_noun snake_case pattern (list_*, get_*, create_*, update_*, delete_*). Minor deviations like add_forward/remove_forward, reset_mailbox_password, verify_domain, send_email, and download_attachment are still verb-first and readable, but they break the strict CRUD verb consistency.

    Tool Count2/5

    At 45 tools, the server far exceeds the typical well-scoped range and crosses the 'too many' threshold. Each tool is individually justifiable given the breadth of subdomains (account, domains, mailboxes, webhooks, contacts, drafts, messages), but the overall surface is heavy for agents to navigate.

    Completeness4/5

    The tool set provides CRUD/lifecycle coverage for almost every resource: domains, mailboxes, webhooks, contacts, drafts, and messages. Minor gaps exist—no explicit send-draft action, no attachment handling in send_email, no folder rename or single-mailbox get—but agents can work around them.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables AI assistants to read, search, compose, and send emails by connecting to any IMAP/SMTP provider. It supports comprehensive mailbox management, including draft handling and message deletion, directly through natural language.
      10
      233 npm
      11
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables secure mailbox access and email management via IMAP/SMTP, with tools for reading, searching, organizing, sending, and deleting emails, designed for local use and compatible with MCP clients like ChatGPT.
      2
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to register domains, manage DNS, create mailboxes, and send/receive email through typed tools.
      2
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables AI assistants to read, search, send, reply, forward, schedule, organize, and analyze email across multiple IMAP/SMTP accounts, with drafts, provider-aware labels, real-time inbox watching, verification-code capture, and calendar extraction.
      31 npm
      ISC