stalwart-jmap-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@stalwart-jmap-mcp List all mailboxes and their message counts."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
stalwart-jmap-mcp
Unofficial MCP server for Stalwart Mail Server — talks to the JMAP management API (/jmap, Stalwart v1.0+).
⚠️ Stalwart 0.16+ removed the legacy REST management API in favor of JMAP. Most existing "stalwart MCP" projects target the old REST API and won't work on modern Stalwart. This server uses the
x:-prefixed JMAP management methods directly.
Features (v0.4 — 39 tools, verified live on Stalwart v1.0.0)
Mail surface (v0.4 — standard JMAP mail)
Tool | Description |
| Folders + email counts (inbox/trash/junk/sent/...) |
| Search by mailbox role + free text (from/to/subject/body) |
| Full email: headers, body, raw blob |
| Sending identities (From addresses) |
| Auto-reply settings |
| Sieve filter scripts |
⚠️ Admin token punya permission
impersonate— parameteraccount_idbisa dipakai untuk membaca mailbox user lain. Gunakan dengan hati-hati.
Read (v0.1)
Tool | Description |
| Edition, username, capabilities |
| Mail accounts (users) with email/domain/created |
| Full account detail by id or email (secrets masked) |
| Configured mail domains |
| Users/groups/lists/domains/roles/tenants |
| DKIM keys: selector, stage, algorithm |
| Outgoing mail queue |
| API keys (masked) |
| Generic listing: tasks, alerts, roles, mailing lists, tenants, certificates, cluster nodes, applications, webhooks, tracers, ACME providers, DNS servers, spam rules, blocked/allowed IPs |
Write (v0.2)
Tool | Description |
| Create mail account (user) |
| Delete account (requires confirm) |
| Reset account password |
| Add mail domain |
| Delete domain (requires confirm) |
| Generate DKIM key (RSA 2048 / Ed25519) |
| Create API key (token shown once) |
| Delete API key (requires confirm) |
| Set next retry time of a queued message |
| Delete message from queue (requires confirm) |
| Block / unblock IP (reason enum: rcptToFailure, authFailure, loitering, portScanning, manual, other) |
| Allowlist / remove IP from allowlist |
| Create mailing list (name + domain) |
| Delete mailing list (requires confirm) |
Admin (v0.3)
Tool | Description |
| Hot-reload server settings |
| Reload TLS certificates |
| Pause/resume MTA queue |
| Invalidate (all |
| Live SPF/DKIM/ARC/DMARC troubleshoot |
| Spam score + tags for a message |
Related MCP server: jmap-mcp
Install
# local development
git clone https://github.com/fredogemilang/stalwart-jmap-mcp
cd stalwart-jmap-mcp && uv sync
# or via uvx (PEP 503 index hosted on GitHub Pages)
uvx --extra-index-url https://<user>.github.io/stalwart-jmap-mcp/simple stalwart-jmap-mcpConfigure
export STALWART_URL=https://mail.example.com
export STALWART_TOKEN=API_xxxxGet an API token from the Stalwart web admin (mail.example.com/login) → API keys.
Claude Code
Option A — uvx (install langsung dari GitHub Pages index)
Tambah ke .mcp.json di project root (atau claude mcp add):
{
"mcpServers": {
"stalwart": {
"command": "uvx",
"args": ["--refresh", "--extra-index-url", "https://fredogemilang.github.io/stalwart-jmap-mcp/simple", "stalwart-jmap-mcp"],
"env": {
"STALWART_URL": "https://mail.example.com",
"STALWART_TOKEN": "your-api-key"
}
}
}
}Option B — local development
claude mcp add stalwart --env STALWART_URL=https://mail.example.com \
--env STALWART_TOKEN=API_xxxx -- uv --directory /path/to/stalwart-jmap-mcp \
run stalwart-jmap-mcpDevelopment
uv run python scripts/smoke_test.py # end-to-end test via stdioLicense
MIT
Available Tools
39 toolsstalwart_allow_ipA
Allowlist an IP address (bypass spam checks).
Args: address: IP or CIDR to allowlist reason: optional reason expires_at: optional ISO 8601 UTC expiry
Inputs: address (required), reason, expires_at. Returns: object
stalwart_block_ipA
Block an IP address (spam defense).
Args: address: IP or CIDR to block reason: optional reason expires_at: optional ISO 8601 UTC expiry (e.g. 2026-08-10T00:00:00Z)
Inputs: address (required), reason, expires_at. Returns: object
stalwart_classify_spamA
Run the spam filter on a message and get the score.
Args: message: full RFC 5322 message env_from: envelope MAIL FROM (required) remote_ip: connecting IP (default 127.0.0.1; 0.0.0.0 is rejected) ehlo_domain: optional EHLO domain env_rcpt_to: optional envelope recipient list
Inputs: message (required), env_from (required), remote_ip, ehlo_domain, +1 more. Returns: object
stalwart_create_accountA
Create a new mail account (user).
Args: name: local part, e.g. 'alice' (creates alice@domain.com) domain_id: domain id (from stalwart_list_domains) password: initial password for the account description: optional description locale: BCP-47 locale (default id_ID) time_zone: IANA timezone (default Asia/Jakarta)
Inputs: name (required), domain_id (required), locale, password, +2 more. Returns: object
stalwart_create_api_keyA
Create a new API key (token shown ONCE in response).
Note: the ApiKey object has no 'name' field — only description.
Args: description: human-readable description (required) permissions: permission list; defaults to server default
Inputs: description (required), permissions. Returns: object
stalwart_create_domainA
Add a new mail domain.
Args: name: domain name, e.g. example.com
Inputs: name (required). Returns: object
stalwart_create_mailing_listA
Create a mailing list.
Args: name: list name, e.g. 'news' (creates news@domain.com) domain_id: domain id (from stalwart_list_domains) description: optional description recipients: optional member email addresses
Inputs: name (required), domain_id (required), recipients, description. Returns: object
stalwart_delete_accountA
Delete a mail account. Destructive — requires confirm=True.
Args: account_id: account id (from stalwart_list_accounts) confirm: must be True to proceed
Inputs: account_id (required), confirm. Returns: object
stalwart_delete_api_keyA
Delete an API key. Destructive — requires confirm=True.
Args: api_key_id: key id (from stalwart_list_api_keys) confirm: must be True to proceed
Inputs: api_key_id (required), confirm. Returns: object
stalwart_delete_domainA
Delete a mail domain. Destructive — requires confirm=True.
Args: domain_id: domain id (from stalwart_list_domains) confirm: must be True to proceed
Inputs: domain_id (required), confirm. Returns: object
stalwart_delete_mailing_listA
Delete a mailing list. Destructive — confirm=True.
Args: list_id: list id (from stalwart_list_objects(obj_type='mailing_list')) confirm: must be True to proceed
Inputs: list_id (required), confirm. Returns: object
stalwart_delete_queue_messageA
Delete a message from the outgoing queue. Destructive — confirm=True.
Args: message_id: queued message id (from stalwart_list_queue) confirm: must be True to proceed
Inputs: message_id (required), confirm. Returns: object
stalwart_generate_dkimA
Generate a new DKIM signing key for a domain.
Args: domain_id: domain id (from stalwart_list_domains) selector: DKIM selector; auto-generated if omitted algorithm: 'rsa' (2048-bit default) or 'ed25519'
Inputs: domain_id (required), selector, algorithm. Returns: object
stalwart_get_accountA
Get full account detail by ID or email address (secrets are masked).
Args: account_id: account id (from stalwart_list_accounts) email: full email address, e.g. user@domain.com
Inputs: email, account_id. Returns: object
stalwart_get_emailA
Get one email in full: headers, body preview, and raw message.
Args: account_id: account id email_id: email id (dari stalwart_search_emails)
Inputs: email_id, account_id. Returns: object
stalwart_get_queue_messageA
Full detail of one queued message, including parsed headers (From/To/Subject/Date) from the raw RFC 5322 message.
Args: message_id: queued message id (from stalwart_list_queue)
Inputs: message_id (required). Returns: object
stalwart_get_vacation_responseA
Get auto-reply (vacation response) settings of an account.
Inputs: account_id. Returns: object
stalwart_invalidate_cachesA
Invalidate server caches.
Args: all_caches: True = invalidate all caches, False = negative caches only
Inputs: all_caches. Returns: object
stalwart_list_accountsA
List mail accounts (users) with a compact summary.
Args: limit: max rows (default 50) search: optional substring match on account name
Inputs: limit, search. Returns: object
stalwart_list_api_keysB
List Stalwart API keys (tokens are masked).
Inputs: limit. Returns: object
stalwart_list_dkim_signaturesA
List DKIM signing keys with selector + stage.
Args: domain_id: optional filter by domain id (from stalwart_list_domains)
Inputs: domain_id. Returns: object
stalwart_list_domainsB
List mail domains configured in Stalwart.
Inputs: limit. Returns: object
stalwart_list_identitiesA
List sending identities (From addresses) of an account.
Inputs: account_id. Returns: object
stalwart_list_mailboxesA
List mailboxes (folders) of an account with email counts.
Args: account_id: Stalwart account id ('b' = postmaster/admin; akun user lain bisa diakses karena token punya impersonate)
Inputs: account_id. Returns: object
stalwart_list_objectsA
Generic listing for admin object types.
Args: obj_type: one of task, alert, action, role, mailing_list, tenant, certificate, cluster_node, application, webhook, tracer, acme_provider, dns_server, spam_rule, blocked_ip, allowed_ip limit: max rows (default 50)
Inputs: obj_type (required), limit. Returns: object
stalwart_list_principalsA
List principals (users/groups/lists/domains/roles/tenants).
Uses the standard JMAP principals namespace.
Args: principal_type: filter by type — individual, group, list, domain, tenant, role, apiKey, oauthClient, resource, location limit: max rows (default 50)
Inputs: limit, principal_type. Returns: object
stalwart_list_queueA
List messages currently in the outgoing mail queue.
Shows envelope return-path, per-recipient status/retry info, size and age. For full raw message content use stalwart_get_queue_message.
Inputs: limit. Returns: object
stalwart_list_sieve_scriptsB
List Sieve filter scripts of an account.
Inputs: account_id. Returns: object
stalwart_queue_pauseA
Pause outbound MTA queue processing.
Inputs: no named parameters. Returns: object
stalwart_queue_resumeA
Resume outbound MTA queue processing.
Inputs: no named parameters. Returns: object
stalwart_reload_settingsA
Reload Stalwart server settings (hot reload, no restart).
Inputs: no named parameters. Returns: object
stalwart_reload_tls_certificatesA
Reload TLS certificates without restart.
Inputs: no named parameters. Returns: object
stalwart_reschedule_queue_messageA
Reschedule a queued message's next retry time.
Args: message_id: queued message id (from stalwart_list_queue) retry_at: ISO 8601 UTC datetime, e.g. 2026-08-09T12:00:00Z
Inputs: retry_at (required), message_id (required). Returns: object
stalwart_search_emailsA
Search emails in an account.
Args: account_id: account id ('b' = admin; impersonate memungkinkan akun lain) mailbox_role: folder role — inbox, trash, junk, drafts, sent, archive mailbox_id: explicit mailbox id (overrides mailbox_role) text: optional free-text search (from/to/subject/body) limit: max results (default 20)
Inputs: text, limit, account_id, mailbox_id, +1 more. Returns: object
stalwart_server_infoA
Return Stalwart server info: edition, capabilities, account used.
Inputs: no named parameters. Returns: object
stalwart_set_account_passwordB
Reset an account's password.
Args: account_id: account id password: new password (min length enforced by server)
Inputs: password (required), account_id (required). Returns: object
stalwart_troubleshoot_dmarcA
Run a live DMARC/SPF/DKIM/ARC troubleshoot on a message.
Args: mail_from: envelope MAIL FROM remote_ip: connecting IP ehlo_domain: EHLO/HELO domain message: full RFC 5322 message to: optional envelope RCPT TO
Inputs: message (required), mail_from (required), remote_ip (required), ehlo_domain (required), +1 more. Returns: object
stalwart_unallow_ipA
Remove an IP from the allowlist. Destructive — confirm=True.
Args: ip_id: allowed ip id (from stalwart_list_objects(obj_type='allowed_ip')) confirm: must be True to proceed
Inputs: ip_id (required), confirm. Returns: object
stalwart_unblock_ipA
Remove an IP block. Destructive — confirm=True.
Args: ip_id: blocked ip id (from stalwart_list_objects(obj_type='blocked_ip')) confirm: must be True to proceed
Inputs: ip_id (required), confirm. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 39 tools
Most tools target distinct resources (accounts, domains, queue, IPs, emails), but list_accounts and list_principals overlap since accounts are principals of type 'individual', and list_objects can list many types already covered by dedicated list tools. Descriptions mostly clarify, but the duplication creates minor ambiguity.
All tools use the stalwart_ prefix and mostly follow verb_noun naming (list_accounts, create_domain, delete_queue_message). Exceptions like server_info (noun-only) and queue_pause/queue_resume (noun-verb instead of verb-noun) break the uniform pattern, but the overall style is still predictable.
With 39 tools, this server is excessively large for an MCP interface. Even for a broad mail server admin domain, the sheer number of tools makes selection harder and suggests over-fragmentation, exceeding the 25+ threshold for 'too many'.
The tool set covers many admin operations (accounts, domains, queue, IP blocks, mailing lists) but only provides read-only access to identities, vacation responses, and Sieve scripts—no create/update/delete for these. This leaves notable gaps for full lifecycle management.
Maintenance
Related MCP Connectors
MCP server for MailTempo's public free temporary email inboxes.
Your IMAP mailbox as an MCP server: read, search and (if you allow it) organize mail. Open source.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
An MCP server for the STRG.com s3-compatible object storage network for all management operations. Full documentation access, ask questions, create buckets, configure scoped access keys, CORS rules, lifecycle policies and perform any S3 operation.
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that provides AI assistants with full access to Fastmail accounts for managing email, contacts, calendars, and file storage. It implements 42 tools across JMAP, CardDAV, CalDAV, and WebDAV protocols to enable comprehensive account interaction through natural language.48MIT
- FlicenseNot gradedqualityBmaintenanceMCP server exposing JMAP email and Sieve script operations as tools, enabling mailbox management, email creation, search, flagging, and Sieve script management.2-
- AlicenseNot gradedqualityDmaintenanceA minimal MCP server for reading, searching, managing, and sending email over IMAP and SMTP.MIT
- AlicenseNot gradedqualityCmaintenanceEnables Claude and other MCP clients to search, read, write and organise mail on Stalwart servers over JMAP — including folders, Sieve filters, out-of-office replies and one-click unsubscribe — with draft-first and confirmation safeguards against prompt injection. A separate admin endpoint additionally exposes account, domain, mailing-list, queue, IP, log and task management through Stalwart's JMAP management API.MIT