
MCP (Model Context Protocol) server for any Microsoft Exchange / OWA (Outlook Web Access) deployment.
概览
MCP (Model Context Protocol) server for any Microsoft Exchange / OWA (Outlook Web Access) deployment. Gives LLM agents access to email, calendar, directory search, folders, availability, and meeting analytics via 30 tools. Works with any on-premise or hosted Exchange server that exposes OWA. Add to your MCP client config. Replace https://owa.example.com with your OWA URL. (~/Library/Application Support/Claude/claude_desktop_config.json): The login tool handles credential setup and authentication within the MCP session — no separate terminal needed. Subsequent logins (decrypts stored credentials): Both methods: 1. Open a headless browser to your OWA URL 2. Submit credentials 3. Wait for 2FA approval (up to 90 seconds) 4. Save encrypted session cookies to session-cookies.txt Credentials and session cookies are encrypted at rest with AES-256 (PBKDF2 key derivation, 480k iterations).
README
以下为原文 README 节选,完整内容请查看原文。
OWA Exchange MCP Server
MCP (Model Context Protocol) server for any Microsoft Exchange / OWA (Outlook Web Access) deployment. Gives LLM agents access to email, calendar, directory search, folders, availability, and meeting analytics via 30 tools.
Works with any on-premise or hosted Exchange server that exposes OWA.
Quick Start
# Copy and edit the MCP config with your OWA URL
cp .mcp.json.example .mcp.json
# One-time: set up encrypted credentials
python3 login.py --setup
# Login (opens headless browser, 2FA approval required)
python3 login.py
# Install the MCP server
pip install -e .
Install
Add to your MCP client config. Replace https://owa.example.com with your OWA URL.
Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"exchange": {
"command": "uvx",
"args": ["exchange-mcp-server"],
"env": {
"EXCHANGE_OWA_URL": "https://owa.example.com"
}
}
}
}
Cursor (.cursor/mcp.json):
{
"mcpServers": {
"exchange": {
"command": "uvx",
"args": ["exchange-mcp-server"],
"env": {
"EXCHANGE_OWA_URL": "https://owa.example.com"
}
}
}
}
Claude Code (.mcp.json):
{
"mcpServers": {
"exchange": {
"command": "uvx",
"args": ["exchange-mcp-server"],
"env": {
"EXCHANGE_OWA_URL": "https://owa.example.com"
}
}
}
}
Configuration
| Variable | Required | Description |
|---|---|---|
EXCHANGE_OWA_URL |
Yes | Base URL of your OWA instance |
EXCHANGE_COOKIE_FILE |
No | Path to session cookies file (default: session-cookies.txt) |
Login
Option A: Via MCP tool (recommended)
The login tool handles credential setup and authentication within the MCP session — no separate terminal needed.
First time (setup + login):
login(master_password="...", username="[email protected]", password="...")
Subsequent logins (decrypts stored credentials):
login(master_password="...")
Option B: Via CLI
python3 login.py --setup # First time: save encrypted credentials
python3 login.py # Login with 2FA
Both methods:
- Open a headless browser to your OWA URL
- Submit credentials
- Wait for 2FA approval (up to 90 seconds)
- Save encrypted session cookies to
session-cookies.txt
Credentials and session cookies are encrypted at rest with AES-256 (PBKDF2 key derivation, 480k iterations).
Tools (30)
Email (10)
| Tool | Description |
|---|---|
get_emails |
List emails from a folder with filtering |
get_email |
Get full email content by ID |
send_email |
Send a new email |
reply_email |
Reply to an email |
forward_email |
Forward an email |
delete_email |
Delete an email |
move_email |
Move email to another folder |
mark_email_read |
Mark email as read/unread |
安装
uvx exchange-mcp-server配置
{
"mcpServers": {
"exchange": {
"command": "uvx",
"args": ["exchange-mcp-server"],
"env": {
"EXCHANGE_OWA_URL": "https://owa.example.com"
}
}
}
}