# Langmail MCP for your own Stalwart: email, calendar and contacts

> Langmail MCP for your own Stalwart: email, calendar and contacts is an open-source MCP server for communication. MCP server giving AI agents email, calendar and contacts on your own Stalwart mail server. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, Self-hosted, API
- **Repository:** https://github.com/langmail/langmail-mcp
- **MCP Registry name:** io.github.langmail/langmail-mcp
- **Categories:** [communication](https://ai-powered.com/categories/communication), [productivity](https://ai-powered.com/categories/productivity)
- **Listing updated:** 2026-11-18

## About

The README says langmail-mcp is an open-source Model Context Protocol server built for people who run their own Stalwart mail server. It exposes mail search, reading, drafting and sending, folder and rule management, calendars and contacts to an agent, and talks only to that Stalwart instance over JMAP, CalDAV and CardDAV.

It can run over stdio on the same machine as the agent, or over Streamable HTTP on a server behind a bearer token and a TLS-terminating reverse proxy. Credentials are an app password or a Stalwart API key. The project states that no third-party service is involved and that there is no telemetry.

The README describes the tool set as matching Langmail's hosted MCP server, with a few differences: calendar sharing is absent, and one-click unsubscribe and remote image loading are off unless explicitly enabled. The package is aimed at self-hosters who want an agent to work with their mail, and at the time of the README the npm release was still pending, so it is run from a clone.

## Features

- **Mail search and reading:** Search, read and preview messages and threads, with an option to fetch remote images only when enabled.
- **Drafts and sending:** Create, edit and send drafts, and reply to or forward messages, with sending left for the user to confirm.
- **Mail rules and filing:** Archive, move, trash and label messages, and create, preview and manage mail rules.
- **Calendar management:** List, create, update and delete events and calendars, and respond to invitations over CalDAV.
- **Contacts over CardDAV:** Search, create, update, merge and delete contacts, and list upcoming birthdays.
- **Self-hosted transports:** Runs over stdio on one machine or over authenticated Streamable HTTP on a server.

## Good for

- Finding an old email from a specific sender or topic in a self-hosted mailbox
- Drafting replies for review before sending from a self-hosted Stalwart account
- Scheduling meetings by checking calendars and responding to invitations
- Keeping contacts in sync and looking up birthdays through an agent
- Running a shared agent endpoint on a home or company server behind a reverse proxy

## Install

### Claude Code (Terminal)

```sh
claude mcp add langmail-mcp --env STALWART_URL='<STALWART_URL>' --env STALWART_PASSWORD='<STALWART_PASSWORD>' --env STALWART_TOKEN='<STALWART_TOKEN>' --env MCP_AUTH_TOKEN='<MCP_AUTH_TOKEN>' -- npx -y langmail-mcp
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "langmail-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "langmail-mcp"
      ],
      "env": {
        "STALWART_URL": "<STALWART_URL>",
        "STALWART_PASSWORD": "<STALWART_PASSWORD>",
        "STALWART_TOKEN": "<STALWART_TOKEN>",
        "MCP_AUTH_TOKEN": "<MCP_AUTH_TOKEN>"
      }
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "langmail-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "langmail-mcp"
      ],
      "env": {
        "STALWART_URL": "<STALWART_URL>",
        "STALWART_PASSWORD": "<STALWART_PASSWORD>",
        "STALWART_TOKEN": "<STALWART_TOKEN>",
        "MCP_AUTH_TOKEN": "<MCP_AUTH_TOKEN>"
      }
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "langmail-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "langmail-mcp"
      ],
      "env": {
        "STALWART_URL": "<STALWART_URL>",
        "STALWART_PASSWORD": "<STALWART_PASSWORD>",
        "STALWART_TOKEN": "<STALWART_TOKEN>",
        "MCP_AUTH_TOKEN": "<MCP_AUTH_TOKEN>"
      }
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "langmail-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "langmail-mcp"
      ],
      "env": {
        "STALWART_URL": "<STALWART_URL>",
        "STALWART_PASSWORD": "<STALWART_PASSWORD>",
        "STALWART_TOKEN": "<STALWART_TOKEN>",
        "MCP_AUTH_TOKEN": "<MCP_AUTH_TOKEN>"
      }
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "langmail-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "langmail-mcp"
      ],
      "env": {
        "STALWART_URL": "<STALWART_URL>",
        "STALWART_PASSWORD": "<STALWART_PASSWORD>",
        "STALWART_TOKEN": "<STALWART_TOKEN>",
        "MCP_AUTH_TOKEN": "<MCP_AUTH_TOKEN>"
      }
    }
  }
}
```

## Tools

- `search_emails`: Search mail by text, sender, date, folder, read state and star.
- `get_email`: Read a single email.
- `get_thread`: Read a conversation thread.
- `preview_email`: Render an email for preview.
- `archive_emails`: Move emails to the Archive folder.
- `move_emails`: Move emails between folders.
- `trash_emails`: Move emails to the trash.
- `mark_emails`: Set flags or labels on emails.
- `unsubscribe_from_list`: Return or send a list unsubscribe request.
- `create_draft`: Create an email draft.
- `get_draft`: Read a draft.
- `list_drafts`: List drafts.
- `update_draft`: Update a draft.
- `delete_draft`: Delete a draft.
- `send_draft`: Send a draft.
- `reply_to_message`: Reply to a message.
- `forward_message`: Forward a message.
- `download_attachment`: Get a link to download an attachment.
- `download_email`: Get a link to download an email.
- `upload_attachments`: Upload attachments for use in messages.
- `preview_mail_rule`: Preview the effect of a mail rule.
- `create_mail_rule`: Create a mail rule.
- `list_mail_rules`: List mail rules.
- `update_mail_rule`: Update a mail rule.
- `delete_mail_rule`: Delete a mail rule.
- `list_calendars`: List calendars.
- `create_calendar`: Create a calendar.
- `update_calendar`: Update a calendar.
- `list_calendar_events`: List calendar events.
- `create_calendar_event`: Create a calendar event.
- `update_calendar_event`: Update a calendar event.
- `delete_calendar_event`: Delete a calendar event.
- `move_calendar_events`: Move events between calendars.
- `respond_to_event`: Respond to a calendar invitation.
- `search_contacts`: Search contacts.
- `list_upcoming_birthdays`: List upcoming birthdays from contacts.
- `create_contact`: Create a contact.
- `update_contact`: Update a contact.
- `delete_contact`: Delete a contact.
- `merge_contacts`: Merge duplicate contacts.

## FAQ

### Does it work with hosted email providers?

The README describes it as working only against your own Stalwart server over JMAP, CalDAV and CardDAV.

### How does the server authenticate to Stalwart?

With either a Stalwart app password and username, or a bearer token such as a Stalwart API key.

### Does the server send data to Langmail?

The README says no Langmail service is involved and that nothing leaves the machine except traffic to your Stalwart, unless the two optional outbound settings are enabled.

### Is it installable from npm yet?

The README says the first release is pending and the package is not yet on npm, so it currently runs from a git clone.

### Is Langmail MCP for your own Stalwart: email, calendar and contacts free?

Yes. Langmail MCP for your own Stalwart: email, calendar and contacts is open source, so you can use and self-host it for free.

### How do I add Langmail MCP for your own Stalwart: email, calendar and contacts to Claude Code?

Run this command in your terminal: claude mcp add langmail-mcp --env STALWART_URL='<STALWART_URL>' --env STALWART_PASSWORD='<STALWART_PASSWORD>' --env STALWART_TOKEN='<STALWART_TOKEN>' --env MCP_AUTH_TOKEN='<MCP_AUTH_TOKEN>' -- npx -y langmail-mcp

### What are the best alternatives to Langmail MCP for your own Stalwart: email, calendar and contacts?

The closest alternatives to Langmail MCP for your own Stalwart: email, calendar and contacts are mcp-mail, Lettio MCP, Mailoo - Email MCP Server, icloud-mcp and Workwae.

## Where this comes from

- Description: written from the project's README and its MCP Registry entry.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [mcp-mail](https://ai-powered.com/mcp/mcp-mail): mcp-mail is an open-source MCP server for communication.
- [Lettio MCP](https://ai-powered.com/mcp/lettio-mcp): Lettio MCP is an open-source MCP server for communication.
- [Mailoo - Email MCP Server](https://ai-powered.com/mcp/mailoo-email-mcp-server): Mailoo - Email MCP Server is an open-source MCP server for communication.
- [icloud-mcp](https://ai-powered.com/mcp/icloud-mcp-3): icloud-mcp is an open-source MCP server for productivity.
- [Workwae](https://ai-powered.com/mcp/workwae): Workwae is an MCP server for communication.
- [Shipmail](https://ai-powered.com/mcp/shipmail): Shipmail is an MCP server for communication.
- [mailmcp](https://ai-powered.com/mcp/mailmcp): mailmcp is a freemium MCP server for communication.
- [Benethos Mailbox MCP](https://ai-powered.com/mcp/benethos-mailbox-mcp): Benethos Mailbox MCP is an open-source MCP server for communication.

---
Source: https://ai-powered.com/mcp/langmail-mcp-for-your-own-stalwart-email-calendar-and-contac
