Outlook Email Processor
STDIOEmail processing server with MongoDB integration for semantic search and SQLite storage.
Email processing server with MongoDB integration for semantic search and SQLite storage.
This MCP server provides email processing capabilities with MongoDB integration for semantic search and SQLite for efficient storage and retrieval.
pip install uv
uv venv .venv
Activate the virtual environment:
Windows:
.venv\Scripts\activate
macOS/Linux:
source .venv/bin/activate
Install dependencies:
uv pip install -e .
uv pip install fastmcp
ollama pull nomic-embed-text
Add the server to your Claude for Desktop configuration file:
%APPDATA%\Claude\claude_desktop_config.json
~/Library/Application Support/Claude/claude_desktop_config.json
{ "mcpServers": { "outlook-email": { "command": "C:/Users/username/path/to/mcp-server-outlook-email/.venv/Scripts/python", "args": [ "C:/Users/username/path/to/mcp-server-outlook-email/src/mcp_server.py" ], "env": { "MONGODB_URI": "mongodb://localhost:27017/MCP?authSource=admin", "SQLITE_DB_PATH": "C:\\Users\\username\\path\\to\\mcp-server-outlook-email\\data\\emails.db", "EMBEDDING_BASE_URL": "http://localhost:11434", "EMBEDDING_MODEL": "nomic-embed-text", "COLLECTION_NAME": "outlook-emails", "PROCESS_DELETED_ITEMS": "false" } } } }
The server has been designed to support external tracing and monitoring solutions. The MCP logging implementation has been intentionally removed in favor of a more robust tracing approach that will be implemented separately.
Note: Do not attempt to re-implement the previous logging system. A new tracing solution will be provided in the future.
Configuration fields explained:
command
: Full path to the Python executable in your virtual environmentargs
: Array containing the full path to the MCP server scriptenv
: Environment variables for configuration
MONGODB_URI
: MongoDB connection stringSQLITE_DB_PATH
: Absolute path to SQLite database fileEMBEDDING_BASE_URL
: Ollama server URLEMBEDDING_MODEL
: Model to use for embeddingsLLM_MODEL
: Model to use for LLM operationsCOLLECTION_NAME
: Name of the MongoDB collection to use (required)PROCESS_DELETED_ITEMS
: Whether to process emails from the Deleted Items folder (optional, default: "false")disabled
: Whether the server is disabled (should be false)alwaysAllow
: Array of tools that don't require user confirmationautoApprove
: Array of tools that can be auto-approvedReplace the paths with the actual paths on your system. Note that Windows paths in the env
section should use double backslashes.
Process emails from a specified date range:
{ "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 }
The tool will:
"Process emails from February 1st to February 17th from all mailboxes"
The server uses a hybrid search approach:
SQLite database for:
MongoDB for:
The server provides detailed error messages for common issues:
The server implements proper resource management to prevent issues:
If you encounter issues: