Email Intelligence MCP Server
Connects to a Gmail account via IMAP/SMTP to fetch, analyze, prioritize, and send emails on the user's behalf, using app-password authentication.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Email Intelligence MCP Server
AI-powered email intelligence and analysis server for the Model Context Protocol (MCP). Provides Claude with tools to automatically analyze, categorize, prioritize, and extract actionable intelligence from your emails.
GitHub: Kolaborate-Platforms/kola-mail
๐ Quick Start
Installation
# Clone the repository
git clone https://github.com/Kolaborate-Platforms/kola-mail.git
cd kola-mail
# Install dependencies and build
bun install
bun run buildConfigure Claude Desktop
Add to your Claude Desktop config file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"email-intelligence": {
"command": "bun",
"args": [
"run",
"/ABSOLUTE/PATH/TO/kola-mail/src/index.ts"
],
"env": {
"EMAIL_INTELLIGENCE_LOG_LEVEL": "info",
"EMAIL_USER": "your-email@example.com",
"EMAIL_PASSWORD": "your-password",
"IMAP_HOST": "imap.example.com",
"IMAP_PORT": "993",
"IMAP_TLS": "true",
"SMTP_HOST": "smtp.example.com",
"SMTP_PORT": "465",
"SMTP_SECURE": "true",
"USE_DEMO_EMAILS": "false"
}
}
}
}Note: Replace /ABSOLUTE/PATH/TO/kola-mail with the actual path where you cloned the repository.
Restart Claude Desktop
IMPORTANT: Completely quit (Cmd+Q) and restart Claude Desktop for changes to take effect.
Test the Server
In Claude Desktop, say:
Test the email intelligence serverExpected response:
{
"status": "ok",
"message": "Email Intelligence MCP Server is running successfully!",
"version": "1.0.0"
}Related MCP server: MCP Email
โจ Features
๐ง Real Email Integration - Fetches emails via IMAP from your email server
๐ฏ Smart Categorization - 5 categories (urgent/important/routine/fyi/spam)
โก Priority Scoring - 0-10 intelligent priority based on 7+ factors
โ Action Item Extraction - Automatically detects tasks and deadlines
๐ Sentiment Analysis - Positive, neutral, or negative classification
๐ฌ Response Suggestions - AI-generated contextual replies
๐ค Email Sending - Send emails via SMTP
๐ Fast Caching - In-memory LRU cache with 5-minute TTL
๐ Secure - SSL/TLS encryption, no permanent storage
๐ ๏ธ Available Tools
1. test_server
Health check to verify server is running.
Usage:
Test the email intelligence server2. analyze_emails
Analyzes emails from your inbox with AI intelligence.
Parameters:
emailSource: "inbox", "unread", "recent", or "custom"limit(optional): Max emails to analyze (default: 50, max: 200)since(optional): ISO date, only analyze emails after this dateincludeBody(optional): Include full body (default: false)filter(optional): Filter by from/subject/keywords
Usage Examples:
Analyze my unread emailsAnalyze my emails from the last 7 daysShow me all urgent emails in my inboxReturns:
{
"emails": [
{
"id": "msg_123",
"from": "ceo@company.com",
"subject": "Urgent: Q4 Report Needed",
"analysis": {
"category": "urgent",
"priority": 9.5,
"sentiment": "neutral",
"actionItems": [
{
"text": "Send the Q4 report",
"priority": 9.5,
"deadline": "2025-10-22T17:00:00Z"
}
],
"hasDeadline": true,
"keyTopics": ["report", "deadline"],
"reasoning": "Category: contains urgent keywords..."
}
}
],
"summary": {
"totalAnalyzed": 1,
"urgentCount": 1,
"actionItemCount": 1,
"avgPriority": 9.5
}
}3. get_priority_emails
Returns priority-sorted emails with optional response suggestions.
Parameters:
count(optional): Number of emails (default: 10, max: 50)minPriority(optional): Minimum priority 0-10 (default: 7)categories(optional): Filter by categoriesincludeSuggestions(optional): Include AI response suggestions
Usage Examples:
Show me my top 5 most important emailsGet my urgent emails with response suggestions4. send_email
Sends an email from your configured email account via SMTP.
Parameters:
to: Recipient email(s)subject: Email subjectbody: Email body (plain text)html(optional): HTML bodyinReplyTo(optional): Message-ID for threadingreferences(optional): Thread references
Usage Example:
Send an email to john@example.com saying:
Subject: Meeting Follow-up
Body: Thanks for the meeting today. I'll send the report by Friday.๐ฏ Intelligence Engine
Category Classification
Category | Description | Indicators |
๐ด Urgent | Immediate action required | urgent, asap, critical keywords; CEO sender |
๐ก Important | High priority, timely response | action items, deadlines, VIP senders |
๐ข Routine | Normal business email | Standard communication |
๐ต FYI | Informational only | newsletters, updates, CC'd |
โซ Spam | Low value/promotional | unsubscribe links, promotional content |
Priority Scoring (0-10)
Base Score: 5 (neutral)
Modifiers:
Category: urgent +4, important +2, fyi -2, spam -5
Action Items: +1.5 per item (max +6)
Deadline Proximity:
Today: +3
1-3 days: +2
4-7 days: +1
Sender Importance:
CEO/C-suite: +3
Manager: +2
Client: +2
VIP list: +1
Email Age: >48h unread +2, >24h unread +1
Keywords: "decision needed" +2, "please respond" +1
Priority Ranges:
9-10: ๐ฅ Drop everything, respond now
7-8: โก High priority, respond today
5-6: ๐ Normal, respond within 2 days
3-4: ๐ Low priority, respond when convenient
0-2: ๐๏ธ Very low, may ignore
Action Item Detection
Automatically extracts action items using 20+ patterns:
Direct requests: "please...", "could you...", "can you..."
Formal requests: "kindly...", "request that you..."
Explicit items: "action item:", "to-do:", "task:"
Deadline-based: "by Friday...", "due...", "deadline..."
Sentiment Analysis
Keyword-based classification:
Positive: thank, appreciate, excellent, great, success
Negative: problem, issue, error, disappointed, failed
Neutral: update, information, meeting, schedule
๐ง Configuration
Environment Variables
Set in .env file or Claude Desktop config:
# Email Account (Required for real emails)
EMAIL_USER=your-email@example.com
EMAIL_PASSWORD=your-password
# IMAP Configuration (Incoming)
IMAP_HOST=imap.example.com
IMAP_PORT=993
IMAP_TLS=true
# SMTP Configuration (Outgoing)
SMTP_HOST=smtp.example.com
SMTP_PORT=465
SMTP_SECURE=true
# Server Settings
EMAIL_INTELLIGENCE_LOG_LEVEL=info # debug, info, warn, error
ANALYSIS_CACHE_TTL=300 # seconds (5 minutes)
ANALYSIS_MAX_EMAILS=200
# Mode
USE_DEMO_EMAILS=false # true = demo data, false = real emailsCommon Email Providers:
Gmail: IMAP:
imap.gmail.com:993, SMTP:smtp.gmail.com:465(requires app password)Outlook/Office 365: IMAP:
outlook.office365.com:993, SMTP:smtp.office365.com:587Custom/cPanel: Use your hosting provider's IMAP/SMTP settings
Customization
Edit src/config.ts to customize:
Priority scoring weights
Classification keywords
VIP sender list
Cache settings
๐ Architecture
src/
โโโ index.ts # MCP server entry point
โโโ types.ts # TypeScript type definitions
โโโ config.ts # Configuration and constants
โโโ email/
โ โโโ client.ts # IMAP/SMTP email client
โโโ intelligence/
โ โโโ analyzer.ts # Main analysis orchestrator
โ โโโ categorizer.ts # Category classification
โ โโโ prioritizer.ts # Priority scoring
โ โโโ action-extractor.ts # Action item detection
โ โโโ sentiment.ts # Sentiment analysis
โ โโโ response-generator.ts # Response suggestions
โโโ tools/
โ โโโ test-server.ts # Health check tool
โ โโโ analyze-emails.ts # Email analysis tool
โ โโโ get-priorities.ts # Priority emails tool
โ โโโ send-email.ts # Email sending tool
โโโ utils/
โโโ cache.ts # LRU cache with TTL
โโโ logger.ts # Logging utility๐ป Usage Examples
Example 1: Morning Email Triage
You: "Good morning! What are my most urgent emails?"
Claude:
Calls
get_priority_emails(minPriority=8)Fetches your real emails via IMAP
Returns: "You have 2 urgent emails:
CEO requesting Q4 report (Priority: 10/10)
Client bug report (Priority: 9/10)"
Example 2: Action Items
You: "What action items do I have from my emails?"
Claude:
Calls
analyze_emails(emailSource="unread")Extracts action items with deadlines
Returns organized list by priority
Example 3: Send Response
You: "Reply to that CEO email saying I'll have the report by EOD"
Claude:
Generates appropriate response
Calls
send_emailwith professional replySends via SMTP from your configured email account
๐งช Testing
Run Unit Tests
bun testType Check
bun run type-checkManual Test
# Run server in dev mode
bun run dev
# In another terminal, you can test MCP protocol๐ Troubleshooting
Server Not Connecting
Symptoms: "No result received" or connection errors
Solutions:
Restart Claude Desktop - Must completely quit (Cmd+Q on macOS, or Exit on Windows/Linux) and reopen
Check logs:
macOS:
~/Library/Logs/Claude/mcp-server-email-intelligence.logWindows:
%APPDATA%\Claude\Logs\mcp-server-email-intelligence.logLinux:
~/.config/Claude/logs/mcp-server-email-intelligence.log
Verify config path in
claude_desktop_config.jsonCheck credentials in env variables
IMAP/SMTP Connection Errors
Check:
Credentials are correct in
.envor configIMAP/SMTP servers are reachable:
telnet your-imap-host.com 993 telnet your-smtp-host.com 465For Gmail: Use an App Password instead of your regular password
Firewall allows connections
No Emails Found
Possible causes:
Inbox is empty
Filter criteria too restrictive
Demo mode enabled (
USE_DEMO_EMAILS=true)
Try:
Analyze all emails in my inbox (limit 10)Demo Mode vs Real Mode
Real Mode (Production):
Set
USE_DEMO_EMAILS=falseFetches actual emails from IMAP
Sends real emails via SMTP
Demo Mode (Testing):
Set
USE_DEMO_EMAILS=trueUses 6 built-in demo emails
No real email connections
๐ Security
โ Credentials stored in environment variables (gitignored)
โ SSL/TLS encryption for IMAP and SMTP
โ No email content permanently stored
โ Analysis cached temporarily (5-min TTL)
โ Logs go to stderr (not interfering with MCP protocol)
๐ Performance
Target: Analyze 50 emails in < 1 second
Cache: LRU with 5-minute TTL
Memory: < 100MB for 1000 emails
Throughput: 1000+ emails/minute
๐ Development
Project Setup
bun install
bun run buildWatch Mode
bun --watch run src/index.tsBuild
bun run build๐ Resources
The server exposes these MCP resources:
email://intelligence/rules- Current classification rules and keywordsemail://intelligence/stats- Cache statistics and performance metrics
๐ What Makes This Special
Intelligent Analysis
Goes beyond simple keyword matching
Multi-factor priority scoring
Context-aware categorization
Deadline detection and tracking
Real Email Integration
Direct IMAP/SMTP connection
No third-party APIs needed
Full control over your data
Works with any email provider
Claude Integration
Native MCP protocol
Seamless conversation flow
Natural language queries
Contextual responses
๐ License
MIT
๐จโ๐ป Author
Calvin Magezi & Claude
Version: 1.0.0 Status: โ Production Ready License: MIT
๐ Support
For issues or questions:
Check the troubleshooting section above
Review logs in your Claude logs directory (see troubleshooting section for paths)
Verify configuration in
claude_desktop_config.jsonTest with demo mode first:
USE_DEMO_EMAILS=trueOpen an issue on GitHub
๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Last Updated: October 22, 2025
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogโฆ
This server cannot be deployed
Maintenance
Related MCP Connectors
Email for AI agents: read, search and send from your Gmail, Outlook, Yahoo, iCloud or IMAP inbox.
Email on your own domains for AI agents: read, search, draft, reply and send from real mailboxes.
Email inboxes for AI agents: send, receive, search, drafts with owner approval, and webhooks.
Email inboxes for AI agents: read, search, reply, send, bulk send and read attachments.
1
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to read, search, and manage email via IMAP, and send emails with attachments via SMTP, using natural language commands.1,767 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to read, send, organize, and search emails across multiple IMAP/SMTP mailboxes.MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to read, search, send, reply to, forward, draft, schedule, organize, and analyze email across multiple IMAP/SMTP accounts, with labels, real-time inbox watching, verification-code capture, calendar extraction, and OAuth2 support. It also offers customizable presets, static rules, and a guided setup wizard for fast configuration.31 npmISC
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to read, search, send, reply, forward, schedule, organize, and analyze email across multiple IMAP/SMTP accounts, with provider-aware labels, drafts, templates, and bulk operations. Additional capabilities include real-time IMAP IDLE watching with AI triage, verification-code capture, calendar extraction, analytics, and optional Streamable HTTP or OAuth2 access.31 npmISC