email-smtp-imap-mcp MCP Server
Multi-account SMTP/IMAP email tools: search, read, send, reply, forward, flags and folders.
email-smtp-imap-mcp scores 54 (Fair), licensed MIT and written in TypeScript. It installs as a local process. It declares 6 tools. Filed under Communication. GitHub shows 26 stars. Package registries report about 842 downloads a week. Install configs are generated for 12 clients. Being listed in the registry is not the same as being vendor-official.
Fair trust
54 of 100 from six public signals. Nobody can buy a point.
- OSI-style license: mit.
License, quality and maintenance
Where the 54 comes from
0 + 20 + 10 + 10 + 4 + 10 = 54. Each factor is capped, so no single signal can carry a listing.
Active in the official MCP registry, plus a known vendor namespace.
Registry: 0 of 30 points.How recently the repository saw a commit or release.
Maintenance: 20 of 20 points.GitHub stars and weekly downloads, on a log scale.
Popularity: 10 of 20 points.A clear, OSI-style open-source license.
License: 10 of 10 points.Not archived, a secure install path, a pinned version.
Security: 4 of 10 points.A real summary, a README with depth, listed tools.
Docs: 10 of 10 points.Install
Pick your client, copy the config, paste it in.
Needs Cursor or VS Code installed on this device. The button opens the app and asks you to confirm before it adds the server.
{ "mcpServers": { "samihalawa-email-smtp-imap-mcp": { "command": "npx", "args": [ "-y", "email-smtp-imap-mcp@2.2.2" ], "env": { "EMAIL_ACCOUNTS_JSON": "YOUR_EMAIL_ACCOUNTS_JSON", "DEFAULT_EMAIL_ACCOUNT": "" } } }}
Environment variables
| Name | Required | Notes |
|---|---|---|
EMAIL_ACCOUNTS_JSONSecret | Required | JSON object keyed by account name with SMTP and IMAP settings and credentials; see the repository setup guide. |
DEFAULT_EMAIL_ACCOUNT | Optional | Default account name from EMAIL_ACCOUNTS_JSON; optional when the first account should be used. |
Tools6Tool docs quality grade B
All capabilitiesaccounts_listtoolList every configured account and identify the default without exposing credentials.
email_respondtoolReply, reply-all, or forward by email UID with threading and optional original attachments.
email_sendtoolSend plain-text or HTML email with CC, BCC, sender aliases, and base64 attachments.
emails_findtoolSearch by text, sender, recipient, subject, date, read state, flag state, or attachments. Optionally return bodies and attachments.
emails_modifytoolMark read/unread, flag/unflag, or move messages to another folder.
folders_listtoolList folders with optional total and unread counts.
About
Email SMTP/IMAP MCP
One local MCP server for every inbox: search, read, send, reply, forward, and organize email across multiple accounts.
Why this server
For third-party notices, licence enquiries and the version 2.2.2 supplement, see the open source licence compliance programme.
- No account-count cap — add work, personal, support, or client inboxes and switch with
account_name. - SMTP + IMAP together — send and receive through one small MCP server.
- Complete everyday workflow — search, read, reply, forward, attach files, flag, archive, move, and list folders.
- Provider-agnostic — works with Gmail, iCloud Mail, Fastmail, Outlook, self-hosted mail, and other standard SMTP/IMAP providers.
- Local stdio transport — no hosted relay and no separate control panel.
Quick start
1. Create your .env
Copy .env.example to a private location and add as many named accounts as you need:
EMAIL_ACCOUNTS_JSON='{
"work": {
"smtp": {
"host": "smtp.gmail.com",
"port": 587,
"secure": false,
"user": "work@example.com",
"password": "app-password"
},
"imap": {
"host": "imap.gmail.com",
"port": 993,
"secure": true,
"user": "work@example.com",
"password": "app-password"
},
"default_from_name": "Your Name",
"sender_emails": ["work@example.com", "alias@example.com"]
},
"personal": {
"smtp": {
"host": "smtp.mail.me.com",
"port": 587,
"secure": false,
"user": "you@icloud.com",
"password": "app-password"
},
"imap": {
"host": "imap.mail.me.com",
"port": 993,
"secure": true,
"user": "you@icloud.com",
"password": "app-password"
}
}
}'
DEFAULT_EMAIL_ACCOUNT="work"
The server loads .env from its working directory automatically. EMAIL_ENV_FILE lets an MCP client use an .env stored anywhere.
2. Add the MCP server
For Claude Desktop, edit:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"email": {
"command": "npx",
"args": ["-y", "email-smtp-imap-mcp"],
"env": {
"EMAIL_ENV_FILE": "/absolute/path/to/your/.env"
}
}
}
}
Use an absolute path, restart your MCP client, then ask: “List my configured email accounts.”
You can skip the .env file and set EMAIL_ACCOUNTS_JSON plus DEFAULT_EMAIL_ACCOUNT directly in the MCP client’s env object. The JSON must be escaped into a single string.
{
"env": {
"EMAIL_ACCOUNTS_JSON": "{\"work\":{\"smtp\":{\"host\":\"smtp.gmail.com\",\"port\":587,\"user\":\"work@example.com\",\"password\":\"app-password\"},\"imap\":{\"host\":\"imap.gmail.com\",\"port\":993,\"user\":\"work@example.com\",\"password\":\"app-password\"}}}",
"DEFAULT_EMAIL_ACCOUNT": "work"
}
}
Use SMTP_HOST, SMTP_PORT, SMTP_SECURE, SMTP_USER, SMTP_PASS, IMAP_HOST, IMAP_PORT, IMAP_SECURE, IMAP_USER, and IMAP_PASS instead of EMAIL_ACCOUNTS_JSON.
SMTP_USERNAME/SMTP_PASSWORD and IMAP_USERNAME/IMAP_PASSWORD are accepted aliases. IMAP credentials default to the SMTP credentials when omitted. Use SENDER_EMAILS as a comma-separated allowlist for optional from_email selection.
Tools
See the tool reference for every input, default, response field and error format.
| Tool | What it does |
|---|---|
accounts_list | List every configured account and identify the default without exposing credentials. |
emails_find | Search by text, sender, recipient, subject, date, read state, flag state, or attachments. Optionally return bodies and attachments. |
email_send | Send plain-text or HTML email with CC, BCC, sender aliases, and base64 attachments. |
email_respond | Reply, reply-all, or forward by email UID with threading and optional original attachments. |
emails_modify | Mark read/unread, flag/unflag, or move messages to another folder. |
folders_list | List folders with optional total and unread counts. |
All tools except accounts_list accept an optional account_name. Without it, the server uses DEFAULT_EMAIL_ACCOUNT or the first configured account. There is no application-level account-count limit.
Verify your setup
After restarting the MCP client, try these in order:
- “List my configured email accounts.”
- “List folders for my
workaccount.” - “Find the five newest unread emails in my
personalaccount.” - “Send a plain-text email from my
workaccount.”
Provider settings
| Provider | SMTP | IMAP | Credential |
|---|---|---|---|
| Gmail | smtp.gmail.com:587 | imap.gmail.com:993 | App password |
| iCloud Mail | smtp.mail.me.com:587 | imap.mail.me.com:993 | App-specific password |
| Other providers | Use the provider's SMTP host | Use the provider's IMAP host | Provider password or app password |
Use secure: true for implicit TLS ports such as 465/993. Port 587 normally uses secure: false and upgrades with STARTTLS. Both SMTP and IMAP require TLS 1.2 or newer and a valid server certificate. With secure: false, STARTTLS is mandatory before authentication; servers without STARTTLS are rejected. Plaintext-only relays are not supported.
Development
git clone https://github.com/samihalawa/email-smtp-imap-mcp.git
cd email-smtp-imap-mcp
npm ci
npm test
Run the compiled stdio server with npm start. Build a production container with docker build -t email-smtp-imap-mcp ..
Contributing
Issues and focused pull requests are welcome. See CONTRIBUTING.md for the development workflow and SECURITY.md for vulnerability reports.
License
MIT © Sami Halawa
Security and release assurance
Report vulnerabilities through the private route in SECURITY.md. The security assurance programme and source-bound review describe the controls, evidence and publication boundaries for this project. They do not claim an external ISO certificate or completed OpenChain conformance.
Maintainers can run npm run assurance to build the package, run security checks, archive pinned component inputs and verify an offline recovery. The generated release assets include platform-specific build inputs and are intended for durable release retention.
Frequently asked questions
What is email-smtp-imap-mcp MCP Server?
Multi-account SMTP/IMAP email tools: search, read, send, reply, forward, flags and folders.
How do I install email-smtp-imap-mcp MCP Server in Claude Desktop, Cursor, or VS Code?
Pick your client in the Install section on this page and copy the generated config into the client's config file. Step-by-step guides: Claude Desktop, Cursor, and VS Code. email-smtp-imap-mcp MCP Server runs locally from the npm package email-smtp-imap-mcp with the command npx -y email-smtp-imap-mcp@2.2.2.
Is email-smtp-imap-mcp MCP Server free and open source?
Yes. email-smtp-imap-mcp MCP Server is released under the MIT license, an OSI-approved open-source license, so you can use, modify, and self-host it under those terms.
Does email-smtp-imap-mcp MCP Server support remote (HTTP) connections?
No remote endpoint is listed for email-smtp-imap-mcp MCP Server. It runs locally on your machine over stdio, started by your MCP client.
What tools does email-smtp-imap-mcp MCP Server provide?
email-smtp-imap-mcp MCP Server provides 6 tools, including accounts_list, email_respond, email_send, and emails_find. See the full tool list for descriptions and parameters.
How is email-smtp-imap-mcp MCP Server's trust score calculated?
email-smtp-imap-mcp MCP Server scores 54 out of 100 (Fair). The score adds six capped public signals: registry status, maintenance, popularity, license, documentation, and security. Nobody can pay for points. Read the methodology for the full formula.
Reviews
No reviews yet—Be the first to review
No published reviews yet. Used it? Tell the next person how it went.
Sign inA verified email is required to review this server.
Add badge to your README
Paste either snippet into the repository README. The image links to this listing.