Damien Email Wrestler

by ivan-rivera-projects

Not rated
GitHub

About

An AI-powered email intelligence platform that integrates with Gmail and OpenAI. It can be run as a CLI tool or deployed on AWS Lambda for enhanced capabilities.

Details

Author
ivan-rivera-projects
Categories
Communication, Other, AI, Productivity

Setup

Install Damien Email Wrestler in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/ivan-rivera-projects/Damien-Email-Wrestler

Follow the installation instructions in the repository README, then restart your MCP client.

The AI-Powered Email Intelligence Platform

Damien Email Wrestler is anenterprise-grade AI email intelligence platformthat transforms how you manage email through natural language AI assistants like Claude. Built with hybrid CLI + AWS Lambda architecture, advanced AI intelligence, cost optimization, and seamless MCP integration.

Current Status: Professional Development Workflow v0.5.0🎉

🏆 Complete AI Email Intelligence Platform with Professional GitHub Workflow

- 49 Optimized Tools: Enhanced email management suite with natural language organization, smart cleanup, and auto-polling
- ✅ PROFESSIONAL WORKFLOW COMPLETE: GitHub automation, issue templates, PR validation, and automated labeling
- ✅ ENHANCED WORKFLOW VALIDATED: 282 marketing emails processed with 100% precision across production tests
- Hybrid Architecture: CLI reliability + AWS Lambda AI enhancement when configured
- Real-World Tested: 100-500 emails analyzed with 83-86% confidence pattern detection
- Precision Targeting: AI analysis → Email IDs → Precise bulk operations (zero false positives)
- Privacy-First Design: Metadata-only storage with automatic TTL cleanup (30-90 days)
- Cost-Effective: $0.01 per 100-email analysis, ~$1/month for single user
- Enterprise Grade: Privacy protection, scalable architecture, graceful fallback

- Natural Language Email Management: "Create a rule to archive newsletters" → Done automatically
- Hybrid AI Processing: CLI reliability + AWS Lambda enhancement for enterprise-grade analysis
- Real-World Validated: 83% automation coverage with 92% confidence pattern detection
- Privacy-First Architecture: Metadata-only storage, zero email content exposure
- Cost-Optimized: $0.01 per 100-email analysis with pay-per-request AWS Lambda
- Enterprise Scalability: Handles 66k+ email datasets with intelligent batching
- Real-time Intelligence: 14.49 seconds for 100-email analysis with Lambda enhancement

- 📊 Email Analysis: Detect patterns, sentiment, and business impact across thousands of emails
- 🤖 Smart Automation: Natural language rule creation - "Archive emails from newsletters"
- 💡 Intelligent Insights: Trend analysis, efficiency metrics, and optimization recommendations
- ⚡ Inbox Optimization: AI-powered decluttering and organization strategies
- 🔍 Advanced Search: Semantic search with RAG-enhanced context understanding

- Thread Management: Conversation-level operations with full context
- Draft Lifecycle: Create, edit, send, and manage drafts seamlessly
- Bulk Operations: Process thousands of emails efficiently with progress tracking
- Smart Filtering: Sophisticated rule-based automation with ML enhancement
- Label Management: Intelligent categorization and organization

- Privacy Protection: 99.9% accurate PII detection with reversible tokenization
- Cost Monitoring: Real-time token usage tracking with configurable alerts
- Performance Optimization: Smart model routing (gpt-4o-mini vs gpt-4o)
- Audit Compliance: GDPR/CCPA/HIPAA ready with immutable audit trails
- Scalable Architecture: Handle enterprise workloads with intelligent batching

Damien Email Wrestler consists of integrated components with hybrid CLI + AWS Lambda processing:

