Multi-surface email platform with MCP server, Discord bot, and web dashboard. AI-powered email management with team collaboration features.
A complete email management platform:
- MCP Server: 19 tools for programmatic email access
- Discord Bot: Slash commands for inbox management
- Web Dashboard: React/PWA for browser-based access
- Team Collaboration: Shared inboxes, assignments, analytics
- AI Features: Smart drafts, semantic search, inbox triage
v0.4.0 - All core epics complete.
Implemented:
- Gmail connector (OAuth, History API delta sync)
- 19 MCP tools with rules engine + rollback
- Discord bot with slash commands
- Web dashboard with PWA support
- Team collaboration (shared inboxes, assignments)
- AI features (drafts, semantic search, triage)
Not done:
- Outlook connector OAuth testing
- Integration tests with real Gmail
- Production deployment validation
node --version # v20 or higher
npm --version # v10 or highergit clone https://github.com/intent-solutions-io/intent-mail.git
cd intent-mail
npm installCreate OAuth credentials:
- Go to Google Cloud Console
- Create a new project (or use existing)
- Enable Gmail API: https://console.cloud.google.com/apis/library/gmail.googleapis.com
- Create OAuth 2.0 Client ID:
- Application type: Web application
- Authorized redirect URIs:
http://localhost:3000/oauth/callback
- Copy the Client ID and Client Secret
Configure environment:
cp .env.example .env
# Edit .env and add your credentials:# .env
GMAIL_CLIENT_ID=your-client-id.apps.googleusercontent.com
GMAIL_CLIENT_SECRET=your-client-secret
GMAIL_REDIRECT_URI=http://localhost:3000/oauth/callbackSet up OAuth consent screen (required by Google):
- Go to: https://console.cloud.google.com/apis/credentials/consent
- Choose External (unless you have Google Workspace)
- Fill in app name:
IntentMail Dev - Add your email as a test user
- Click Save
# Build TypeScript
npm run build
# Start MCP server
npm startYou should see:
Database initialized at ./data/intentmail.db
intentmail-mcp-server v0.1.0 started successfully
Listening on stdio...
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"intentmail": {
"command": "node",
"args": ["<absolute-path-to-intent-mail>/dist/index.js"]
}
}
}Replace <absolute-path-to-intent-mail> with the full path where you cloned the repository (e.g., /Users/you/projects/intent-mail on macOS, /home/you/intent-mail on Linux).
Restart Claude Desktop, then try:
Use the health_check tool
In Claude Desktop:
Use mail_auth_start with provider: gmail
Click the URL, authorize, and you're ready!
health_check- Server status and capabilitiesmail_auth_start- Start OAuth flow (Gmail/Outlook)mail_auth_complete- Complete OAuth with codemail_list_accounts- List connected accounts
mail_sync- Sync emails from provider (delta sync)mail_sync_stats- View sync statisticsmail_search- Full-text search with filtersmail_get_thread- Get email thread with all messagesmail_send- Send email with threading support
mail_list_labels- List all labels/foldersmail_apply_label- Apply labels to emails
mail_list_attachments- List email attachmentsmail_get_attachment- Download attachment
mail_list_rules- List automation rulesmail_create_rule- Create new rulemail_delete_rule- Delete rulemail_apply_rule- Apply rule with dry-run support
mail_get_audit_log- View execution historymail_rollback- Rollback rule executions
ββββββββββββββββββββββββββββββββββββββββββββ
β Claude Code / AI Assistant β
ββββββββββββββββββ¬ββββββββββββββββββββββββββ
β MCP Protocol (stdio)
ββββββββββββββββββΌββββββββββββββββββββββββββ
β IntentMail MCP Server (Node.js) β
β ββββββββββββββββββββββββββββββββββββββ β
β β 19 MCP Tools β β
β β (search, send, rules, rollback) β β
β ββββββββββββββββ¬ββββββββββββββββββββββ β
β β β
β ββββββββββββββββΌββββββββββββββββββββββ β
β β Rules Engine + Audit Log β β
β β (dry-run, plan, rollback) β β
β ββββββββββββββββ¬ββββββββββββββββββββββ β
β β β
β ββββββββββββββββΌββββββββββββββββββββββ β
β β SQLite Storage + FTS5 Search β β
β β (local database, full-text index) β β
β ββββββββββββββββ¬ββββββββββββββββββββββ β
ββββββββββββββββββββΌββββββββββββββββββββββββ
β
ββββββββββββββ΄βββββββββββββ
β β
βββββββΌβββββββ βββββββββΌβββββββββ
β Gmail API β β Outlook Graph β
β (History) β β (Delta sync) β
ββββββββββββββ ββββββββββββββββββ
- Gmail: Uses History API with
historyIdtracking - Outlook: Uses Graph API
/deltaendpoint withdeltaToken - Only fetches changed emails, not entire mailbox
- Works alongside normal email usage (web, mobile apps)
// Create a rule
mail_create_rule({
name: "Archive Newsletters",
conditions: [
{ field: "from", operator: "contains", value: "newsletter" }
],
actions: [
{ type: "archive" }
]
})
// Test it first (dry-run)
mail_apply_rule({ ruleId: 1, dryRun: true })
// Shows: "Would archive 15 emails"
// Apply it
mail_apply_rule({ ruleId: 1, dryRun: false })
// Changed your mind?
mail_rollback({ ruleId: 1 })
// Restores all emails to previous stateAll actions logged with before/after states:
{
"ruleId": 1,
"emailId": 42,
"stateBefore": { "labels": ["INBOX"], "flags": [] },
"stateAfter": { "labels": ["ARCHIVED"], "flags": ["SEEN"] },
"executedAt": "2025-12-24T10:00:00Z"
}- Email stored in SQLite (
./data/intentmail.db) - OAuth tokens encrypted with OS keychain
- No cloud storage required
- Offline access after initial sync
npm test # Run all tests
npm run typecheck # TypeScript strict mode checksqlite3 ./data/intentmail.db
> .tables
> SELECT * FROM accounts;
> SELECT COUNT(*) FROM emails;# Automatic mode (opens browser)
node test-oauth-auto.js
# Manual mode (paste code)
node test-oauth.jsbd list # List all tasks
bd show <id> # Show task details
bd update <id> --status in_progressQuick start:
docker-compose up -dFor distribution: See Docker Guide for:
- Multi-platform builds (AMD64, ARM64)
- Docker Hub publishing
- Custom client connections
- Security best practices
- Local/Docker: β Recommended (see Docker Guide)
- Google Cloud Run: β Not recommended (MCP requires stdio, not HTTP)
- Compute Engine: β Works (VM with Docker)
- Kubernetes: β Works (GKE, K8s)
See Setup Guide for infrastructure details (Terraform, WIF).
OAuth 2.0 only. No passwords stored.
Security features:
- OAuth tokens encrypted (OS keychain)
- Input validation with Zod schemas
- Audit log for all actions
- Rate limiting with exponential backoff
- TypeScript strict mode
Requirements:
- Don't commit
.envfiles - Don't share OAuth credentials
- Test rules with dry-run first
Report vulnerabilities: Security Policy
Current (Phase 3):
- Gmail connector (done)
- Rules engine (done)
- Outlook connector (needs testing)
- Integration tests (in progress)
Next (Phase 4):
- Real-time sync (push notifications)
- Background sync daemon
- Multi-account support
- Rule scheduling
Later (Phase 5):
- Web UI
- Analytics
- IMAP connector
Q: Does this replace Gmail/Outlook? No - IntentMail is a layer on top. You keep using Gmail/Outlook normally. IntentMail just gives AI access to automate things.
Q: What happens if I use Gmail while IntentMail is running? Everything stays in sync. Gmail is the source of truth. Changes you make in Gmail web/mobile show up in IntentMail, and vice versa.
Q: Can I undo actions?
Yes! Every rule execution is logged with before/after states. Use mail_rollback to restore emails to their previous state.
Q: Is my email data safe? Email is stored locally in SQLite (not in the cloud). OAuth tokens are encrypted. Code is open source for review.
Q: Does this work with personal Gmail accounts? Yes - works with both personal Gmail and Google Workspace accounts.
We welcome contributions! See Contributing Guide for:
- Code style guidelines
- How to add new connectors
- PR review process
- Where planning docs live
intent-mail/
βββ src/
β βββ index.ts # MCP server entry point
β βββ mcp/tools/ # 19 MCP tool implementations
β βββ connectors/ # Gmail, Outlook, IMAP
β βββ rules/ # Rules engine + parser
β βββ storage/ # SQLite + migrations
β βββ types/ # TypeScript interfaces
βββ infra/ # Terraform (GCP deployment)
βββ .github/workflows/ # CI/CD pipelines
βββ test-oauth-auto.js # OAuth testing scripts
βββ data/ # SQLite database (gitignored)
TBD - To be determined once project reaches beta.
- Documentation:
000-docs/ - GitHub: https://github.com/intent-solutions-io/intent-mail
- Issues: Use Beads task tracking (
bd list) - Security: Security Policy
- FAQ: FAQ - Common questions answered
- Docker: Docker Guide - Deployment guide
Stack: TypeScript, Node.js 20, SQLite, MCP SDK, Gmail API, Microsoft Graph
Status: Alpha. Breaking changes expected.