Skip to content
MCP server

Stalwart Mail MCP

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

Runs locallyStatus and history
Install
Pricing
Open source
Runs
Locally
Version
2.3.0
Listing updated
5 days ago

About Stalwart Mail MCP

Stalwart Mail MCP is an open-source MCP server. It runs locally on your machine and is started by your AI client.

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

Install

Run in a terminal

claude mcp add stalwart-mail-mcp --env STALWART_URL='<STALWART_URL>' --env STALWART_USER='<STALWART_USER>' --env STALWART_PASSWORD='<STALWART_PASSWORD>' --env MAIL_OCR_API_KEY='<MAIL_OCR_API_KEY>' -- npx -y stalwart-mail-mcp

Add to claude_desktop_config.json

{
  "mcpServers": {
    "stalwart-mail-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "stalwart-mail-mcp"
      ],
      "env": {
        "STALWART_URL": "<STALWART_URL>",
        "STALWART_USER": "<STALWART_USER>",
        "STALWART_PASSWORD": "<STALWART_PASSWORD>",
        "MAIL_OCR_API_KEY": "<MAIL_OCR_API_KEY>"
      }
    }
  }
}

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "stalwart-mail-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "stalwart-mail-mcp"
      ],
      "env": {
        "STALWART_URL": "<STALWART_URL>",
        "STALWART_USER": "<STALWART_USER>",
        "STALWART_PASSWORD": "<STALWART_PASSWORD>",
        "MAIL_OCR_API_KEY": "<MAIL_OCR_API_KEY>"
      }
    }
  }
}

Add to .vscode/mcp.json

{
  "servers": {
    "stalwart-mail-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "stalwart-mail-mcp"
      ],
      "env": {
        "STALWART_URL": "<STALWART_URL>",
        "STALWART_USER": "<STALWART_USER>",
        "STALWART_PASSWORD": "<STALWART_PASSWORD>",
        "MAIL_OCR_API_KEY": "<MAIL_OCR_API_KEY>"
      }
    }
  }
}

Add to ~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "stalwart-mail-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "stalwart-mail-mcp"
      ],
      "env": {
        "STALWART_URL": "<STALWART_URL>",
        "STALWART_USER": "<STALWART_USER>",
        "STALWART_PASSWORD": "<STALWART_PASSWORD>",
        "MAIL_OCR_API_KEY": "<MAIL_OCR_API_KEY>"
      }
    }
  }
}

Add to your client's MCP settings (most use this shape)

{
  "mcpServers": {
    "stalwart-mail-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "stalwart-mail-mcp"
      ],
      "env": {
        "STALWART_URL": "<STALWART_URL>",
        "STALWART_USER": "<STALWART_USER>",
        "STALWART_PASSWORD": "<STALWART_PASSWORD>",
        "MAIL_OCR_API_KEY": "<MAIL_OCR_API_KEY>"
      }
    }
  }
}

Configuration

  • STALWART_URLPublic address of the Stalwart server, e.g. https://mail.example.comRequired
  • STALWART_USERMailbox e-mail address to sign in withRequired
  • STALWART_PASSWORDMailbox or app passwordRequired
  • MAIL_LANGLanguage: auto, en, cs, de, es, fr, it, nl, pl, pt, sk
  • MAIL_OCR_PROVIDEROCR of scans: auto, off, mistral, anthropic, openai, openrouter, gemini, ollama, lmstudio, custom
  • MAIL_OCR_API_KEYAPI key of the OCR provider (not needed for local servers)
  • MAIL_OCR_MODELOCR model name
  • MAIL_OCR_BASE_URLAddress of a custom OpenAI-compatible OCR server

Pricing

Open source

Stalwart Mail MCP FAQ

Is Stalwart Mail MCP free?

Yes. Stalwart Mail MCP is open source, so you can use and self-host it for free.

How do I add Stalwart Mail MCP to Claude Code?

Run this command in your terminal: claude mcp add stalwart-mail-mcp --env STALWART_URL='<STALWART_URL>' --env STALWART_USER='<STALWART_USER>' --env STALWART_PASSWORD='<STALWART_PASSWORD>' --env MAIL_OCR_API_KEY='<MAIL_OCR_API_KEY>' -- npx -y stalwart-mail-mcp