Gmail MCP Agent
G

Gmail MCP Agent

An automated lead nurturing system based on the Gmail API and MCP protocol, offering 24/7 email marketing, intelligent follow-up, and response tracking capabilities
2 points
0

Installation

Copy the following command to your Client for configuration
Note: Your key is sensitive information, do not share it with anyone.

๐Ÿš€ 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
โ”œโ”€โ”€ gmail_sync_state.json     # Gmail incremental sync state (auto - created)
โ”œโ”€โ”€ 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

๐Ÿ’ป Usage Examples

Basic Usage

# 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

Advanced Usage

# 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

๐Ÿ”ง Technical Details

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.

๐Ÿ“š 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.

๐Ÿ“„ 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

G
Gitlab MCP Server
Certified
The GitLab MCP server is a project based on the Model Context Protocol that provides a comprehensive toolset for interacting with GitLab accounts, including code review, merge request management, CI/CD configuration, and other functions.
TypeScript
16.6K
4.3 points
N
Notion Api MCP
Certified
A Python-based MCP Server that provides advanced to-do list management and content organization functions through the Notion API, enabling seamless integration between AI models and Notion.
Python
14.8K
4.5 points
D
Duckduckgo MCP Server
Certified
The DuckDuckGo Search MCP Server provides web search and content scraping services for LLMs such as Claude.
Python
45.0K
4.3 points
M
Markdownify MCP
Markdownify is a multi-functional file conversion service that supports converting multiple formats such as PDFs, images, audio, and web page content into Markdown format.
TypeScript
24.7K
5 points
U
Unity
Certified
UnityMCP is a Unity editor plugin that implements the Model Context Protocol (MCP), providing seamless integration between Unity and AI assistants, including real - time state monitoring, remote command execution, and log functions.
C#
19.2K
5 points
F
Figma Context MCP
Framelink Figma MCP Server is a server that provides access to Figma design data for AI programming tools (such as Cursor). By simplifying the Figma API response, it helps AI more accurately achieve one - click conversion from design to code.
TypeScript
45.5K
4.5 points
M
Minimax MCP Server
The MiniMax Model Context Protocol (MCP) is an official server that supports interaction with powerful text-to-speech, video/image generation APIs, and is suitable for various client tools such as Claude Desktop and Cursor.
Python
30.3K
4.8 points
G
Gmail MCP Server
A Gmail automatic authentication MCP server designed for Claude Desktop, supporting Gmail management through natural language interaction, including complete functions such as sending emails, label management, and batch operations.
TypeScript
15.0K
4.5 points