stalwart-mail-mcp
v2.3.0Mail and contacts on a self-hosted Stalwart server via JMAP: search, read, OCR, send, drafts.
Values you need
| Variable | What it is | |
|---|---|---|
STALWART_URL | required | Public address of the Stalwart server, e.g. https://mail.example.com |
STALWART_USER | required | Mailbox e-mail address to sign in with |
STALWART_PASSWORD | required secret | Mailbox or app password |
MAIL_LANG | optional | Language: auto, en, cs, de, es, fr, it, nl, pl, pt, sk |
MAIL_OCR_PROVIDER | optional | OCR of scans: auto, off, mistral, anthropic, openai, openrouter, gemini, ollama, lmstudio, custom |
MAIL_OCR_API_KEY | optional secret | API key of the OCR provider (not needed for local servers) |
MAIL_OCR_MODEL | optional | OCR model name |
MAIL_OCR_BASE_URL | optional | Address of a custom OpenAI-compatible OCR server |
npm (npx) discovery passed
Requires Node.js 18+
Run in a terminal
claude mcp add stalwart-mail-mcp -e 'STALWART_PASSWORD=<STALWART_PASSWORD>' -e 'STALWART_URL=<STALWART_URL>' -e 'STALWART_USER=<STALWART_USER>' -- npx -y stalwart-mail-mcp@2.3.0Add to
claude_desktop_config.json{
"mcpServers": {
"stalwart-mail-mcp": {
"args": [
"-y",
"stalwart-mail-mcp@2.3.0"
],
"command": "npx",
"env": {
"STALWART_PASSWORD": "<STALWART_PASSWORD>",
"STALWART_URL": "<STALWART_URL>",
"STALWART_USER": "<STALWART_USER>"
}
}
}
}Add to
~/.cursor/mcp.json{
"mcpServers": {
"stalwart-mail-mcp": {
"args": [
"-y",
"stalwart-mail-mcp@2.3.0"
],
"command": "npx",
"env": {
"STALWART_PASSWORD": "<STALWART_PASSWORD>",
"STALWART_URL": "<STALWART_URL>",
"STALWART_USER": "<STALWART_USER>"
}
}
}
}Add to
.vscode/mcp.json{
"inputs": [
{
"description": "STALWART_PASSWORD",
"id": "stalwart-password",
"password": true,
"type": "promptString"
},
{
"description": "STALWART_URL",
"id": "stalwart-url",
"password": true,
"type": "promptString"
},
{
"description": "STALWART_USER",
"id": "stalwart-user",
"password": true,
"type": "promptString"
}
],
"servers": {
"stalwart-mail-mcp": {
"args": [
"-y",
"stalwart-mail-mcp@2.3.0"
],
"command": "npx",
"env": {
"STALWART_PASSWORD": "${input:stalwart-password}",
"STALWART_URL": "${input:stalwart-url}",
"STALWART_USER": "${input:stalwart-user}"
},
"type": "stdio"
}
}
}Add to
~/.codex/config.toml[mcp_servers.stalwart-mail-mcp]
command = "npx"
args = ["-y", "stalwart-mail-mcp@2.3.0"]
env = { "STALWART_PASSWORD" = "<STALWART_PASSWORD>", "STALWART_URL" = "<STALWART_URL>", "STALWART_USER" = "<STALWART_USER>" }For AI agents
- Ask the user for: STALWART_URL, STALWART_USER, STALWART_PASSWORD. Never invent or guess these values; secrets go into the client config, not into chat logs.
- Pick the user's MCP client and apply the matching config from the first install method (it is the one verified by the smoke test when available).
- Restart or reload the client so it starts the server.
- Verify: the server should expose these tools: mail_list_mailboxes, mail_search_emails, mail_get_email, mail_get_attachment, mail_send_email, mail_create_draft, mail_send_draft, mail_delete_draft, ….
- If it fails, check that the required runtime is installed (Node.js 18+) and that the values above are set.
Machine-readable: install.md · manifest.json