Get the FREE Ultimate OpenClaw Setup Guide →

Email_MCP

First MCP server which sends and reads emails from your inbox

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio shashwat051102-email_mcp python Email_MCP_Server.py \
  --env EMAIL_ADDRESS="Your Gmail address" \
  --env EMAIL_PASSWORD="Your Gmail App Password"

How to use

Email_MCP is a Python-based server built with FastMCP that provides a simple API for sending HTML emails via Gmail SMTP and listing recent emails from your Gmail inbox. It loads configuration from environment variables to keep credentials secure, and exposes its tools as MCP endpoints for easy integration into other applications. The core tools are send_email and list_recent_emails, which you can call through the MCP client just like other MCP endpoints. When running, the server reads EMAIL_ADDRESS and EMAIL_PASSWORD from the environment to authenticate with Gmail's SMTP/IMAP services, so you can securely send messages and preview inbox contents without embedding credentials in your code.

How to install

Prerequisites:\n- Python 3.8+ (recommended)\n- pip (comes with Python)\n- A Gmail account (with App Password if 2FA is enabled)\n\nStep-by-step:\n1) Clone or download the repository and navigate to the project folder.\n2) Create and populate the .env file (or set environment variables) with your Gmail credentials:\n\nEMAIL_ADDRESS=your_email@gmail.com\nEMAIL_PASSWORD=your_gmail_app_password\n\n3) Install dependencies:\nbash\npip install -r requirements.txt\n\n4) Start the server:\nbash\np python Email_MCP_Server.py\n\n5) The server will expose MCP endpoints (e.g., /send_email and /list_recent_emails) via FastMCP for programmatic access. You can configure your MCP client to connect to localhost:8000 (default) or another host/port as configured.\n

Additional notes

Tips and notes:\n- Use an App Password if your Gmail account has 2FA enabled.\n- Do not commit .env or credentials to version control.\n- Ensure network access to Gmail SMTP (port 465) and IMAP (port 993) if you run behind firewalls.\n- If you encounter authentication issues, double-check the EMAIL_ADDRESS and EMAIL_PASSWORD values and ensure less secure app access is permitted if not using OAuth2.\n- For production deployments, consider OAuth2-based access to Gmail rather than App Passwords for long-term security.\n

Related MCP Servers

Sponsor this space

Reach thousands of developers