Langmail MCP for your own Stalwart: email, calendar and contacts
MCP server giving AI agents email, calendar and contacts on your own Stalwart mail server
- Pricing
- Open source
- Platforms
- CLI, Self-hosted, API
- Runs
- Locally
- Version
- 0.1.0
- Listing updated
- today
Similar MCP servers
About 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. It runs locally on your machine and is started by your AI client.
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.
Install
Run in a 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-mcpAdd to claude_desktop_config.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>"
}
}
}
}Add to ~/.cursor/mcp.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>"
}
}
}
}Add to .vscode/mcp.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>"
}
}
}
}Add to ~/.codeium/windsurf/mcp_config.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>"
}
}
}
}Add to your client's MCP settings (most use this shape)
{
"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>"
}
}
}
}Using several servers? Build one config file with the MCP config generator.
Configuration
STALWART_URLBase URL of your Stalwart server (JMAP, CalDAV and CardDAV), e.g. https://mail.example.comRequiredSTALWART_USERNAMEAccount login name, usually the mail address; use together with STALWART_PASSWORDSTALWART_PASSWORDApp password for STALWART_USERNAME, created in Stalwart's account managerSTALWART_TOKENBearer token such as a Stalwart API key, as an alternative to STALWART_USERNAME and STALWART_PASSWORDMCP_TRANSPORTTransport: stdio (the default) or http, which serves Streamable HTTP at /mcpMCP_AUTH_TOKENRequired with MCP_TRANSPORT=http: the secret callers send as Authorization: Bearer; at least 16 charactersMCP_HOSTHTTP transport: address to listen onMCP_PORTHTTP transport: port to listen onMCP_PUBLIC_URLHTTP transport: the address callers reach the server under, e.g. behind a TLS-terminating reverse proxyLOG_LEVELLog level for stderr: fatal, error, warn, info, debug, trace or silentLANGMAIL_MCP_ALLOW_UNSUBSCRIBE_POSTSet to 1 to let unsubscribe_from_list send the RFC 8058 one-click request to the sender's URL; off by defaultLANGMAIL_MCP_ALLOW_REMOTE_IMAGESSet to 1 to let preview_email load a message's remote images through this server; off by default
Tools this server provides (40)
Taken from the project documentation; the running server may differ.
- 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.
What it does
- 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
Pricing
Open source
Open source under the MIT license; self-hosted with no paid plan mentioned.
More servers for the same service
Langmail MCP for your own Stalwart: email, calendar and 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.