email-mcp-server

email-mcp-server

Cross-platform MCP server and CLI for email operations, including send, read, search, and contact management, compatible with Gmail, Outlook, Yahoo, and any IMAP/SMTP providers.

Category
Visit Server

README

Email MCP Server

Cross-platform email operations for MCP clients and CLI šŸŒ

A dual-purpose tool that works as:

  • šŸ”Œ MCP Server: Email capabilities for Claude Desktop and MCP clients
  • ⚔ CLI Suite: 40+ commands for terminal email management

Universal compatibility: Works on Windows, macOS, Linux, and WSL with Gmail, Outlook, Yahoo, and any IMAP/SMTP providers.

✨ Features Overview

šŸ“§ Basic Operations: Send, read, get, delete emails | Mark read/unread
šŸ” Advanced Features: Search, forward, reply, bulk operations | Draft & schedule
šŸ‘„ Contact Management: Add, update, search, organize contacts by groups
🌐 Cross-Platform: Works identically on all platforms and terminals

šŸš€ Zero-Configuration Installation

šŸŽÆ One Command - Complete Setup:

npm install -g @0xshariq/email-mcp-server
# OR
pnpm install -g @0xshariq/email-mcp-server

✨ What Happens Automatically:

  • āœ… Detects your platform (Windows/macOS/Linux/WSL)
  • āœ… Creates 40+ command shortcuts globally
  • āœ… Configures system PATH automatically
  • āœ… Tests installation and provides setup guide
  • āœ… Ready to use immediately - no manual steps!

šŸŽ¬ Getting Started:

# Set up your email (one-time only):
email-setup

# Start sending emails:
email-send "user@example.com" "Hello" "Your message"

# Explore all commands:
email-cli --help

šŸ“– Complete Installation Guide

āš™ļø Configuration

šŸ”§ The MCP server and CLI share the same environment configuration!

Local Development (Both Server & CLI)

# Copy and edit .env file
cp .env.example .env
nano .env  # Add your credentials

Global Installation (CLI)

Configure environment variables in your shell profile:

Linux: Add to ~/.bashrc

export EMAIL_USER="your-email@gmail.com"
export EMAIL_PASS="xxxx-xxxx-xxxx-xxxx"
export SMTP_HOST="smtp.gmail.com"
export SMTP_PORT="587"
export IMAP_HOST="imap.gmail.com"
export IMAP_PORT="993"

macOS: Add to ~/.zshrc (or ~/.bash_profile)

export EMAIL_USER="your-email@gmail.com"
export EMAIL_PASS="xxxx-xxxx-xxxx-xxxx"
# ... (same as Linux)

Windows: Set System Environment Variables

  • Press Win + X → System → Advanced system settings
  • Environment Variables → Add each variable

Quick Example (Gmail)

EMAIL_USER=your-email@gmail.com
EMAIL_PASS=xxxx-xxxx-xxxx-xxxx  # App Password (not regular password)
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
IMAP_HOST=imap.gmail.com
IMAP_PORT=993

šŸ“– Complete Configuration Guide - Detailed setup for all platforms and providers

Setup Requirements:

  1. Enable 2FA on your email provider
  2. Generate App Password
  3. Configure environment variables (locally or globally)

šŸ“‹ Supports: Gmail, Outlook, Yahoo, and any IMAP/SMTP provider

šŸ’» Usage

As MCP Server

npm start  # Starts MCP server for Claude Desktop

As CLI Tool (Cross-Platform)

# Works identically on Windows, macOS, Linux, WSL
email-send "user@example.com" "Subject" "Message"
email-read 10
contact-add "John Doe" "john@example.com" "work"
email-search --from "boss@company.com" --unread

All 40+ commands work the same across all platforms!

šŸ“š Documentation

Complete documentation for all features and platforms:

šŸ“– Core Documentation

Document Description
Configuration Guide Comprehensive environment setup for CLI and MCP server (local and global)
Installation Guide Cross-platform installation instructions (Windows, macOS, Linux, WSL)
CLI Reference Complete reference for all 40+ CLI commands with examples
CLI Usage Top-level CLI usage and setup commands
Commands Reference Detailed command documentation with options and examples

šŸ”§ Technical Documentation

Document Description
Architecture System architecture, data models, and design decisions
Troubleshooting Common issues and solutions for all platforms
Windows Guide Windows-specific installation and configuration
Publishing Guide Package publishing and versioning strategy
Restructure Summary v2.0 TypeScript migration details

šŸš€ Quick Start Guides

First Time Setup:

  1. Installation: INSTALL.md
  2. Configuration: CONFIGURATION.md
  3. First Commands: CLI_REFERENCE.md

Having Issues?

Development & Contributing:

šŸŽÆ By Use Case

As CLI User:

As MCP Server User:

As Developer:

MCP Server Integration

When running as an MCP server, all email operations are available as structured tools for Claude Desktop and other MCP clients.

Available Tools:

  • Email operations: send, read, search, forward, reply, delete
  • Contact management: add, update, search, organize
  • Bulk operations: batch sending, scheduling, drafts

Usage in Claude Desktop:

{
  "to": "user@example.com", 
  "subject": "Hello",
  "body": "Message from Claude!"
}

šŸ“– Configuration: See CONFIGURATION.md

šŸ” Security & Best Practices

  • Use App Passwords (not regular passwords)
  • Keep .env secure (never commit to git)
  • Respect rate limits for bulk operations
  • Use HTTPS/TLS for all connections

šŸ› ļø Development & Contributing

Quick Development Setup:

git clone https://github.com/0xshariq/email-mcp-server.git
cd email-mcp-server
npm install          # Install dependencies
npm run build        # Compile TypeScript
npm link             # Test locally

Project Structure:

email-mcp-server/
ā”œā”€ā”€ cli/            # CLI implementation (Commander.js)
ā”œā”€ā”€ server/         # MCP server implementation
ā”œā”€ā”€ src/lib/        # Shared email & contact services
ā”œā”€ā”€ dist/           # Compiled JavaScript
└── docs/           # Complete documentation

Key Technologies:

  • TypeScript 5.8+ with strict mode
  • Commander.js 14+ for CLI
  • Nodemailer 7+ for SMTP
  • IMAP-Simple 5+ for IMAP
  • MCP SDK 1.15+ for server

Documentation for Developers:

Contributing: Fork → Branch → PR. See Contributing Guidelines

šŸ“ž Support & Resources

Issues & Questions:

Documentation by Topic:

All Documentation: See docs/ folder for complete guides

šŸ“„ License

MIT License - see LICENSE file for details.


🌟 Star this repo if it helps you manage emails efficiently across platforms!

Version: 2.0.0
Last Updated: December 20, 2025

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured