AAM-FH/email-mcp-server
If you are the rightful owner of email-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
A production-ready Model Context Protocol (MCP) server designed to manage various productivity services through conversational AI.
Personal MCP Server - Email & Services Management
A production-ready Model Context Protocol (MCP) server with 121 tools for managing Gmail, Outlook, GitHub, Vercel, Confluence, Notion, Sanity, and Monday.com through conversational AI.
🎯 What is This?
This MCP server enables you to manage all your productivity services through natural conversation in Manus. Ask questions like:
- "What emails do I have from John?"
- "Create a Monday.com task from my latest email"
- "Analyze my unread emails and categorize them"
- "List my GitHub pull requests"
- "Search Confluence for API documentation"
✨ Features
📧 Email Management (29 tools)
- Gmail & Outlook support
- Search, read, send, reply, forward emails
- Label/folder management
- Archive, delete, mark as read/unread
- Thread management
🤖 AI Analysis (10 tools)
- Uses Manus LLM API (FREE - no OpenAI costs!)
- Email categorization (work, personal, newsletter, etc.)
- Priority detection (low, medium, high, urgent)
- Sentiment analysis
- Action item extraction with deadlines
- Calendar event detection
- Email summarization
- Smart reply suggestions
- 24-hour caching to reduce API calls
📋 Project Management (18 tools)
- Monday.com integration with production learnings
- API version 2025-10 for status column support
- Automatic revision handling
- Rate limiting & complexity tracking
- Batch operations with delays
- Color validation (40 valid colors)
- Create, update, delete items
- Board and group management
📚 Documentation (15 tools)
- Confluence - Search, create, update pages
- Notion - Query databases, manage pages, get blocks
💻 Development (28 tools)
- GitHub - Repos, issues, PRs, commits, branches, releases
- Vercel - Projects, deployments, domains, logs
📦 Content Management (8 tools)
- Sanity CMS - Query, create, update documents
- Asset upload and management
- Content search
⚙️ Configuration (13 tools)
- Tone profiles - Save 500+ word voice/tone instructions
- Folder rules - Automatic email organization
- Signatures - Multiple email signatures
- Quick replies - Template responses
- Import/export preferences
🚀 Quick Start
1. Deploy to Railway
# Clone or download this repository
cd email-mcp-server
# Push to GitHub
git init
git add .
git commit -m "Initial commit"
git push
# Deploy via Railway dashboard
# Go to railway.app/new → Deploy from GitHub
See for detailed instructions.
2. Configure Environment Variables
In Railway dashboard, set:
# Required
ENCRYPTION_KEY=your_64_char_hex_key # Generate with: openssl rand -hex 32
BUILT_IN_FORGE_API_URL=https://api.manus.im
BUILT_IN_FORGE_API_KEY=your_manus_key
# Optional (add services you want to use)
GMAIL_CLIENT_ID=...
GMAIL_CLIENT_SECRET=...
OUTLOOK_CLIENT_ID=...
GITHUB_CLIENT_ID=...
# ... etc
3. Connect to Manus
- Get your Railway URL:
https://your-app.railway.app - In Manus: Settings → MCP Servers → Add Server
- Enter URL and connect
4. Authenticate Services
In Manus chat:
Authenticate my Gmail account
Or visit: https://your-app.railway.app/auth/gmail
5. Start Using!
Search my emails from yesterday
Analyze my unread emails
Create a Monday.com task called "Review PRs"
List my GitHub repositories
📊 Architecture
┌─────────────────────────────────────────────────────────────┐
│ Manus Chat │
│ (Natural Language Interface) │
└──────────────────────────┬──────────────────────────────────┘
│
│ MCP Protocol
│
┌──────────────────────────▼──────────────────────────────────┐
│ Your MCP Server │
│ (Railway/VPS Hosted) │
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ 121 Tools │ │ AI Analysis │ │ SQLite │ │
│ │ │ │ (Manus) │ │ Cache │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │OAuth Tokens │ │Preferences │ │ Rate Limit │ │
│ │ (Encrypted) │ │ & Config │ │ Tracking │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
└──────────────────────────┬──────────────────────────────────┘
│
┌────────────────┼────────────────┐
│ │ │
┌─────────▼─────┐ ┌───────▼──────┐ ┌─────▼──────┐
│ Gmail/Outlook │ │ GitHub/Vercel│ │ Monday.com │
│ (OAuth 2.0) │ │ (OAuth 2.0) │ │ (OAuth 2.0)│
└───────────────┘ └──────────────┘ └────────────┘
💰 Cost Breakdown
| Component | Cost |
|---|---|
| Railway Hosting | $5-20/month |
| Manus LLM API | $0 (included) |
| Email APIs | $0 (FREE) |
| Service APIs | $0 (FREE) |
| TOTAL | $5-20/month |
🛠️ Technology Stack
- Runtime: Node.js 22 + TypeScript
- MCP SDK: @modelcontextprotocol/sdk
- Database: SQLite (better-sqlite3)
- Email: googleapis, @microsoft/microsoft-graph-client
- GitHub: @octokit/rest
- Sanity: @sanity/client
- Deployment: Docker + Railway
- Security: AES-256-GCM encryption for OAuth tokens
📁 Project Structure
email-mcp-server/
├── src/
│ ├── index.ts # Main MCP server entry point
│ ├── config/ # Configuration management
│ ├── auth/ # OAuth authentication (8 services)
│ │ ├── gmail.ts
│ │ ├── outlook.ts
│ │ ├── github.ts
│ │ └── services.ts
│ ├── services/ # Service layer
│ │ ├── gmail-service.ts
│ │ ├── outlook-service.ts
│ │ ├── github-service.ts
│ │ ├── vercel-service.ts
│ │ ├── confluence-service.ts
│ │ ├── notion-service.ts
│ │ ├── sanity-service.ts
│ │ ├── monday-service.ts
│ │ ├── ai-analysis-service.ts
│ │ └── preferences-service.ts
│ ├── tools/ # MCP tool implementations
│ │ ├── email/ # 29 email tools
│ │ ├── documentation/ # 15 documentation tools
│ │ ├── project-management/ # 18 Monday.com tools
│ │ ├── development/ # 28 GitHub/Vercel tools
│ │ ├── content/ # 8 Sanity tools
│ │ ├── cross-service/ # 10 AI analysis tools
│ │ └── preferences/ # 13 configuration tools
│ ├── database/ # SQLite schema
│ ├── utils/ # Utilities (logger, encryption)
│ └── types/ # TypeScript types
├── Dockerfile # Docker configuration
├── railway.json # Railway deployment config
├── DEPLOYMENT.md # Deployment guide
└── README.md # This file
🔒 Security
- OAuth tokens encrypted at rest with AES-256-GCM
- PBKDF2 key derivation (100,000 iterations)
- Secure file permissions (0o600) for token files
- No password storage - OAuth only
- Rate limiting to prevent API abuse
- Automatic token refresh before expiration
🎨 Example Use Cases
Email Triage
Analyze my unread emails and show me:
1. Urgent items that need immediate attention
2. Action items with deadlines
3. Emails that can be archived
Project Management
Create a Monday.com board for Q1 planning with:
- Status column (Not Started, In Progress, Done)
- Priority column (High, Medium, Low)
- 5 initial tasks
Documentation Search
Search Confluence for "API authentication" and summarize the key points
Code Review
List my GitHub pull requests that need review and show me:
- PR title and description
- Number of comments
- CI/CD status
Smart Replies
Generate 3 reply options for my latest email from Sarah:
1. Professional and detailed
2. Brief acknowledgment
3. Requesting more information
🧪 Testing Locally
# Install dependencies
pnpm install
# Build
pnpm build
# Set environment variables
cp .env.example .env
# Edit .env with your credentials
# Run
pnpm start
# Test with MCP Inspector
npx @modelcontextprotocol/inspector dist/index.js
📚 Documentation
- - Detailed deployment guide
- - Environment variables template
- - Quick start guide (coming soon)
🤝 Contributing
This is a personal MCP server template. Feel free to:
- Fork and customize for your needs
- Add new service integrations
- Improve AI analysis prompts
- Add more tools
📝 License
MIT License - See LICENSE file for details
🙏 Acknowledgments
- Built with MCP SDK
- Monday.com integration inspired by production learnings
- AI analysis powered by Manus LLM API
- Deployed on Railway
📞 Support
For issues or questions:
- Check for deployment issues
- Review Railway logs:
railway logs - Verify OAuth credentials and redirect URIs
- Test services individually
Built with ❤️ for conversational productivity
Ready to deploy? See for step-by-step instructions!