Mektup-mcp
Mektup MCP Server
Mektup is a self-hosted, multi-domain email platform. 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.jsyourself with your key in an env var. For MCP clients that only support launching a local process (Claude Desktop config, etc.).
Remote server (recommended for platform integrations)
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:
OAuth (recommended for platform integrations)
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 |
|
Auth type | Bearer token / API key |
Token | your |
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: mcp-imap
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 install3. 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 the authenticated account identity. Useful as an auth health check. |
| — | Current billing tier, its limits, and real usage against them. Check before a bulk operation. |
API keys
Tool | Input | Description |
| — | List keys on this account (prefix and status only). |
| — | Create a new key. The full key is returned exactly once - surface it to the user immediately so they can save it. |
|
| 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 |
|
| Register a domain, get back the exact DNS records (MX/SPF/DMARC/DKIM) and a setup recommendation. Never touches DNS itself. |
| — | List every domain on this account. |
|
| Re-fetch a registered domain's DNS records any time after creation. |
|
| Actively re-check live DNS and flip verified once it matches. Not automatic. |
|
| Delete a domain and everything under it. Destructive — confirm with the user first. |
Mailboxes
Tool | Input | Description |
|
| Create a mailbox with real IMAP/SMTP-AUTH credentials, usable in any mail client. |
|
| List mailboxes on a domain. |
|
| Reset a mailbox's login password. Shown once. |
|
| Delete a mailbox. Confirm with the user first. |
Webhooks
Tool | Input | Description |
|
| Check a mailbox's configured webhook URL (never returns the signing secret). |
|
| Set/update the URL that fires (HMAC-signed) on every new inbound message - how an agent finds out about new mail without polling |
|
| Remove a mailbox's webhook. |
Forwarding
Tool | Input | Description |
|
| List addresses that get a copy of incoming mail. |
|
| Add a forwarding address. |
|
| Remove a forwarding address. |
Identity
Tool | Input | Description |
|
| Get display name and signature. |
|
| Set display name/signature, applied automatically to outgoing mail. |
Vacation / auto-reply
Tool | Input | Description |
|
| Get vacation auto-reply settings. |
|
| Enable/configure auto-reply. |
Folders
Tool | Input | Description |
|
| List custom folders. |
|
| Create a folder. |
|
| Delete a folder (mail in it falls back to Inbox/Sent). |
Contacts
Account-level, not per-mailbox.
Tool | Input | Description |
| — | List contacts. |
|
| Add a contact. |
|
| Partially update — only send fields to change. |
|
| Delete a contact. |
Drafts
Tool | Input | Description |
|
| List drafts (metadata only). |
|
| Get a draft including its body. |
|
| Create a draft. |
|
| Partial update (autosave-friendly). |
|
| Delete a draft. |
Sending
Tool | Input | Description |
|
| Send real mail. |
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 (one row per thread). Pass |
|
| Aggregate sent/deferred/bounced/unknown counts for a mailbox's outbound mail, sourced from Mektup's own Postfix delivery log — not a tracking pixel. |
|
| Every message in one thread, oldest first. |
|
| Full message content. Marks it read as a side effect. |
|
| Mark read/unread, restore from trash, flag, or move to a folder — any combination in one call. |
|
| Two-stage delete: first call trashes, second call on an already-trashed message permanently deletes it. Confirm before a permanent delete. |
|
| Download one attachment, base64-encoded. Prefer only when the actual file content is needed — |
Account-wide
Tool | Input | Description |
| — | Unread Inbox count for every domain/mailbox at once. |
See also
Full REST API reference — everything this server wraps
OpenAPI 3.1 spec — machine-readable version of the same API
usemektup.com — sign up, dashboard, pricing
License
MIT
This server cannot be installed
Maintenance
Related MCP Servers
- AlicenseAqualityFmaintenanceEnables 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.101889MIT
- Alicense-qualityDmaintenanceEnables AI agents to interact with email accounts via IMAP and SMTP, supporting mailbox listing, email search, retrieval, sending, and management.MIT
- AlicenseBqualityDmaintenanceEnables AI assistants to send, read, and manage emails via SMTP and IMAP, with support for attachments, threads, and mailbox organization.16141MIT
- Flicense-qualityDmaintenanceEnables AI models to send, receive, search, and manage emails via SMTP/IMAP, including support for attachments, contacts, and advanced search.
Related MCP Connectors
Email for AI agents — send, receive as a webhook, manage domains, templates, routing.
Email for AI agents: send mail, manage contacts, automations & webhooks. Zero-DNS first send.
Send email, manage domains, DNS, webhooks, templates, and inbound routing on MailKite
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/WeeCi/mektup-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server