outlook-rag
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@outlook-ragsearch my email for the latest invoice from Acme"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
# outlook-rag

Semantic and keyword search for Outlook email through MCP. Index your mail locally and search it using an OpenAI-compatible embedding API.
Features
Semantic search combined with Japanese keyword search (BM25 + vector search).
All-date indexing of connected mail folders, including open archive PSTs.
Incremental updates, reusable embedding caches, and bounded batches.
Support for Qwen and other OpenAI-compatible embedding models.
Local storage with read-only access to Outlook.
Related MCP server: Outlook MCP Server
Requirements
Windows and Outlook Classic with a configured mail profile.
uv on your PATH.
An embedding API and its model name and API key.
Python 3.11-3.13 is supported. The example uses Python 3.12; uv can download it on the first run.
Installation
Add the following to your OpenCode configuration. Replace the model and API key with your own values.
{
"mcp": {
"servers": {
"outlook_rag": {
"type": "local",
"command": [
"uvx", "--python", "3.12", "--from",
"git+https://github.com/camucamulemon7/outlook-rag.git@v0.5.0",
"outlook-rag"
],
"environment": {
"OUTLOOK_RAG_MODEL": "Qwen/Qwen3-Embedding-8B",
"OUTLOOK_RAG_API_KEY": "YOUR_API_KEY"
}
}
}
}
}uvx installs the server and its dependencies on first connection. No clone or separate application configuration file is required. Reload OpenCode to connect; use an absolute path to uvx if it is not on your PATH.
The default embedding endpoint is http://localhost:8080/api/v1/embeddings. Add OUTLOOK_RAG_EMBEDDING_URL to environment for another endpoint.
For offline startup, replace @v0.5.0 with the full commit SHA shown on GitHub, run that command online once, then add --offline after uvx. Keep the Python version and uv caches available. Your embedding API must still be running.
Usage
Call
sync_emailsto index mail. Each call processes up to 200 changed emails by default; repeat until folder windows are complete and no folders remain pending.Call
search_emailswith a natural-language query, thenget_indexed_mailto read a result.Call
sync_emailsagain when you want to include new or changed mail. Sync does not run automatically.
For a smaller sync, pass {"max_total_emails": 10}. After bulk indexing, call optimize_index to build the vector search index.
Tool | Purpose |
| Update the local mail index |
| Search by meaning and keywords, with metadata filters |
| Read a cached email body |
| Check indexed counts and sync progress |
| Inspect connected stores, folders, and PST/OST paths |
| Build a vector search index from at least 256 chunks |
Configuration
Only the model and API credentials are required. Other settings have defaults:
Setting | Default |
Mail scope | All dates and connected mail folders; system/search folders excluded |
Database |
|
Embedding requests | Up to 8 chunks per batch, 2 requests concurrently |
Sync limit | 200 changed emails per call |
Vector dimensions | Up to 1,024 for Qwen3-Embedding; full dimensions for other models |
Changing the embedding model requires re-indexing. With the default database location, a separate index is selected automatically. If you set OUTLOOK_RAG_DATA_DIR, use a new directory for the new model.
See Configuration for optional settings and opencode.example.json for a ready-to-edit configuration.
Limitations and data handling
The server does not modify Outlook mail. Email text and vectors are stored locally; cleaned text and queries are sent to your configured embedding API.
Only indexed mail is searchable. Attachments, New Outlook, and disconnected PST files are not supported. Deleted or moved mail is removed from the local index by sync_emails with reconcile=true after a complete scan.
Development
git clone https://github.com/camucamulemon7/outlook-rag.git
cd outlook-rag
uv run --frozen python -m unittest discover -s tests -p test_offline.py -vLicense
MIT. Dependencies and embedding models have their own licenses.
This server cannot be deployed
Maintenance
Related MCP Connectors
Your own AI reads, searches and drafts in your mailbox, on your Windows computer.
Email infrastructure for AI agents — send, receive, search, and reply to email over MCP.
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
Personal knowledge base MCP server with semantic search, auto-categorization, metadata extraction
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceEnables AI-powered email management for Microsoft Outlook, allowing users to search, compose, organize, and batch forward emails using natural language commands with 100% local processing.34MIT
- FlicenseNot gradedqualityDmaintenanceEnables LLMs and MCP clients to read, search, and manage Microsoft Outlook emails through a standardized interface.-
- FlicenseNot gradedqualityDmaintenanceProvides LLMs with access to Microsoft Outlook email functionality, allowing them to read, search, compose, and manage emails through a standardized MCP interface on Windows.-
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to read, send, and manage Outlook mail locally on Windows via COM/MAPI, without cloud APIs.196 npm1MIT