stalwart-mail-mcp

v2.3.0
io.github.cybersmurf/stalwart-mail-mcp Checked 3 days ago Published 2 months ago

Mail and contacts on a self-hosted Stalwart server via JMAP: search, read, OCR, send, drafts.

Values you need

VariableWhat it is
STALWART_URLrequired Public address of the Stalwart server, e.g. https://mail.example.com
STALWART_USERrequired Mailbox e-mail address to sign in with
STALWART_PASSWORDrequired secret Mailbox or app password
MAIL_LANGoptional Language: auto, en, cs, de, es, fr, it, nl, pl, pt, sk
MAIL_OCR_PROVIDERoptional OCR of scans: auto, off, mistral, anthropic, openai, openrouter, gemini, ollama, lmstudio, custom
MAIL_OCR_API_KEYoptional secret API key of the OCR provider (not needed for local servers)
MAIL_OCR_MODELoptional OCR model name
MAIL_OCR_BASE_URLoptional 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.0
Add 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

  1. 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.
  2. 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).
  3. Restart or reload the client so it starts the server.
  4. 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, ….
  5. 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