~/web4w3email-analytics-agentAgent
email-analytics-agent — README.md
cat README.md

# Email Analytics

Reads emails from Outlook and Gmail MCP servers, groups them by sender domain, and learns folder organization rules through interactive user feedback. Applies learned rules automatically on future runs — gets smarter every time.

cat email-analytics-agent/ARCHITECTURE.md

## How It Works

The agent connects to the Outlook MCP and Gmail MCP servers simultaneously. It reads unread emails, groups them by sender domain, and presents each group to the user interactively. You tell it which folder each group belongs to; the agent persists this as a rule in rules.json. On the next run, it auto-applies all known rules and only prompts for new senders.

Email Analytics Agent
    ├── Outlook MCP Server ──▶ inbox emails
    ├── Gmail MCP Server ──▶ inbox emails
    ├── Group by sender domain
    ├── Load rules.json (learned rules)
    ├── Auto-apply known rules
    └── Prompt for unknown senders ──▶ save to rules.json
email-analytics-agent --demo

## Screenshots

email-analytics — grouping run
  node dist/agent.js

   Connecting to Outlook MCP...  ✓
   Connecting to Gmail MCP...    ✓

   Loaded 12 learned rules
   Auto-applied to 47 emails

   Unknown senders (3 groups):
   ┌─────────────────────────────────┐
   │  github.com          (12 emails) │
   │  newsletter.co       (8 emails)  │
   │  no-reply@stripe.com (3 emails)  │
   └─────────────────────────────────┘
email-analytics — rule learning
   Where to move emails from github.com?
   > Dev / GitHub
   ✓  Rule saved: github.com → Dev / GitHub

   Where to move emails from newsletter.co?
   > Newsletters
   ✓  Rule saved: newsletter.co → Newsletters

   ✓  3 rules learned · 23 emails moved
   Next run: 70 emails will be auto-processed
grep -n "## Features" email-analytics-agent/README.md

## Features

  • +Multi-account: Outlook + Gmail
  • +Groups emails by sender domain
  • +Interactive rule learning
  • +Auto-applies rules on future runs
  • +Persistent rules.json storage
email-analytics-agent --compare

## vs. The Field

FeatureEmail AnalyticsSaneBoxManual sorting
Multi-account (Outlook + Gmail)
Rule learning from feedback
MCP integration
Free / open sourcepaidfree
Auto-applies learned rules
cd email-analytics-agent && cat INSTALL.md

## Installation

1

Set up email MCP servers

Install and configure the Outlook MCP and/or Gmail MCP servers from this ecosystem.

See the Outlook MCP Server and Gmail MCP Server project pages for setup instructions.

2

Install the agent

npm install
npm run build
3

Configure MCP connections

Edit config.json to point to your running email MCP servers.

{
  "servers": {
    "outlook": { "command": "npx", "args": ["-y", "@web4w3/install", "outlook"] },
    "gmail":   { "command": "npx", "args": ["-y", "@web4w3/install", "gmail"] }
  }
}
4

Run the agent

Interactive on first run; subsequent runs auto-apply all learned rules.

node dist/agent.js
cat email-analytics-agent/package.json | jq '.dependencies | keys'

## Tech Stack

Node.jsTypeScriptMCP SDKOutlook MCPGmail MCP