
Gmail MCP Agent
Enables automated Gmail lead nurturing campaigns with intelligent follow-ups, response tracking, and 24/7 operation. Supports CSV-based contact management, template personalization, and real-time monitoring for enterprise-scale email outreach.
README
🤖 Gmail MCP Agent - 24/7 Lead Nurturing System
A comprehensive, enterprise-grade lead nurturing system that automates Gmail outreach campaigns with intelligent follow-ups, response tracking, and 24/7 operation via MCP (Model Context Protocol) server.
🚀 Features
✅ Automated Lead Nurturing
- 24/7 Operation - Runs continuously with Docker containerization
- Intelligent Follow-ups - Automatic sequences at 3 days and 7 days
- Response Tracking - Monitors Gmail for replies and categorizes them
- Lead Scoring - Tracks engagement and interest levels
- Smart Responses - Automatically responds to interested leads
📊 MCP Server Architecture
- Remote Control - Control system via MCP protocol
- Real-time Monitoring - Live status and performance tracking
- Docker Deployment - Production-ready containerization
- Health Checks - Automatic recovery and error handling
- Scalable Design - Ready for enterprise use
🎯 Email Campaign Management
- CSV-based Lead Lists - Easy contact management
- Template System - Jinja2-powered email personalization
- Rate Limiting - Respects Gmail API quotas
- Resume Capability - Continue from where you left off
- Comprehensive Logging - Complete audit trail
📁 Project Structure
├── send_from_csv.py # Main Gmail sender script
├── lead_nurturer.py # Automated nurturing system
├── mcp_server.py # 24/7 MCP server
├── mcp_client.py # Control interface
├── lead_dashboard.py # Monitoring dashboard
├── run_nurturing.py # Automation runner
├── contacts.csv # Lead database (96 dental practices)
├── body.txt # Email template
├── credentials.json # Gmail API credentials
├── nurturing_config.json # System configuration
├── requirements.txt # Python dependencies
├── Dockerfile # Container configuration
├── docker-compose.yml # Deployment setup
├── deploy.sh # One-click deployment
└── DEPLOYMENT_GUIDE.md # Complete setup guide
🛠️ Quick Start
1. Clone and Setup
git clone https://github.com/brandononchain/GMAIL-MCP-Agent.git
cd GMAIL-MCP-Agent
pip install -r requirements.txt
2. Configure Gmail API
- Get OAuth2 credentials from Google Cloud Console
- Save as
credentials.json
- Update sender email in
nurturing_config.json
3. Deploy 24/7 System
# Docker deployment (recommended)
./deploy.sh
# Or manual deployment
docker-compose up -d
4. Start Nurturing
# Using MCP client
python mcp_client.py start 4
# Or direct execution
python run_nurturing.py
🎮 Control Commands
MCP Client Interface
# Start nurturing system (every 4 hours)
python mcp_client.py start 4
# Check system status
python mcp_client.py status
# Get lead report
python mcp_client.py report
# Send test email
python mcp_client.py test your-email@example.com
# View recent logs
python mcp_client.py logs 100
# Stop the system
python mcp_client.py stop
Direct Scripts
# Run single nurturing cycle
python lead_nurturer.py
# View lead dashboard
python lead_dashboard.py
# Send emails from CSV
python send_from_csv.py contacts.csv --body_file body.txt
📊 Current Campaign
Dental Practice Outreach
- Target: 96 dental practices in Chicago
- Message: AI lead follow-up system for dental practices
- Follow-up Schedule: 3 days and 7 days after initial contact
- Expected Results: 20-30% response rate, 10-15% conversion
Email Template
Hi {{first_name}},
Did you know many dental practices lose 20–30% of new patient inquiries because follow-ups slip through the cracks?
We've built an AI agent that automatically follows up with every lead via SMS/email and books them straight into your calendar.
Clients typically see 5–9 extra appointments in the first 30 days.
Have time for 10-min demo call this week?
Thank you,
Brandon
Quantra Labs
🔧 Configuration
Environment Variables
# Gmail API Configuration
CREDENTIALS_FILE=credentials.json
TOKEN_FILE=token.json
# Nurturing Settings
PER_MINUTE=12
RESUME=false
LOG_FILE=send_log.csv
# MCP Server Settings
MCP_SERVER_PORT=8000
LOG_LEVEL=INFO
Nurturing Configuration
{
"sender_email": "your-email@domain.com",
"follow_up_schedule": {
"followup_1_days": 3,
"followup_2_days": 7
},
"automation": {
"check_responses_interval_hours": 4,
"auto_respond_to_interest": true
}
}
📈 Performance Metrics
Expected Results
- Response Rate: 20-30% from initial outreach
- Follow-up Response: 40-60% from follow-ups
- Conversion Rate: 10-15% to interested leads
- Automation Coverage: 80% of responses handled automatically
- Uptime: 99.9% with Docker restart policies
Monitoring
- Real-time lead scoring and status tracking
- Response rate analytics and conversion metrics
- System health monitoring and error reporting
- Complete audit trail of all interactions
🚀 Deployment Options
Docker (Recommended)
# One-click deployment
./deploy.sh
# Manual deployment
docker-compose up -d
Local Development
# Install dependencies
pip install -r requirements.txt
# Run nurturing system
python run_nurturing.py
Production Server
# Systemd service
sudo cp lead-nurturing.service /etc/systemd/system/
sudo systemctl enable lead-nurturing
sudo systemctl start lead-nurturing
🔒 Security & Privacy
- Local Data Storage - All data remains on your server
- OAuth2 Authentication - Secure Gmail API access
- No External Services - No data sent to third parties
- Encrypted Credentials - Secure credential management
- Audit Logging - Complete activity tracking
📞 Support & Documentation
- Deployment Guide:
DEPLOYMENT_GUIDE.md
- Nurturing Guide:
NURTURING_README.md
- Debug Report:
DEBUG_REPORT.md
- Docker Setup:
docker-compose.yml
🎯 Use Cases
Sales Outreach
- B2B lead generation and nurturing
- Automated follow-up sequences
- Response tracking and lead scoring
Marketing Campaigns
- Email marketing automation
- A/B testing and optimization
- Performance analytics
Customer Success
- Onboarding email sequences
- Renewal and upsell campaigns
- Customer feedback collection
📊 System Architecture
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ MCP Client │◄──►│ MCP Server │◄──►│ Lead Nurturer │
│ (Control) │ │ (24/7 Service) │ │ (Automation) │
└─────────────────┘ └──────────────────┘ └─────────────────┘
│
▼
┌──────────────────┐
│ Gmail API │
│ (Email System) │
└──────────────────┘
🏆 Enterprise Features
- 24/7 Operation - Continuous automation
- Scalable Architecture - Handle thousands of leads
- Professional Monitoring - Real-time dashboards
- Error Recovery - Automatic failure handling
- Audit Compliance - Complete activity logging
- Docker Deployment - Production-ready containerization
Ready to automate your lead nurturing? 🚀
This system is production-ready and can handle enterprise-scale email campaigns with full automation, monitoring, and 24/7 operation.
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
📧 Contact
- Author: Brandon
- Company: Quantra Labs
- Repository: GMAIL-MCP-Agent
推荐服务器

Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。