Notmuch Email Assistant
STDIOConnects Claude Desktop to notmuch email database for searching, browsing and composing emails.
Connects Claude Desktop to notmuch email database for searching, browsing and composing emails.
Status: Works great and is in daily use without any known bugs.
Status2: I just added the package to PyPI and updated the usage instructions. Please report any issues :)
Let Claude be your email assistant! MCP Notmuch Sendmail connects Claude Desktop to your notmuch email database, allowing it to:
Uses html2text for HTML email rendering and markdown-it for composing rich HTML emails with inline images.
Ensure you have uv installed:
# Install uv if you haven't already curl -LsSf https://astral.sh/uv/install.sh | sh
Add to your claude_desktop_config.json
:
{ "mcpServers": { "email": { "command": "uvx", "args": ["--from", "mcp-notmuch-sendmail==2025.04.09.174710", "--python", "3.10", "--refresh", "mcp-notmuch-sendmail"] "env": { "NOTMUCH_DATABASE_PATH": "/path/to/your/notmuch/db", "NOTMUCH_REPLY_SEPARATORS": "Pipe|Separated|Phrases", "SENDMAIL_FROM_EMAIL": "[email protected]", "SENDMAIL_EMAIL_SIGNATURE_HTML": "<p>Optional HTML signature</p>", "NOTMUCH_SYNC_SCRIPT": "/path/to/your/sync/script.sh", "LOG_FILE_PATH": "/path/to/log/file.log", "DRAFT_DIR": "/path/for/email/drafts" } } } }
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)NOTMUCH_SYNC_SCRIPT
: Path to a script for synchronizing emails (optional)LOG_FILE_PATH
: Path for logging file (optional)DRAFT_DIR
: Directory for storing email drafts (optional, defaults to /tmp/mcp-notmuch-sendmail)find_email_thread
notmuch_search_query
(string)thread_id date subject authors
view_email_thread
thread_id
(string)FROM: [email protected]
DATE: 2024-01-25
Message content...
- - -
FROM: [email protected]
DATE: 2024-01-24
Earlier message...
compose_new_email
subject
(string): Email subjectbody_as_markdown
(string): Email body in markdownto
(list): Recipient email addressescc
(list, optional): CC recipientsbcc
(list, optional): BCC recipientsCreated drafts:
- /path/to/draft/dir/draft.md (edit this)
- /path/to/draft/dir/draft.html (preview)
compose_email_reply
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 recipientsCreated drafts:
- /path/to/draft/dir/draft.md (edit this)
- /path/to/draft/dir/draft.html (preview)
send_email
sync_emails
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:
On|wrote:|From:|Sent:|To:|Subject:|Date:|Cc:|Best regards|Kind Regards|Thanks,|Thank you,|Best,|All the best|regards,|Sent from my|Get Outlook for|CAUTION:|Disclaimer:|Warning:|Confidential:|CONFIDENTIALITY:|---------- Original Message ----------
Am.*schrieb|Von:|Gesendet|An:|Betreff:|Datum:|Cc:|Organisation:|Mit freundlichen Grüßen|Beste Grüße|Viele Grüße|Hinweis:|Achtung:|Gesendet von
Le.*a écrit|De |Envoyé |À |Objet |Cc |cordialement|salutations|bonne réception|bonne journée|Envoyé depuis
Op.*schreef:|Van:|Verzonden|Aan:|Onderwerp:|Datum:|Cc:|Met vriendelijke groet|Hartelijke groeten|Bedankt,|Dank u,|Verzonden vanaf
Il.*ha scritto:|Da:|Inviato|A:|Oggetto:|Data:|Cc:|Cordiali saluti|Inviato da
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.
Contributions are warmly welcomed! Whether it's bug reports, feature requests, documentation improvements, or code contributions - all input is valuable. Feel free to:
The goal is to make email management with Claude even better, and your insights and contributions help achieve that.
This project builds on the excellent work of others:
Mozilla Public License Version 2.0