outlook-mcp
by justinknn
README.md
# outlook-mcp
A small, local [MCP](https://modelcontextprotocol.io) server for **classic Outlook on Windows**.
It lets Claude (or any other MCP client) read, search, organize and draft mail in every mailbox
your Outlook already has: Gmail, IMAP, POP, Exchange, Microsoft 365.
No OAuth app, no API keys, no stored passwords. The server talks to the running `OUTLOOK.EXE`
over COM, so it sees exactly what you see in Outlook and nothing leaves your machine except what
the client reads.
- **One file**, two dependencies (`mcp`, `pywin32`), started by `uv`
- **All accounts at once**, or one server per mailbox (e.g. private and work kept apart)
- **Drafts by default**: sending is off until you switch it on
- Handles Outlook restarts and German folder names (`Posteingang`, `Entwürfe`, …)
## Requirements
- Windows with **classic Outlook** (the "new Outlook" has no COM interface)
- [uv](https://docs.astral.sh/uv/)
## Install
**Claude Code**, straight from GitHub:
```powershell
claude mcp add outlook -s user -- uvx --from git+https://github.com/justinknn/outlook-mcp outlook-mcp
```
**Claude Desktop** (`%APPDATA%\Claude\claude_desktop_config.json`):
```json
{
"mcpServers": {
"outlook": {
"command": "uvx",
"args": ["--from", "git+https://github.com/justinknn/outlook-mcp", "outlook-mcp"]
}
}
}
```
Or clone the repo and run the script directly. `uv` reads the dependencies from the file header:
```powershell
claude mcp add outlook -s user -- uv run --quiet --script "C:\path\to\outlook-mcp\outlook_mcp.py"
```
### One server per mailbox
```json
{
"mcpServers": {
"outlook-private": {
"command": "uvx",
"args": ["--from", "git+https://github.com/justinknn/outlook-mcp", "outlook-mcp"],
"env": { "OUTLOOK_MCP_ACCOUNTS": "me@gmail.com" }
},
"outlook-work": {
"command": "uvx",
"args": ["--from", "git+https://github.com/justinknn/outlook-mcp", "outlook-mcp"],
"env": { "OUTLOOK_MCP_ACCOUNTS": "me@company.com,billing@company.com" }
}
}
}
```
## Tools
| Tool | What it does |
|---|---|
| `list_accounts` | Accounts with unread / total counts in the inbox |
| `list_folders` | Folder tree of an account |
| `list_messages` | Newest mail in a folder (filters: unread only, last N days) |
| `search_messages` | Search subject / sender / body in one or all accounts; `folder="*"` searches every folder |
| `get_message` | Full text, recipients, attachment list |
| `save_attachment` | Save an attachment to disk |
| `create_draft`, `reply_draft`, `forward_draft` | Drafts, sent from the right account |
| `send_draft` | Send a draft. **Only with `OUTLOOK_MCP_ALLOW_SEND=1`** |
| `mark_read`, `set_flag`, `move_messages` | Keep the inbox tidy |
## Configuration
| Variable | Default | |
|---|---|---|
| `OUTLOOK_MCP_ACCOUNTS` | all | Comma-separated addresses or display names. Only these accounts are visible. |
| `OUTLOOK_MCP_ALLOW_SEND` | off | `1` enables `send_draft`. Otherwise the model can only write drafts that you send yourself. |
| `OUTLOOK_MCP_MAX_BODY` | `20000` | Max characters of a message body returned. |
## Good to know
- Outlook should be running. If it isn't, COM starts it in the background.
- `entry_id` changes when a message is moved; `move_messages` returns the new IDs.
- If Outlook shows *"A program is trying to access e-mail address information"*, your antivirus
status is usually out of date (File › Options › Trust Center › Programmatic Access).
- Mail content is untrusted input. A message can contain text aimed at the model, so keep sending
disabled unless you review what goes out.
## License
MIT
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues