๐ง MCP Email Reader Server
April 1, 2025 ยท View on GitHub
This project integrates Gmail email data into an MCP (Model Context Protocol)using an MCP server that interacts with Claude Desktop (the MCP client). It enables dynamic, query-driven retrieval of email content when user prompts are relevant.
๐ง Installation & Setup
1. Install uv
UV is a fast Python package manager and script runner used to isolate and run Python environments
Install UV:
curl -Ls https://astral.sh/uv/install.sh | sh
2. Install Python
Ensure Python 3.8+ is installed.
Check with:
python3 --version
Download: https://www.python.org/downloads/
๐ Gmail Setup for 3rd-Party Access
To allow this script to access Gmail securely:
- Go to your Google Account Security settings.
- Enable 2-Step Verification.
- Click on App Passwords under "Signing in to Google".
- Generate an app password for "Mail".
- Store this securely; it will be required by the script (e.g. in a
.envfile).
โ๏ธ MCP Client Configuration (Claude Desktop)
To register the email server with Claude Desktop:
- Navigate to:
/Library/Application Support/Claude/claude_desktop_config.json
- Add or update your config to include:
{
"mcpServers": {
"email": {
"command": "/Users/<profile>/.local/bin/uv",
"args": [
"--directory",
"/Users/<profile>/Documents/email-mcp/src",
"run",
"server.py"
]
}
}
}
Adjust paths as needed based on your local setup.
๐ฆ Install Dependencies
The project uses pyproject.toml for dependency management. Install all dependencies using UV:
uv pip install .
โ How It Works
- User asks a question in Claude Desktop.
- Claude identifies that the query may require email data.
- The MCP client triggers the
email_reader.pyscript via UV. - The script connects to Gmail using IMAP and retrieves relevant data.
- The result is returned to the MCP client.
- Claude responds to the user with a data-enriched answer.
Claude Output (send email)

๐ Author
Nelson