Get the FREE Ultimate OpenClaw Setup Guide →

email

Model Context Protocol Server with IMAP and SMTP connectivity

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
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:

  1. Clone the repository git clone <repository-url> cd imap-mcp

  2. Install dependencies npm install

  3. 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

  4. Run in development mode npm run dev

  5. 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

Sponsor this space

Reach thousands of developers