MCP server for IMAP email access - enables Claude and other LLM applications to read emails via the IMAP protocol
Config is the same across clients — only the file and path differ.
{
"mcpServers": {
"mcp-imap-server": {
"args": [
"-y",
"npm"
],
"command": "npx"
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
A Model Context Protocol (MCP) server that enables Claude and other LLM applications to read emails via the IMAP protocol. This server provides secure, read-only access to email accounts from popular providers like Gmail, Outlook, Yahoo, and custom IMAP servers.
Run this in your terminal to verify the server starts. Then let us know if it worked — your result helps other developers.
npx -y 'npm' 2>&1 | head -1 && echo "✓ Server started successfully"
After testing, let us know if it worked:
Five weighted categories — click any category to see the underlying evidence.
Packing does not respect root-level ignore files in workspaces
### Impact `npm pack` ignores root-level `.gitignore` & `.npmignore` file exclusion directives when run in a workspace or with a workspace flag (ie. `--workspaces`, `--workspace=<name>`). Anyone who has run `npm pack` or `npm publish` with workspaces, as of [v7.9.0](https://github.com/npm/cli/releases/tag/v7.9.0) & [v7.13.0](https://github.com/npm/cli/releases/tag/v7.13.0) respectively, may be affected and have published files into the npm registry they did not intend to include. ### Patch - Up
Incorrect Permission Assignment for Critical Resource in NPM
An issue was discovered in an npm 5.7.0 2018-02-21 pre-release (marked as "next: 5.7.0" and therefore automatically installed by an "npm upgrade -g npm" command, and also announced in the vendor's blog without mention of pre-release status). It might allow local users to bypass intended filesystem access restrictions because ownerships of /etc and /usr directories are being changed unexpectedly, related to a "correctMkdir" issue.
Local Privilege Escalation in npm
Affected versions of `npm` use predictable temporary file names during archive unpacking. If an attacker can create a symbolic link at the location of one of these temporary file names, the attacker can arbitrarily write to any file that the user which owns the `npm` process has permission to write to, potentially resulting in local privilege escalation. ## Recommendation Update to version 1.3.3 or later.
npm CLI exposing sensitive information through logs
Versions of the npm CLI prior to 6.14.6 are vulnerable to an information exposure vulnerability through log files. The CLI supports URLs like `<protocol>://[<user>[:<password>]@]<hostname>[:<port>][:][/]<path>`. The password value is not redacted and is printed to stdout and also to any generated log files.
npm Vulnerable to Global node_modules Binary Overwrite
Versions of the npm CLI prior to 6.13.4 are vulnerable to a Global node_modules Binary Overwrite. It fails to prevent existing globally-installed binaries to be overwritten by other package installations. For example, if a package was installed globally and created a `serve` binary, any subsequent installs of packages that also create a `serve` binary would overwrite the first binary. This will not overwrite system binaries but only binaries put into the global node_modules directory. This b
Click any tool to inspect its schema.
Be the first to review
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Others in communication
Asynchronous coordination layer for AI coding agents: identities, inboxes, searchable threads, and advisory file leases over FastMCP + Git + SQLite
An MCP server that securely interfaces with your iMessage database via the Model Context Protocol (MCP), allowing LLMs to query and analyze iMessage conversations. It includes robust phone number validation, attachment processing, contact management, group chat handling, and full support for sending and receiving messages.
Email & SMS infrastructure for AI agents — send and receive real email and text messages programmatically
A Model Context Protocol (MCP) server for interacting with Microsoft 365 and Office services through the Graph API
MCP Security Weekly
Get CVE alerts and security updates for Mcp Imap Server and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
A Model Context Protocol (MCP) server that enables Claude and other LLM applications to read emails via the IMAP protocol. This server provides secure, read-only access to email accounts from popular providers like Gmail, Outlook, Yahoo, and custom IMAP servers.
git clone <repository-url>
cd mcp-imap-server
npm install
npm run build
Create a .env file in the project root:
# Required: IMAP server configuration
IMAP_HOST=imap.gmail.com
IMAP_PORT=993
IMAP_USER=your-email@gmail.com
IMAP_PASSWORD=your-app-password
IMAP_TLS=true
# Optional: Connection settings
IMAP_AUTH_TIMEOUT=3000
IMAP_CONN_TIMEOUT=10000
IMAP_KEEPALIVE_INTERVAL=10000
IMAP_IDLE_INTERVAL=300000
IMAP_FORCE_NOOP=false
IMAP_HOST=imap.gmail.com
IMAP_PORT=993
IMAP_TLS=true
IMAP_HOST=outlook.office365.com
IMAP_PORT=993
IMAP_TLS=true
IMAP_HOST=imap.mail.yahoo.com
IMAP_PORT=993
IMAP_TLS=true
IMAP_HOST=imap.mail.me.com
IMAP_PORT=993
IMAP_TLS=true
# Development mode
npm run dev
# Production mode
npm run build
npm start
The server exposes the following tools to MCP clients:
search_emailsSearch for emails based on various criteria.
Parameters:
sender (optional): Filter by sender email address or namesubject (optional): Filter by subject line (partial match)dateFrom (optional): Start date for date range filter (ISO format: YYYY-MM-DD)dateTo (optional): End date for date range filter (ISO format: YYYY-MM-DD)content (optional): Search within email content/body textunread (optional): Filter by read status (true for unread only, false for read only)folder (optional): Folder to search in (defaults to INBOX)limit (optional): Maximum number of emails to return (1-100)Example:
{
"name": "search_emails",
"arguments": {
"sender": "notifications@github.com",
"unread": true,
"limit": 10
}
}
get_emailRetrieve the full content of a specific email by its message ID.
Parameters:
messageId (required): The message ID or UID of the email to retrievefolder (optional): Folder containing the email (defaults to INBOX)Example:
{
"name": "get_email",
"arguments": {
"messageId": "12345",
"folder": "INBOX"
}
}
list_foldersList all available email folders/mailboxes in the account.
Parameters:
includeSpecial (optional): Include special folders like Sent, Drafts, etc.Example:
{
"name": "list_folders",
"arguments": {
"includeSpecial": true
}
}
get_recent_emailsGet the most recent emails from a specific folder.
Parameters:
folder (optional): Folder to get emails from (defaults to INBOX)limit (optional): Number of recent emails to retrieve (1-50, default: 10)unreadOnly (optional): Only return unread emailsExample:
{
"name": "get_recent_emails",
"arguments": {
"folder": "INBOX",
"limit": 5,
"unreadOnly": true
}
}
mark_as_readMark an email as read or unread.
Parameters:
messageId