Skip to main content
Glama

outlook-mcp(扩展分支)

通过 win32com 在 Windows 上为 Microsoft Outlook 提供 MCP 服务器——让 AI 助手 (Claude Code 和其他 MCP 客户端)能够通过本地运行的 Outlook 实例处理电子邮件、联系人、日历和 任务。无需 Azure AD、无需 Graph API、无需 OAuth——它通过 COM 驱动 Outlook 桌面客户端。

这是 lihaokun/outlook-mcp(PyPI: outlook-mcp-server 0.1.1,MIT)的扩展分支。上游提供 14 个工具;本分支提供 21 个,并修复了在生产环境中会出问题的三类 bug。它未发布到 PyPI ——请从本仓库安装(见下文),之后不要运行 pip install -U outlook-mcp-server,否则 PyPI 会覆盖它。

本分支在上游 0.1.1 基础上新增的内容

新工具(7 个) —— 上游只有 listCalendars + createEvent 用于日历,且没有任务相关工具:

  • listEvents、getEvent、updateEvent、deleteEvent

  • listTasks、createTask、updateTask

修复:

  • 时区:事件时间通过 StartUTC/EndUTC 读取,并使用 astimezone() 转换。Outlook 的 COM Start/End 属性报告的是本地墙上时间,并带有虚假的 +00:00 偏移;朴素的代码会偏移每个约会。

  • 区域设置安全的日期过滤器:DASL/Jet 日期字面量使用 win32api.GetDateFormat(LOCALE_USER_DEFAULT, ...) 格式化。Outlook 按系统区域设置解析过滤器 日期——在德语系统上,美式格式的 07/02/2026 会被读作 2 月 7 日。

  • COM 单元纪律:CoInitialize/CoUninitialize 在单个辅助函数(_run_com)中平衡调用,而不是临时调用。

  • --version:报告真实的已安装版本(上游有一个拼写错误,总是打印 dev)。

新增功能:

  • 所有事件工具都支持 calendarPath 参数,并在每个事件字典中输出,以便事件在多个/共享日历中可寻址。

  • 事件上暴露 busyStatus 和 meetingStatus。

  • 带 calendarId 的 createEvent 会保存,然后将项目移动到目标日历并显示移动后的项目。

  • 长消息正文会被截断,并提示调用 getMessage/getEvent 获取完整正文。

安全模型(与上游一致): 每个出站操作—— sendMail、replyToMessage、forwardMessage、createEvent、任务——都以 .Display() 结束,绝不会 .Send()。项目会在 Outlook 中打开,由人工点击发送。 服务器本身无法发送任何内容。

Related MCP server: MCP Outlook Tools

完整工具列表(21 个)

区域

工具

账户/文件夹

listAccounts、listFolders、createFolder

电子邮件

searchMessages、getRecentMessages、getMessage、sendMail、replyToMessage、forwardMessage、updateMessage、deleteMessages

联系人

searchContacts

日历

listCalendars、createEvent、listEvents、getEvent、updateEvent、deleteEvent

任务

listTasks、createTask、updateTask

要求

  • 安装了经典 Outlook 桌面客户端并完成配置的 Windows(服务器会附加到正在运行的实例,或通过 COM 启动一个)

  • Python 3.10+

安装

pip install git+https://github.com/K4uP/outlook-mcp.git

使用 Claude Code 注册(用户范围):

claude mcp add --scope user outlook -- outlook-mcp-server

如果 outlook-mcp-server 不在 PATH 中,请使用控制台脚本的完整路径,例如 %LOCALAPPDATA%\Programs\Python\Python312\Scripts\outlook-mcp-server.exe。 之后重启 Claude Code,并用 claude mcp list 验证。

已知问题

  • mcpServers 配置应放在 ~/.claude.json(用户范围)中——放在 settings.json 中无效。

  • 不带 calendarPath 的 listEvents 会混入共享/代理日历;当需要某人的可用性时,请传入明确的日历路径。

  • createEvent:省略 calendarId 以使用默认日历;某些 Exchange 环境在通过显式 id 寻址默认日历时会失败。

  • 通过 sendMail “发送”的邮件只是显示出来——在 Outlook 窗口中有人按下发送之前,不会有任何内容离开机器。

许可证

MIT——见 LICENSE。原始作品版权所有 (c) 2026 lihaokun; 扩展和修复版权所有 (c) 2026 Rene S. Kaup。

Related MCP Connectors

Related MCP Servers

  • F
    license
    C
    quality
    D
    maintenance
    A powerful MCP server that enables AI assistants to interact with Microsoft Graph API for managing Outlook emails, Calendar events, OneDrive files, and Contacts through natural language commands.
    35
    56
    -
  • A
    license
    Not graded
    quality
    F
    maintenance
    A Model Context Protocol server that enables AI assistants to interact with Microsoft Outlook for calendar management, email operations, and search functionality.
    15
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A Model Context Protocol (MCP) server that gives AI assistants full access to Microsoft Outlook emails, calendar, and contacts via the Microsoft Graph API.
    100 npm
    2
    MIT