by dominik1001
imap-mcp is an IMAP Model Context Protocol (MCP) server that exposes IMAP operations as tools for AI assistants. It allows AI models to interact with email servers, specifically for creating draft emails.
imap-mcp is an IMAP Model Context Protocol (MCP) server that exposes IMAP operations as tools for AI assistants. It allows AI models to interact with email servers, specifically for creating draft emails.
To use imap-mcp, you first need to compile the TypeScript code to JavaScript using npx tsc
. Then, you can run the MCP server using node dist/index.js
. Configuration for the IMAP server (host, port, username, password, SSL) is done via environment variables. The project integrates with AI assistants that support the Model Context Protocol, such as Claude.
Q: What is the primary function of imap-mcp? A: Its primary function is to expose IMAP operations, specifically email draft creation, as tools for AI assistants via the Model Context Protocol.
Q: Which AI assistants are compatible with imap-mcp? A: It is compatible with Claude and other AI assistants that support the Model Context Protocol.
Q: How does imap-mcp handle authentication? A: It uses environment variables for secure credential management (IMAP_HOST, IMAP_PORT, IMAP_USERNAME, IMAP_PASSWORD, IMAP_USE_SSL).
Q: Can I specify the sender's email address when creating a draft?
A: Yes, you can specify the from
parameter. If not provided, it defaults to the IMAP_USERNAME
.
📧 An IMAP Model Context Protocol (MCP) server to expose IMAP operations as tools for AI assistants.
{
"mcpServers": {
...,
"imap": {
"command": "npx",
"args": [
"imap-mcp"
],
"env": {
"IMAP_HOST": "<IMAP host>",
"IMAP_PORT": "<IMAP port>",
"IMAP_USERNAME": "<IMAP username>",
"IMAP_PASSWORD": "<IMAP password>",
"IMAP_USE_SSL": "<true or false>"
}
}
}
}
npx tsc
node dist/index.js
create-draft
Creates a draft email message and saves it to the IMAP server's drafts folder.
Parameters:
to
(string, required): The recipient's email addresssubject
(string, required): The email subject linebody
(string, required): The email body contentfrom
(string, optional): The sender's email address (defaults to IMAP_USERNAME)Example:
{
"to": "recipient@example.com",
"subject": "Meeting Reminder",
"body": "Don't forget about our meeting tomorrow at 2 PM.",
"from": "sender@example.com"
}
The tool will attempt to save the draft to either "INBOX.Drafts" or "Drafts" folder, depending on your email server's folder structure.
MIT
Please log in to share your review and rating for this MCP.