MCP Notmuch Sendmail
local-only server
The server can only run on the client’s local machine because it depends on local resources.
Integrations
MCP Notmuch Sendmail
Status: Works for me but is still very beta
Let Claude be your email assistant! MCP Notmuch Sendmail connects Claude Desktop to your notmuch email database, allowing it to:
- Search and browse your email threads
- View conversations in a clean text format
- Compose new emails using markdown
- Reply to threads with smart deduplication of quoted content
- Create beautiful emails with LaTeX-inspired styling
Uses html2text for HTML email rendering and markdown-it for composing rich HTML emails with inline images.
Requirements
- A working notmuch database setup
- A configured sendmail command for sending emails
- Python 3.10+
API
Tools
- find_email_thread
- Find email threads in the notmuch database
- Input:
notmuch_search_query
(string) - Returns tab-separated list of threads with format:
Copy - view_email_thread
- View all messages for an email thread
- Input:
thread_id
(string) - Returns conversation in text format with HTML->text conversion
Copy - compose_new_email
- Compose a new email draft from markdown. A signature will be automatically added if SENDMAIL_EMAIL_SIGNATURE_HTML is set.
- Inputs:
subject
(string): Email subjectbody_as_markdown
(string): Email body in markdownto
(list): Recipient email addressescc
(list, optional): CC recipientsbcc
(list, optional): BCC recipients
- Creates draft files and returns paths:
Copy - compose_email_reply
- Compose a reply to an existing email thread. A signature will be automatically added if SENDMAIL_EMAIL_SIGNATURE_HTML is set.
- Inputs:
thread_id
(string): Thread ID to reply tosubject
(string): Email subjectbody_as_markdown
(string): Email body in markdownto
(list): Recipient email addressescc
(list, optional): CC recipientsbcc
(list, optional): BCC recipients
- Creates draft files and returns paths:
Copy - send_email
- Sends the composed email draft
- No input required
- Returns success/error message
Usage with Claude Desktop
Add to your claude_desktop_config.json
:
Environment Variables:
NOTMUCH_DATABASE_PATH
: Path to your notmuch database (required)NOTMUCH_REPLY_SEPARATORS
: Pipe-separated list of text markers - keeps email content up until the first line starting with any of these markers, removing quoted replies (required)SENDMAIL_FROM_EMAIL
: Your email address for the From: field (required)SENDMAIL_EMAIL_SIGNATURE_HTML
: HTML signature to append to emails (optional)LOG_FILE_PATH
: Path for logging file (optional)
Installation
- Clone repository:
- Ensure you have uv
- Add email configuration to claude_desktop_config.json (see above)
Reply Separators
The NOTMUCH_REPLY_SEPARATORS
environment variable controls email reply detection. When viewing a thread, each email's content is trimmed at the first line that starts with any of the configured separators. This effectively removes quoted replies while keeping the new content.
Here are recommended separator patterns for different languages:
English
German
French
Dutch
Italian
Note: Use | (pipe) to separate patterns. These are simplified patterns derived from common email clients - you may need to adjust them based on your specific needs.
Contributing
Contributions are warmly welcomed! Whether it's bug reports, feature requests, documentation improvements, or code contributions - all input is valuable. Feel free to:
- Open an issue to report bugs or suggest features
- Submit pull requests with improvements
- Enhance documentation or share your usage examples
- Ask questions and share your experiences
The goal is to make email management with Claude even better, and your insights and contributions help achieve that.
Acknowledgments
This project builds on the excellent work of others:
- mail-parser-reply - For the comprehensive email reply marker patterns
- notmuch - The fast mail indexing and search engine
- html2text - For converting HTML emails to readable text
- markdown-it-py - For generating beautiful HTML emails
- latex.css - For the LaTeX-style email formatting
License
Mozilla Public License Version 2.0
This server cannot be installed
An email assistant server that connects Claude Desktop to notmuch email databases, allowing users to search emails, view threads, compose new messages, and reply to conversations with markdown formatting.
- Requirements
- API
- Usage with Claude Desktop
- Installation
- Reply Separators
- Contributing
- Acknowledgments
- License