ews-outlook-mcp

ews-outlook-mcp

MCP server for Claude to access on-premises Outlook/Exchange mailboxes via EWS with NTLM authentication, providing tools for email, calendar, and contact management without relying on Microsoft 365 or Graph API.

Category
访问服务器

README

ews-outlook-mcp

Personal MCP server that lets Claude read and manage an on-prem Outlook/Exchange mailbox via EWS (Exchange Web Services) with NTLM authentication — no dependency on OAuth or Microsoft 365, built for pure on-prem Exchange (no Microsoft 365/Graph).

Exposed tools

  • ews_list_inbox — lists the most recent Inbox messages
  • ews_search_inbox — searches the Inbox by subject
  • ews_get_message — fetches the full body of a message
  • ews_reply_message — replies (or reply-all) to an existing message
  • ews_send_message — composes and sends a new email
  • ews_move_message — moves a message to another folder (archive, etc.)
  • ews_list_calendar — calendar events between two dates
  • ews_create_event — creates a calendar event/meeting, with optional attendees
  • ews_update_event — reschedules/edits the time, subject, or location of an existing event
  • ews_add_attendee — adds an attendee to an existing event without touching the rest
  • ews_accept_event / ews_decline_event — responds to received meeting invitations
  • ews_delete_event — deletes a calendar event (sends a cancellation to attendees by default)
  • ews_resolve_contact — looks up a name in the GAL (corporate address book) to get their email before inviting them
  • ews_today_summary — unread messages + today's events, at a glance
  • ews_forward_message — forwards a message to new recipients with an optional comment
  • ews_flag_message — flags/unflags/completes the follow-up flag on a message
  • ews_list_folders — lists mailbox folders (including custom ones) with their unread counts

Installation

git clone git@github.com:devsergioherrera/Outlook-Exchange-MCP-Server.git
cd Outlook-Exchange-MCP-Server
npm install
npm run build

Installing for a non-technical user (with Claude Desktop)

To hand this server to another person (not a copy of the same credentials — each user needs their own), the only requirement is having Node.js installed (https://nodejs.org, LTS version — an officially signed installer, which usually clears corporate policies without issue) and Claude Desktop having been opened at least once.

Steps:

  1. Copy this whole folder (without node_modules, without .env, without dist) to the target machine — zip, USB, whatever works. node_modules and dist regenerate on their own; .env gets written locally with that person's own credentials.
  2. Double-click Instalar.bat.
  3. The script (setup.ps1):
    • Verifies Node.js is installed (if not, it warns and stops).
    • Runs npm install and npm run build.
    • Interactively asks for the Exchange URL, username, and password, and saves them to a local .env file (never sent anywhere — it just stays on that machine's disk).
    • Automatically registers the server in %APPDATA%\Claude\claude_desktop_config.json (creates the mcpServers.ews-outlook entry pointing at dist\index.js with the --openssl-legacy-provider flag), with no manual JSON editing required.
  4. Claude Desktop needs to be fully quit (including the system tray icon) and reopened afterward.

None of this requires admin rights or running an unsigned .exe — just Node.js (signed, standard installer) and a local PowerShell script, which tends to sail through corporate IT policies that do block loose executables.

Setting up credentials

The .env file needs to be created manually (never paste a password into a chat with an AI assistant):

cp .env.example .env
notepad .env

Fill in EWS_PASSWORD with the account's domain password. The .env file is in .gitignore and must never be pushed to any repository.

Registering the server in Claude Code

Add this to the MCP server config (claude mcp add or the corresponding config file). Requires the --openssl-legacy-provider flag (see "Technical notes" below — without it, NTLMv2 authentication fails on Node 17+ because of the MD4 hash being disabled in OpenSSL 3.x):

{
  "mcpServers": {
    "ews-outlook": {
      "command": "node",
      "args": ["--openssl-legacy-provider", "C:\\path\\to\\Outlook-Exchange-MCP-Server\\dist\\index.js"]
    }
  }
}

Or, from an interactive Claude Code session:

claude mcp add ews-outlook -- node --openssl-legacy-provider C:\path\to\Outlook-Exchange-MCP-Server\dist\index.js

Restart Claude Code so it picks up the new server.

.env credentials format

  • EWS_HOST: only the base host of the on-prem Exchange, e.g. https://mail.yourcompany.com — without a trailing /EWS/Exchange.asmx (node-ews builds that path internally; adding it manually makes calls fail with HTTP 400: Bad Request).
  • EWS_USERNAME: only the Windows/domain username, e.g. jdoe — no domain prefix (yourcompany.com\jdoe produces an incorrect NTLMv2 hash and Exchange responds with HTTP 401: Unauthorized; the domain is negotiated automatically, coming from the server's own NTLM challenge).
  • EWS_PASSWORD: the account's domain password, as-is.

Technical notes (fixes already applied — leave alone unless the reason is clear)

  • Patch to ntlm-client (patches/ntlm-client+0.1.1.patch, applied automatically by npm install via postinstall: patch-package): the library (unmaintained) has two compatibility bugs with IIS 10 / modern Exchange:
    1. decodeType2Message received the entire response object instead of the WWW-Authenticate header string, and hasOwnProperty('headers') silently failed on that object → every NTLM auth attempt failed with the generic message "The server didnt respond properly".
    2. The regex extracting the NTLM token required the header to start with NTLM (/^NTLM .../), but IIS returns WWW-Authenticate with several schemes together (NTLM <token>, Negotiate or Negotiate, NTLM <token>), so the anchored rule failed depending on order. The ^ was removed.
  • --openssl-legacy-provider: NTLMv2 depends on MD4, which OpenSSL 3.x (shipped with Node 17+) disables by default. Without this flag, the final handshake step (createType3Message) blows up with error:0308010C:digital envelope routines::unsupported.

Security notes

  • The EWS endpoint is usually https://<exchange-server>/EWS/Exchange.asmx, over HTTPS/443 — not to be confused with other ports the organization might use for SMTP or other services on the same server.
  • If the Exchange certificate is self-signed, the HTTPS connection may fail certificate validation. If that happens, confirmation is needed before disabling TLS verification — it's not a default fix to apply.
  • ews_reply_message sends a real email immediately (SendAndSaveCopy). There's no additional confirmation at this server's level — the confirmation happens in the Claude chat before the tool is invoked.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选