┌─────────────────┐ ┌─────────────────────┐ ┌──────────────────┐ ┌─────────────┐ │ │ │ │ │ │ │ │ │ AI Assistant │◄──►│ Smithery Adapter │◄──►│ Damien MCP │◄──►│ Gmail API │ │ (Claude) │ │ (Port 8081) │ │ Server │ │ │ │ │ │ │ │ (Port 8892) │ │ │ └─────────────────┘ └─────────────────────┘ └──────────────────┘ └─────────────┘ │ │ │ ▼ ▼ ┌─────────────────────┐ ┌─────────────────┐ │ Hybrid Processing │ │ │ │ Layer │ │ Smithery │ │ • Standard CLI │◄──────┐ │ Registry │ │ • Privacy Guard │ │ │ │ │ • Smart Router │ │ └─────────────────┘ │ • Batch Processor │ │ └─────────────────────┘ │ │ │ ▼ │ ┌──────────────────────────┐ │ │ AWS Lambda Enhancement │ │ │ (When Credentials Set) │ │ │ • Email Processor │ │ │ • AI Analyzer (85%+) │ │ │ • Rule Engine │ │ └──────────────────────────┘ │ │ │ ▼ │ ┌──────────────────────────┐ │ │ Privacy-First Storage │ │ │ • Metadata Only │ │ │ • TTL Auto-Cleanup │──────┘ │ • DynamoDB Tables │ │ • No Content Storage │ └──────────────────────────┘

- 49 Optimized MCP Tools: Focused email management toolkit with auto-polling capabilities
- Hybrid Processing: Standard CLI analysis + AWS Lambda AI enhancement (when configured)
- Graceful Fallback: Full functionality without AWS - Lambda enhances but never required
- FastAPI Backend: High-performance async API with comprehensive monitoring
- Enterprise Security: OAuth 2.0, rate limiting, audit logging

- MCP Protocol Bridge: Seamless integration with AI assistants
- Tool Discovery: Dynamic tool registration and capability advertisement
- Error Handling: Graceful fallbacks and retry mechanisms
- Performance Optimization: Connection pooling and caching

- Standard Processing: Always-available CLI-based analysis with pattern detection
- Lambda Enhancement: Enterprise-grade AI classification when AWS credentials configured
- Privacy Guardian: Enterprise-grade PII protection and tokenization
- Intelligence Router: ML-powered model selection for cost optimization
- RAG Engine: Semantic search with vector embeddings for contextual understanding
- Batch Processor: Scalable processing of large email volumes with progress tracking

- Email Processor: Privacy-safe metadata extraction and storage
- AI Analyzer: High-confidence email classification (85%+ accuracy)
- Rule Engine: Intelligent rule execution with conflict resolution
- DynamoDB Storage: Metadata-only storage with automatic TTL cleanup (30-90 days)
- Cost Optimization: Pay-per-request model (~$1/month for single user)

- Python 3.11+with Poetry
- Node.js 18+with npm
- Gmail API credentials(Setup Guide)
- OpenAI API key(for AI features)
- AWS Credentials(optional - for Lambda enhancement) (
Setup Guide)

# Clone repository git clone https://github.com/your-org/damien-email-wrestler.git cd damien-email-wrestler # Configure environment cp .env.example .env # Add your Gmail credentials and OpenAI API key to .env # Install dependencies cd damien-cli && poetry install && cd .. cd damien-mcp-server && poetry install && cd .. cd damien-smithery-adapter && npm install && cd ..
# Start all services with one command ./scripts/start-all.sh

Expected Output: ✅ All services running with health checks passed

Add to your~/.claude/claude_desktop_config.json:

{ "mcpServers": { "damien-email-wrestler": { "command": "node", "args": ["./damien-smithery-adapter/dist/index.js"], "cwd": "/path/to/damien-email-wrestler", "env": { "DAMIEN_MCP_SERVER_URL": "http://localhost:8892", "DAMIEN_MCP_SERVER_API_KEY": "your-api-key-from-.env" } } } }
# Authenticate with Gmail cd damien-cli && poetry run damien login # Run validation tests cd .. && ./run_e2e_tests.sh

🎉 You're ready! Try in Claude Desktop:"List my recent emails and suggest 3 automation rules"

