Skip to main content
Glama
MCP Outlook with OAuth2
by iasemin

MCP Outlook with OAuth2

Русский · Deployment · Architecture and origins · Testing

A self-hosted MCP server for on-premises Microsoft Exchange: user OAuth2 authentication, EWS mailbox access, and integration with LiteLLM. Outlook desktop and Microsoft Graph are not required.

Status: all 12 tools passed 59 synthetic-backend calls through an existing LiteLLM 1.96.0 and real Keycloak OAuth2. The local suite has 32 tests. Live Exchange 2019 CU15 interoperability and Kubernetes deployment have not yet been verified.

LiteLLM → MCP OAuth proxy → Exchange EWS
              ↕
       AAS / Keycloak (lab)

MCP is the confidential OAuth2 client of AAS. It receives the callback, exchanges codes with PKCE, refreshes AAS tokens and stores them encrypted. LiteLLM receives separate MCP tokens; the AAS client secret stays in MCP. Keycloak substitutes for AAS in the lab. Exchange access still uses separate HTTPS + NTLM service-account impersonation. AAS password retrieval is not implemented; the actual platform contract is still required.

Capabilities

Mail search/read, attachment download, saved drafts and confirmed sending, read flags, message moves, directory lookup, and personal calendar events. See the tool/scope table.

This is an independent implementation using FastMCP and exchangelib. It is not a fork of ItayElizur/mcp-outlook and copies none of its code. The inspected reference commit, differences, and reasons are documented here.

Related MCP server: Slim EWS MCP Server

Get the code and build

git clone https://github.com/iasemin/mcp-outlook-with-oauth.git
cd mcp-outlook-with-oauth
uv sync --frozen
uv run pytest -q

docker buildx build --platform linux/amd64 \
  -t YOUR_REGISTRY/mcp-outlook-with-oauth:0.2.0 --push .

No container image is published by this repository yet; build and push to your own registry. Python package/module names remain outlook-ews-mcp / outlook_mcp.

Deployment

MIT license for this project's code. Dependencies retain their own licenses. This project is not affiliated with Microsoft.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      MCP server for any Microsoft Exchange / OWA deployment. Gives LLM agents access to email, calendar, directory search, folders, availability, and meeting analytics via 30 tools.
      30
      43 PyPI
      12
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables Claude to safely interact with an on-premises Microsoft Exchange mailbox via EWS for email operations like list, read, reply, forward, move, delete (soft), and mark read/unread, with enforced two-step confirmation on destructive actions.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Connects Claude to on-premises Exchange via EWS and Active Directory, enabling natural-language meeting-room booking, free/busy checks, calendar management, email handling, and org-chart-aware scheduling with OIDC-authenticated impersonation.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Gives AI clients controlled access to one or more Microsoft Exchange mailboxes over EWS to read, search, file, flag, send, and manage inbox rules and calendars. Multiple mailboxes are served from one endpoint with per-account read-only, send, and calendar-write gates that default to closed.
      MIT