Exchange EWS MCP
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., "@Exchange EWS MCP show my upcoming meetings this week"
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.
Exchange EWS MCP v0.9.0
English | 简体中文
📮 Give your on-premises Exchange an AI assistant.
Tired of copying last week's report? Digging through old mail before every reply? Checking calendars one person at a time just to book a meeting?
Exchange EWS MCP connects an MCP Agent to Microsoft Exchange through EWS + NTLM. The Agent can search mail, prepare drafts, update weekly reports, check availability, and manage meetings — while important sends stay under user control.
Designed foron-premises Exchange with EWS + NTLM. It is not an Exchange Online / Microsoft Graph OAuth client.
✨ Highlights
📧 Search mail, compose drafts, reply, forward, edit drafts, add attachments.
👥 Resolve recipients from full pinyin names or complete email addresses.
📝 Update weekly reports while preserving the original Outlook HTML layout, including reports synthesized from other people's weekly-report emails.
📅 Check availability, find common time, create/edit meetings, and send invitations after confirmation.
🔐 Store passwords in Windows Credential Manager.
🛡️ Draft-first workflows keep the final send under user control.
Related MCP server: OWA Exchange MCP Server
🧭 Architecture
flowchart LR
A["MCP client / Agent"] -->|stdio| S["Exchange EWS MCP"]
S --> M["Semantic mail workflows"]
S --> W["Weekly-report workflow"]
S --> C["Calendar coordination"]
M --> E["EWS client + NTLM"]
W --> E
C --> E
E --> X["On-premises Exchange"]
M --> R["Local reference store"]
W --> R
C --> R
S --> K["Windows Credential Manager"]The server runs locally on Windows and exposes higher-level mail and calendar workflows to the Agent. Exchange credentials and low-level Exchange IDs stay behind the server.
🚀 Quick start
Clone → install → connect Exchange → paste one server path into your MCP client.
1. Requirements
Windows 10/11 or Windows Server
Python 3.10–3.13
Access to your Exchange EWS endpoint
An Exchange account allowed to use EWS with NTLM
2. Install
git clone https://github.com/ShermanGu/exchange-ews-mcp.git
cd exchange-ews-mcp
.\install.cmdThe installer creates .venv and installs everything locally.
3. Configure Exchange
.\.venv\Scripts\exchange-ews-mcp.exe configureSet the current mailbox user:
.\.venv\Scripts\exchange-ews-mcp.exe set-current-user `
--email "you@company.example" `
--display-name "Your Name"Check the connection:
.\.venv\Scripts\exchange-ews-mcp.exe status
.\.venv\Scripts\exchange-ews-mcp.exe testYour password is stored in Windows Credential Manager, not in the repository.
4. Set calendar preferences
.\.venv\Scripts\exchange-ews-mcp.exe set-calendar-preferences `
--time-zone "Asia/Shanghai" `
--workday-start "09:00" `
--workday-end "18:00" `
--slot-minutes 305. Connect your MCP client
✅ Recommended: point directly to the EXE
After installation, the production MCP server is:
<repo>\.venv\Scripts\exchange-ews-mcp-server.exeIf your MCP client has Command and Arguments fields:
Command:
D:\tools\exchange-ews-mcp\.venv\Scripts\exchange-ews-mcp-server.exe
Arguments:
<leave empty>Use an absolute path, save the configuration, then restart the MCP client.
Or use JSON
{
"mcpServers": {
"exchange-ews": {
"command": "D:\\tools\\exchange-ews-mcp\\.venv\\Scripts\\exchange-ews-mcp-server.exe"
}
}
}You can also run:
.\.venv\Scripts\exchange-ews-mcp.exe mcp-config6. Verify
.\.venv\Scripts\exchange-ews-mcp.exe version
.\.venv\Scripts\exchange-ews-mcp.exe tool-listExpected version: 0.9.0 · Production tools: 11
🎉 Done — your Agent can now work with Exchange.
💬 Try these prompts
Find my latest weekly report and update it with this week's progress.Summarize the weekly reports A and B sent me, then use that summary to generate my new weekly-report draft.Draft an email to wangxiaoming saying integration testing is complete. Don't send it.Find the earliest one-hour slot next week when lixiaohong and I are both free, create a meeting, and save it without sending.🧰 Main capabilities
Area | Capabilities |
Search/read mail, compose drafts, reply, forward, edit drafts, attachments | |
People | Recipient resolution and ambiguity handling |
Weekly reports | Read recent history and create an updated Reply All or fresh Compose draft without rebuilding HTML |
Calendar | Availability, common slots, calendar reads, create/update meetings, send invitations |
The compact mail facade uses search_mail, read_mail, resolve_people, save_mail_draft, and edit_mail_draft. Weekly reports use the single weekly_report entry followed by continue_action; HTML always remains server-owned. Calendar creation/editing uses save_meeting; confirmed sending uses send_meeting_invitation.
📝 Weekly reports
Direct user update ───────────────┐
├→ weekly_report(request=...)
search_mail/read_mail → LLM summary ┘
↓
Read recent history + slots
↓
Agent routes request by loc
↓
Update only relevant text
↓
Create an unsent Reply All or Compose draftFor aggregation prompts, the Agent first searches/reads the source reports and summarizes them; that summary becomes the request passed to weekly_report. The tool itself does not search other users' mail.
The Agent does not regenerate the whole HTML template. The server keeps the existing layout and updates approved text slots only. The Agent receives three weeks of context total (current editable report plus two prior reports), uses short local slot IDs such as s1, and the server automatically advances supported Subject date/week markers for the next draft.
🔒 Safety in short
Mail is draft-first.
Meeting sends require explicit confirmation.
Credentials stay in Windows Credential Manager.
Ambiguous recipients or meeting times are returned for confirmation instead of guessed.
📚 Documentation
Agent connection · Agent tools · Architecture · Weekly reports · Development tests · Changelog
For contributors: CONTRIBUTING.md · SECURITY.md
Limitations
Windows is the primary runtime target. EWS behavior depends on Exchange version and mailbox policy. Weekly-report editing currently expects a supported Outlook/Word HTML reply structure. Exchange Online users should generally prefer Microsoft Graph and modern authentication.
License
Released under the MIT License.
Available Tools
11 toolscontinue_actionB
恢复人员/邮件/时间确认,或提交 weekly_report 周报修改。
周报 selections 仅支持 changes 和可选 subject;changes 每项使用 weekly_report 返回的短 id/text,例如 {"id":"s3","text":"完成接口联调"}。weekly_report 返回的 subject 已是 Server 自动顺延后的默认草稿主题;通常无需再次提交 subject。
Inputs: selections (required), resume_token (required). Returns: object
edit_mail_draftA
修改邮件草稿并可追加允许目录中的本地附件,绝不发送。
所有附件会在第一次 Exchange 写入前完成路径和大小校验。draft_ref 只能是 邮件草稿引用;会议必须使用 save_meeting。
Inputs: draft_ref (required), cc, to, bcc, +4 more. Returns: object
find_meeting_timesC
解析参会人并查找共同空闲时间。
人员查询只接受姓名拼音或完整邮箱。默认把当前用户作为 Organizer, 同时尊重 Exchange 返回的个人工作时间;缺失时使用本地日历偏好。
Inputs: window_end (required), window_start (required), attendee_queries (required), max_results, +5 more. Returns: object
read_calendarA
按时间范围列出日程,或按 calendar_ref 读取一个日历项目。
读取单项时只提供 calendar_ref;列出日程时同时提供 start/end。
Inputs: end, limit, start, calendar_ref. Returns: object
read_mailC
读取邮件或草稿的正文、收发件人和附件元数据。
message_ref 与 draft_ref 必须且只能提供一个;不接受底层 Exchange ItemId。
Inputs: draft_ref, message_ref, max_body_chars. Returns: object
resolve_peopleA
使用姓名拼音或完整邮箱解析人员,并结合历史邮件消歧。
裸拼音会收集所有已配置公司域名下、邮箱 local-part 以该拼音开头的候选; 不会优先选择无数字后缀的邮箱。多个候选中若只有一个存在历史来往才自动选择。
Inputs: query (required), limit, auto_select, lookback_days. Returns: object
save_mail_draftA
新建、回复、Reply All 或转发邮件草稿,绝不发送。
compose 需要 subject/to_queries;其他模式需要 source_message_ref。reply 和 reply_all 不接受收件人;forward 需要 to_queries。reply/forward 创建后如需 改主题或加附件,继续调用 edit_mail_draft。
Inputs: mode (required), body_html (required), subject, cc_queries, +5 more. Returns: object
save_meetingA
创建或修改会议并始终保持未发送状态。
没有 calendar_ref 时创建:需要 attendee_queries、subject、body_html,以及 确定的 start/end;如需查找候选时间,先调用 find_meeting_times。提供 calendar_ref 时更新现有未发送会议;attendee_queries 此时只接受完整邮箱。 发送邀请必须另行调用 send_meeting_invitation。
Inputs: end, start, subject, location, +7 more. Returns: object
search_mailB
统一查找邮件并返回类型安全的稳定引用。
普通邮件返回 message_ref;草稿返回 draft_ref,不会同时伪装成可回复的消息。 无过滤条件时列出 inbox/sentitems 中最近邮件;姓名拼音或完整邮箱由 Server 解析和消歧。需要用户选择时返回 resume_token,由 continue_action 恢复。
Inputs: after, limit, before, offset, +7 more. Returns: object
send_meeting_invitationA
发送一个已保存但尚未发送的会议邀请。
只有显式设置 confirm_send=true 才会发送;已发送或已取消的会议会被拒绝, 避免重复邀请。必须使用 save_meeting/read_calendar 返回的 calendar_ref。
Inputs: calendar_ref (required), confirm_send. Returns: object
weekly_reportA
处理“周报”请求的唯一 Agent 入口。
request 是“本次要写入新周报的最终修改需求”。它既可以直接来自用户,也可以是 Agent 在调用本工具之前通过 search_mail/read_mail 读取其他人的周报或相关邮件后,先用 LLM 总结 得到的自然语言输入。若用户要求“总结 A、B 发给我的周报并生成我的周报”,应先完成邮件 搜索、读取和总结,再把总结结果作为 request 调用 weekly_report;不要把“去搜索并总结 A、B” 这类元指令原样作为 request。weekly_report 本身只处理自己的周报模板,不负责搜索他人的邮件。
返回紧凑 JSON:resume_token、mode、subject、request、instructions、最新模板的 slots, 以及前两周 history。slots.id 是本次上下文局部短 ID(s1、s2...),必须原样 使用,不得猜测或自行构造;loc 是压缩后的模板结构上下文,只用于理解版面和语义, 不参与真正写入定位。
生成下一周内容时,必须先语义拆解 request,再进行 slot routing。slot.loc 是原周报的显式
结构路径,每个路径文本后面的括号都会标明该文本在表格中的位置/层级身份,例如:
周报(纵向表头) = nl2sql项目(横向表头) > 项目进展(二级纵向表头)。= 表示一级
纵向表头与一级横向表头在当前内容位置交叉,> 表示继续进入更具体的下一级表头,越靠右
越具体。路由时主要理解括号前的真实表头文字,括号里的纵向/横向/二级等位置用于理解层级
和消歧;slot.text 是该路径末端当前承载的实际内容。不能因为某个 slot 文本关键词看起来最
相似,就把整段 request 放入该 slot。一段输入可以修改多个 slot;属于不同 loc 的事实必须
分别更新;只有确认属于同一 loc 的多条事实才合并后改写。用户本次事实
优先于历史;只提交确实需要变化的槽位;聊天性、情绪性或与正式周报无关的信息可以
忽略;无法可靠确定归属时不要猜测或修改无关 slot。
将口语化事实改写为简洁、正式、客观的周报文本;延续历史中的正式项目名和
技术术语,不得虚构事实。必须检查正文中所有周期性日期/周次并顺延。Server
会自动把可识别的 Subject 日期/周次顺延一周;返回的 subject 已是默认草稿主题。
然后调用 continue_action(resume_token=..., selections={"changes":[{"id":"s1","text":"..."}]})。
仅当用户明确要求不同主题时才传 selections.subject 覆盖默认值。本地参数错误时修正后复用同一 token;只有明确
context_stale、token 过期/已使用/被取代时才重新调用 weekly_report。
本工具不创建草稿,也绝不向 Agent 暴露 HTML。Server 会在 continue_action 阶段自动决定 Reply All 或新建草稿。
Inputs: request (required), folder, folders, lookback_days, +2 more. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Each tool targets a clearly distinct operation across mail, calendar, meetings, people resolution, and weekly reports. Overlaps in people resolution are contextual but descriptions make the intended tool unambiguous, and continue_action is explicitly tied to resume tokens.
All tool names use snake_case and most follow a predictable verb_noun pattern (read_calendar, search_mail, save_meeting). weekly_report is a noun phrase without a verb, which is a minor deviation from the otherwise consistent convention.
Eleven tools is well within the appropriate range for an Exchange EWS server covering mail, calendar, meetings, and a specialized weekly-report workflow. Each tool appears to earn its place without excessive fragmentation.
The mail surface can search, read, and draft but never send an email, creating a dead end for a core Exchange operation. Calendar tools also lack cancel/delete or modification of sent meetings, which are significant lifecycle gaps for the apparent domain.
Maintenance
Related MCP Connectors
Your IMAP mailbox as an MCP server: read, search and (if you allow it) organize mail. Open source.
Hosted MCP server for your Gmail, Outlook and IMAP mail, with mailboxes and scopes set per agent.
Hosted email MCP for your own Gmail, Outlook.com, Microsoft 365, iCloud or IMAP inbox: read, search, draft, reply in thread, forward and file mail. It moves or flags up to 500 messages in one call, and a send leaves exactly one copy in Sent. A calendar is a separate connection, and connecting one adds diary and scheduling tools.
MCP server for MailTempo's public free temporary email inboxes.
Related MCP Servers
- AlicenseCqualityBmaintenanceSecure MCP server for on-prem Microsoft Exchange (EWS) with tools for email, calendar, contacts, folders, attachments, and free/busy availability.3116MIT
- AlicenseAqualityCmaintenanceMCP server for any Microsoft Exchange / OWA deployment. Gives LLM agents access to email, calendar, directory search, folders, availability, and meeting analytics via 30 tools.3050 PyPI12MIT
- AlicenseAqualityDmaintenanceA local stdio MCP server that enables reading, sending, and searching emails, as well as listing calendar events via Microsoft Graph API, using device-code authentication.10MIT
- AlicenseAqualityBmaintenanceLocal-first Microsoft Outlook MCP server: a single Go binary that manages calendar events and mail through the Microsoft Graph API over stdio, with tokens stored in the OS keychain and no Entra ID app registration required. Exposes four aggregate tools (calendar, mail, account, system) dispatched by an operation verb, with multi-account support and read-only and mail-gating modes.445MIT