# CLI Usage poetry run damien emails list --query "from:boss@company.com" --max-results 10 poetry run damien ai analyze-emails --days 30 --min-confidence 0.8 poetry run damien rules suggest --categories "productivity,automation" # Bulk Operations poetry run damien emails bulk-label --query "is:unread older_than:30d" --label "Archive" poetry run damien emails bulk-trash --query "category:promotions older_than:90d" --dry-run

- Smart Model Routing: Automatically uses gpt-4o-mini (90% cheaper) for simple tasks
- AWS Lambda: Pay-per-request model with automatic scaling
- Token Optimization: include_headers parameter reduces API calls by 80%+
- Query Optimization: Smart targeting of specific email categories
- Real-time Monitoring: Track costs with configurable alerts
- Actual Costs: $0.01 for 100-email analysis, ~$1/month for single user

- Email Analysis: 100 emails in 14.49 seconds (6.9 emails/second) ✅
- ✅ ENHANCED WORKFLOW: 282 marketing emails precisely targeted and trashed across 100/200/500 email tests ✅
- Precision Targeting: 100% accuracy - every AI-identified email successfully processed ✅
- Pattern Detection: 83-86% confidence in newsletter/promotional classification with statistical validation ✅
- Scalable Processing: Seamless handling of 100-500 emails with async workflow ✅
- Lambda Enhancement: 85%+ accuracy for high-confidence classification ✅
- Lambda Processing: Sub-300ms per function call ✅
- Gmail API Response: < 2 seconds ✅
- MCP Tool Execution: < 5 seconds per operation ✅
- Memory Usage: < 1GB during normal operation ✅

- Batch Processing: Handle 100K+ emails with intelligent chunking
- Progressive Operations: Real-time feedback for long-running tasks
- Parallel Operations: Multi-threaded processing with progress tracking
- Resource Management: Automatic cleanup and garbage collection
- Service Health: Comprehensive monitoring with automatic restarts

- Metadata-Only Storage: No email content stored, only privacy-safe metadata
- AWS Lambda Privacy: Cloud processing with zero content exposure
- Automatic Data Expiration: TTL-based cleanup (30-90 days)
- 99.9% PII Detection: Advanced pattern recognition for sensitive data
- Reversible Tokenization: Secure processing while maintaining recoverability
- Audit Trails: Immutable logging for compliance and debugging

- GDPR Ready: Data processing consent management and right-to-deletion
- CCPA Compliant: California privacy law compliance built-in
- HIPAA Considerations: Healthcare data protection patterns
- Access Control: Role-based permissions and API key management

- OAuth 2.0: Industry-standard authentication with Google APIs
- Rate Limiting: Prevent abuse and ensure fair usage
- Error Handling: Graceful failures without exposing sensitive data
- Encrypted Storage: All credentials and tokens securely stored

- Quick Start Guide- Get running in 15 minutes
-
API Reference- Complete tool documentation
-
Troubleshooting- Common issues and solutions
-
E2E Testing Guide- Production validation checklist

# AI Intelligence Configuration AI_MODEL_STRATEGY="cost_optimized" # cost_optimized | performance_optimized | balanced USE_OPENAI_API=true # Use OpenAI API vs local models TRACK_TOKEN_USAGE=true # Enable cost monitoring COST_ALERT_THRESHOLD_USD=10.00 # Alert when costs exceed threshold # Performance Tuning MAX_TOKENS_PER_REQUEST=4000 # Token limit per API call SIMPLE_TASK_MAX_TOKENS=1000 # Threshold for gpt-4o-mini usage COMPLEX_TASK_MIN_CONFIDENCE=0.8 # Threshold for gpt-4o usage # Privacy & Security PII_DETECTION_ENABLED=true # Enable PII protection AUDIT_LOGGING_ENABLED=true # Enable compliance logging CONSENT_REQUIRED=false # Require explicit consent for processing
# Start/Stop Services ./scripts/start-all.sh # Start all services ./scripts/stop-all.sh # Stop all services # Service Health curl http://localhost:8892/health # MCP Server health curl http://localhost:8081/health # Smithery Adapter health # Logs tail -f logs/damien-mcp-server.log # MCP Server logs tail -f logs/smithery-adapter.log # Adapter logs tail -f logs/token_usage.json # Cost tracking logs

