A community-driven registry for Claude, Cursor, Windsurf, Cline & more. Not affiliated with Anthropic.
Are you the author? Sign in to claim
mcp-server-outlook-email
A cross-platform MCP server that processes Microsoft Outlook emails, generates vector embeddings using Ollama, and provides semantic search capabilities. Works on Windows, macOS, and any platform via Microsoft Graph API.
The server complies with the Model Context Protocol (MCP) 2025-06-18 specification and uses the official MCP SDK.
| Category | Tools |
|---|---|
| Email Processing | process_emails |
| Search & Analysis | search_emails, analyze_email_sentiment, find_actionable_items |
| Data Export | export_email_data (CSV, JSON, HTML, Excel) |
| Folder Management | list_outlook_folders, get_folder_statistics, organize_emails_by_rules |
| Contact Management | extract_contacts |
| Statistics | get_email_statistics, check_data_consistency |
nomic-embed-text model| Platform | Requirement |
|---|---|
| Windows | Microsoft Outlook installed + pywin32 |
| macOS | Microsoft Outlook for Mac installed |
| Graph API | Azure AD app registration with Mail.Read permission |
pip install uv
uv venv .venv
# Windows
.venv\Scripts\activate
# macOS/Linux
source .venv/bin/activate
Core installation (required):
uv pip install -e .
Platform-specific extras:
# Windows (adds pywin32 for COM automation)
uv pip install -e ".[windows]"
# Graph API support (cross-platform cloud access)
uv pip install -e ".[graph]"
# All optional dependencies
uv pip install -e ".[all]"
ollama pull nomic-embed-text
If using Microsoft Graph API, you need to register an application in Azure AD:
Mail.Read, User.Read.All (for multi-account discovery)Add the server to your Claude for Desktop configuration file:
%APPDATA%\Claude\claude_desktop_config.json~/Library/Application Support/Claude/claude_desktop_config.json| Variable | Description | Required |
|---|---|---|
MONGODB_URI | MongoDB connection string | Yes |
SQLITE_DB_PATH | Path to SQLite database file | Yes |
EMBEDDING_BASE_URL | Ollama server URL (default: http://localhost:11434) | No |
EMBEDDING_MODEL | Embedding model name (default: nomic-embed-text) | No |
COLLECTION_NAME | MongoDB collection name | Yes |
PROCESS_DELETED_ITEMS | Process Deleted Items folder (default: "false") | No |
OUTLOOK_PROVIDER | Provider: auto, windows, mac, graph (default: "auto") | No |
LOCAL_TIMEZONE | Timezone for dates (default: "UTC", e.g., "America/Chicago") | No |
Graph API Variables (required when OUTLOOK_PROVIDER=graph):
| Variable | Description |
|---|---|
GRAPH_CLIENT_ID | Azure AD application (client) ID |
GRAPH_CLIENT_SECRET | Azure AD client secret |
GRAPH_TENANT_ID | Azure AD tenant ID |
GRAPH_USER_EMAILS | Mailboxes: comma-separated list or "All" for auto-discovery |
Uses native Outlook COM automation via pywin32.
{
"mcpServers": {
"outlook-email": {
"command": "C:/path/to/.venv/Scripts/python",
"args": ["C:/path/to/src/mcp_server.py"],
"env": {
"MONGODB_URI": "mongodb://localhost:27017/MCP?authSource=admin",
"SQLITE_DB_PATH": "C:\\path\\to\\data\\emails.db",
"EMBEDDING_BASE_URL": "http://localhost:11434",
"EMBEDDING_MODEL": "nomic-embed-text",
"COLLECTION_NAME": "outlook-emails",
"OUTLOOK_PROVIDER": "windows",
"LOCAL_TIMEZONE": "America/Chicago"
}
}
}
}
Uses AppleScript to communicate with Outlook for Mac.
{
"mcpServers": {
"outlook-email": {
"command": "/path/to/.venv/bin/python",
"args": ["/path/to/src/mcp_server.py"],
"env": {
"MONGODB_URI": "mongodb://localhost:27017/MCP?authSource=admin",
"SQLITE_DB_PATH": "/path/to/data/emails.db",
"EMBEDDING_BASE_URL": "http://localhost:11434",
"EMBEDDING_MODEL": "nomic-embed-text",
"COLLECTION_NAME": "outlook-emails",
"OUTLOOK_PROVIDER": "mac",
"LOCAL_TIMEZONE": "America/Los_Angeles"
}
}
}
}
Works on any platform with Azure AD credentials. Supports single or multiple mailboxes.
Single mailbox or specific mailboxes:
{
"mcpServers": {
"outlook-email": {
"command": "python",
"args": ["src/mcp_server.py"],
"env": {
"MONGODB_URI": "mongodb://localhost:27017/MCP",
"SQLITE_DB_PATH": "/data/emails.db",
"EMBEDDING_BASE_URL": "http://localhost:11434",
"EMBEDDING_MODEL": "nomic-embed-text",
"COLLECTION_NAME": "outlook-emails",
"OUTLOOK_PROVIDER": "graph",
"GRAPH_CLIENT_ID": "your-azure-ad-client-id",
"GRAPH_CLIENT_SECRET": "your-client-secret",
"GRAPH_TENANT_ID": "your-tenant-id",
"GRAPH_USER_EMAILS": "user1@example.com,user2@example.com"
}
}
}
}
All mailboxes in tenant (auto-discovery):
{
"mcpServers": {
"outlook-email": {
"command": "python",
"args": ["src/mcp_server.py"],
"env": {
"MONGODB_URI": "mongodb://localhost:27017/MCP",
"SQLITE_DB_PATH": "/data/emails.db",
"EMBEDDING_BASE_URL": "http://localhost:11434",
"EMBEDDING_MODEL": "nomic-embed-text",
"COLLECTION_NAME": "outlook-emails",
"OUTLOOK_PROVIDER": "graph",
"GRAPH_CLIENT_ID": "your-azure-ad-client-id",
"GRAPH_CLIENT_SECRET": "your-client-secret",
"GRAPH_TENANT_ID": "your-tenant-id",
"GRAPH_USER_EMAILS": "All"
}
}
}
}
When OUTLOOK_PROVIDER is set to auto (default), the server automatically selects the best provider:
| Platform | Auto-Selected Provider |
|---|---|
| Windows | windows (COM automation) |
| macOS | mac (AppleScript) |
| Linux/Other | graph (requires Azure AD setup) |
For HTTP transport, run the server with the --http flag:
python src/mcp_server.py --http
This will start the server at http://localhost:8000/mcp with full 2025-06-18 protocol compliance including:
The HTTP transport supports both stateful and stateless operation modes.
Process emails from a specified date range and return structured results:
Input:
{
"start_date": "2024-01-01", # ISO format date (YYYY-MM-DD)
"end_date": "2024-02-15", # ISO format date (YYYY-MM-DD)
"mailboxes": ["All"] # List of mailbox names or ["All"] for all mailboxes
}
Output (Structured):
{
"success": true,
"processed_count": 150,
"retrieved_count": 200,
"stored_count": 180,
"failed_count": 20,
"message": "Successfully processed 150 emails (retrieved: 200, stored: 180, failed: 20)",
"error": null
}
The tool will:
"Process emails from February 1st to February 17th from all mailboxes"
The server uses a provider-based abstraction for cross-platform email access:
src/connectors/
├── base.py # OutlookConnectorBase (abstract interface)
├── factory.py # create_connector() with auto-detection
├── windows_connector.py # Windows COM via pywin32
├── mac_connector.py # macOS AppleScript via osascript
└── graph_connector.py # Microsoft Graph API (cross-platform)
All connectors implement the same interface, returning standardized EmailMetadata objects regardless of platform.
The server uses a hybrid storage approach:
SQLite Database:
MongoDB:
The server provides detailed error messages for common issues:
The server implements proper resource management to prevent issues:
This server has been upgraded to comply with the MCP 2025-06-18 specification:
protocolVersion: "2025-06-18" during handshakeThe process_emails tool returns a structured ProcessEmailsResult with:
success: Boolean indicating operation successprocessed_count: Number of emails successfully processedretrieved_count: Total emails retrieved from Outlookstored_count: Number of emails stored in SQLitefailed_count: Number of emails that failed processingmessage: Human-readable status messageerror: Error details if operation failedIf you encounter issues:
check_data_consistency tool to verify SQLite/MongoDB syncWindows:
pip show pywin32python -c "import win32com.client; print('OK')"macOS:
osascript -e 'tell application "Microsoft Outlook" to get name'Graph API:
GRAPH_USER_EMAILS is set correctly ("All" or comma-separated emails)| Platform | Limitation |
|---|---|
| Windows | Requires Outlook desktop app running |
| macOS | "New Outlook" may have limited AppleScript support; use Graph API as fallback |
| Graph API | Requires Azure AD setup; 30-day max date range enforced |
| All | Maximum 30-day processing range per request |
A Jetbrains IDE IntelliJ plugin aimed to provide coding agents the ability to leverage intelliJ's indexing of the codeba
Run Claude Code as an MCP server so any agent can delegate coding tasks to it
Browser automation using accessibility snapshots instead of screenshots