Model Context Protocol Server with IMAP and SMTP connectivity
claude mcp add --transport stdio gabigabogabu-email-mcp-server npx -y gabigabogabu-email-mcp-server \ --env IMAP_HOST="imap.your-provider.com" \ --env IMAP_PORT="993" \ --env SMTP_HOST="smtp.your-provider.com" \ --env SMTP_PORT="465" \ --env EMAIL_USER="your-email@example.com" \ --env EMAIL_PASSWORD="your-email-password"
How to use
This MCP server provides email integration capabilities via IMAP and SMTP. It exposes MCP resources to read emails, list folders, and interact with an email account through tools like send_email, search_emails, and list_folders. You can query the inbox to fetch recent messages, explore mailbox folders, and programmatically send emails or search for messages using the provided tools. To use it, start the server in development or production, then call the MCP endpoints and tools described in the API section to manage email data and perform common email operations from your model assistants.
How to install
Prerequisites:
- Node.js (v16 or higher)
- npm or yarn
- Access to an email account with IMAP and SMTP enabled
Step-by-step:
-
Clone the repository git clone <repository-url> cd imap-mcp
-
Install dependencies npm install
-
Create a .env file in the project root with required variables (example): EMAIL_USER=your-email@example.com EMAIL_PASSWORD=your-password IMAP_HOST=imap.example.com IMAP_PORT=993 SMTP_HOST=smtp.example.com SMTP_PORT=465
-
Run in development mode npm run dev
-
Build and run in production mode npm run build npm start
Additional notes
Environment variables correspond to your email provider's settings. If you encounter TLS/auth errors, verify that IMAP/SMTP ports and hostnames are correct and that less secure app access is allowed if required by your provider. Ensure the .env file is loaded when running the server (the mcp_config includes an env block for reference). If your provider requires OAuth2, additional configuration will be needed beyond these placeholders. For production, consider storing sensitive credentials in a secrets manager and not in source control.
Related MCP Servers
mcp-framework
A framework for writing MCP (Model Context Protocol) servers in Typescript
spec-kit
MCP server enabling AI assistants to use GitHub's spec-kit methodology
israel-drugs
MCP server from DavidOsherdiagnostica/israel-drugs-mcp-server
docmole
Dig through any documentation with AI - MCP server for Claude, Cursor, and other AI assistants
mongo
MCP server that provide tools to LLMs such as claude in cursor to interact with MongoDB
mcp-quickstart
Setup an MCP server in 60 seconds.