email-agent-mcp-server
Provides tools for reading unread Gmail emails, classifying them by importance, drafting personalized replies, and sending approved replies via the Gmail API.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@email-agent-mcp-servercheck my unread emails and draft replies for the important ones"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Email Triage Agent
An AI agent that reads your Gmail inbox, classifies incoming emails, drafts replies for anything important, and only sends after you review and approve — built with LangGraph, Gemini, and exposed as an MCP server so it can be used directly from Claude Desktop.
What it does
Fetches unread emails from Gmail (full body parsing, not just snippets)
Classifies each one —
spam,important,promotional,social, orupdates— with urgency, topic, and summaryDrafts a reply for anything classified as
important, personalized with the real sender name and company namePauses for human review — a conversational loop where you can approve, reject, or give feedback to revise the draft (as many rounds as needed)
Sends the final approved reply as a real email via the Gmail API, correctly threaded
Related MCP server: gmail-mcp-server
Architecture
Gmail (OAuth) → read_email → classify_intent → draft_response → human_review → send_reply
↓ (not important)
ENDThe same pipeline is exposed two ways:
Directly — run
email_agent.py, review in the terminalVia MCP — run
mcp_server.py, which wraps the pipeline as two tools (check_unread_emails,submit_review_feedback) callable from Claude Desktop or any MCP client, so you can review and approve emails just by talking to Claude naturally
Tech stack
langgraph— agent orchestration, state management, human-in-the-loop viainterrupt()langchain-google-genai— Gemini (gemini-2.5-flash) for classification and draftinggoogle-api-python-client+google-auth-oauthlib— Gmail API (read + send)fastmcp— MCP server exposing the agent as callable tools
Setup
1. Install dependencies
pip install -r requirements.txt2. Google Cloud setup
Create a project in Google Cloud Console
Enable the Gmail API
Create an OAuth client ID (Desktop app type) under Credentials
Download the credentials file and save it as
credentials.jsonin the project rootAdd yourself as a test user under Audience (while the app is in Testing mode)
3. Gemini API key
Get a key from Google AI Studio, then create a .env file:
GEMINI_API_KEY=your_key_here4. First run — authorize Gmail access
python email_agent.pyThis opens a browser window for one-time Google sign-in and authorization. A token.pickle file is saved afterward so you won't need to re-authorize on future runs.
Running it
Option A: Standalone script (terminal review)
python email_agent.pyFetches unread emails, processes each one, and walks you through review in the terminal — approve, reject, or type feedback to revise the draft.
Option B: MCP server (for Claude Desktop or any MCP client)
python mcp_server.pyExposes two tools:
check_unread_emails(max_results)— runs the full pipeline, returns classifications and any drafts pending reviewsubmit_review_feedback(email_id, feedback)— resumes a paused review with"approve","reject", or free-text revision instructions
Connecting to Claude Desktop
Add this to your claude_desktop_config.json under mcpServers:
"email-agent": {
"command": "path/to/venv/Scripts/python.exe",
"args": ["path/to/mcp_server.py"]
}Restart Claude Desktop, then just ask it to "check my unread emails" — it will call the tools and let you review/approve drafts conversationally.
Notes
Uses
MemorySaverfor checkpointing, which is in-memory only — review state won't survive a process restart. A persistent checkpointer would be needed for long-running production use.Retry policies are attached to
classify_intent,draft_response, andsend_replyto handle transient failures.Requires absolute paths for
.env,credentials.json, andtoken.picklewhen run by Claude Desktop, since it doesn't launch from the project's working directory by default.
License
MIT (or your preference)
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceIntegrates Gmail with Claude Desktop to fetch unread emails, generate AI-powered draft replies with customizable tone and style guides, and manage your inbox through natural language commands.Last updatedMIT
- Alicense-qualityDmaintenanceEnables AI-powered inbox management with natural language commands through Claude Desktop. Supports sending, reading, searching, organizing emails, and managing labels using Gmail API with automatic authentication.Last updated8MIT
- Alicense-qualityCmaintenanceEnables Claude to read, search, send, label, and trash emails in any Gmail account via Google's Gmail API, using OAuth2 authentication with automatic token refresh.Last updated67MIT
- Flicense-qualityDmaintenanceEnables reading unread emails and creating draft replies in Gmail via Claude Desktop.Last updated
Related MCP Connectors
Manage Gmail end-to-end: search, read, send, draft, label, and organize threads. Automate workflow…
Manage Gmail messages, threads, labels, drafts, and settings from your workflows. Send and organiz…
Read, search, send, organize, draft and schedule email across your inboxes from any MCP client.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Ali-Zia3500/email-agent-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server