- Time Savings: Automate 80% of routine email tasks
- Intelligence: AI-powered insights and pattern detection
- Control: Natural language commands with precise control
- Privacy: Enterprise-grade protection for personal emails

- Scalability: Handle thousands of emails across team members
- Compliance: Built-in audit trails and privacy protection
- Cost Efficiency: Optimized AI usage saves 80% on API costs
- Integration: Seamless connection with existing workflows

- MCP Protocol: Standard integration with AI assistants
- Extensible: 48 tools with easy customization options
- AWS Integration: Serverless Lambda functions with DynamoDB storage
- Hybrid Architecture: CLI + Cloud processing for optimal performance
- Enterprise Ready: Production-grade architecture and monitoring

Current (v0.4.2) - ✅ Enhanced Workflow Complete

- ✅ENHANCED EMAIL PROCESSING: 3-week implementation of precise email ID targeting system
- ✅PRODUCTION VALIDATED: 282 marketing emails processed with 100% precision across test scales
- ✅Smart Caching: LRU/LFU eviction with TTL optimization for repeat operations
- ✅Async Job Processing: Seamless handling of large datasets with real-time progress tracking
- ✅ Enhanced MCP tool suite (48 tools total: 39 core + 2 enhanced trash + 5 organization tools + 2 smart cleanup tools)
- ✅ Hybrid CLI + AWS Lambda AI enhancement architecture
- ✅ Privacy-first metadata-only storage with TTL cleanup
- ✅ Real-world validation: 100-500 emails with 83-86% confidence pattern detection
- ✅ Precision targeting: AI analysis → Email IDs → Precise bulk operations
- ✅ Cost-effective: $0.01 per 100-email analysis
- ✅ Enterprise scalability: Handles 66k+ email datasets
- ✅ Graceful fallback: Full functionality without AWS dependency

- 🔄 Real-time collaboration features
- 🔄 Advanced analytics dashboard
- 🔄 Multi-account Gmail support
- 🔄 Custom AI model training
- 🔄 Enhanced mobile compatibility

Development Phase (v0.6.0 - v0.9.x) - Q2-Q4 2025

- 📅 Multi-provider support (Outlook, Yahoo)
- 📅 Slack and Teams integration
- 📅 Advanced workflow automation
- 📅 Predictive email management
- 📅 Enterprise admin console
- 📅 Production hardening and optimization

- 🚀 First public release
- 🚀 Complete documentation and support
- 🚀 Enterprise deployment ready
- 🚀 Community and ecosystem launch

- Issues:GitHub Issues
- Documentation: This repository and linked guides
- Discussions:
GitHub Discussions
- Security: Email
security@damien-platform.comfor security issues

- Model Context Protocol (MCP)- AI assistant integration standard
-
Smithery- MCP tool registry and discovery
-
FastAPI- High-performance Python web framework
-
OpenAI- AI language models and embeddings
-
Gmail API- Email service integration

Transform your email experience with AI-powered intelligence. Welcome to the future of email management.🚀

An MCP server to interact with OpenAI's ChatGPT API for conversational AI and text generation.

A bridge server connecting Claude Desktop with the chakoshi moderation API for content safety.

Sends notifications from Claude Code with customizable sounds and cross-platform support.

Integrate with Google's Gemini AI models for various tasks.

An intelligent, LLM-powered email assistant using the Nylas v3 API.

A chat assistant that integrates an MCP client with an LLM and other external MCP servers.

Connect Restream MCP to Claude or ChatGPT to create, schedule, manage, and analyze live streams across 30+ platforms.

Let Claude book a real restaurant table for you - an AI voice agent places the actual phone call, even to restaurants that only take reservations by phone.

A server implementing Chain of Draft reasoning for enhanced problem-solving capabilities using OpenAI.

Secure audio transcription meets AI. Connect Alice recordings to Claude, ChatGPT, Gemini, and more.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.