imap-mcp
v0.1.3
Published
An MCP server that lets your AI agent save email drafts to any IMAP mailbox.
Readme
{
"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>"
}
}
}
}✨ Features
- Email Draft Creation: Create draft emails that are saved to your IMAP server's drafts folder
- IMAP Integration: Connect to any IMAP-compatible email server (Gmail, Outlook, etc.)
- Secure Authentication: Uses environment variables for secure credential management
- MCP Compatible: Works with Claude and other AI assistants that support the Model Context Protocol
- TypeScript: Full TypeScript support with proper type definitions
Usage
- Compile TypeScript to JavaScript:
npx tsc- Run the MCP server:
node dist/index.jsAvailable Tools
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": "[email protected]",
"subject": "Meeting Reminder",
"body": "Don't forget about our meeting tomorrow at 2 PM.",
"from": "[email protected]"
}The tool saves the draft to the folder your server marks as the drafts folder (the \Drafts special-use attribute, RFC 6154), such as [Gmail]/Drafts on Gmail. If the server marks no folder that way, it tries INBOX.Drafts, then Drafts.
License
MIT
