Skip to main content
Glama
iasemin
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: Outlook 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.

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    D
    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
    34 PyPI
    10
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables LLMs and MCP clients to read, search, and manage Microsoft Outlook emails through a standardized interface.
    -
  • 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
  • F
    license
    A
    quality
    C
    maintenance
    Enables AI agents to interact with an OVH Exchange mailbox via EWS and NTLM authentication, including searching, reading, sending, replying to, and forwarding emails, as well as managing folders and attachments.
    8
    -