MCP Outlook with OAuth2
Uses Keycloak as the OAuth2 identity provider, accepting access tokens via Authorization Code + PKCE and enforcing JWT scopes plus subject-to-mailbox mapping.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
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
Internal Exchange / Kubernetes: short deployment guide; manifests in
deploy/k8s/mcp.yaml.Local OAuth stand: reproduction steps; Compose starts Keycloak, PostgreSQL, MCP and an ingress to an existing LiteLLM. It does not install LiteLLM or Exchange.
Evidence: 59-call synthetic test report. No real mailbox data or credentials are included.
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…
This server cannot be deployed
Maintenance
Related MCP Connectors
Email, calendar and contacts for AI agents: Gmail, Microsoft 365 and IMAP accounts behind one API.
Gmail, Outlook, Drive, OneDrive and calendars for AI agents. Many accounts, one endpoint, audit log.
Gmail, Outlook, iCloud, Fastmail and any IMAP mailbox for your agent. Scoped OAuth, approved sends.
Manage Microsoft 365 email, calendar, contacts and inbox rules via the Graph API with OAuth 2.0.
Related MCP Servers
- 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.3043 PyPI12MIT
- AlicenseNot gradedqualityCmaintenanceEnables 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
- AlicenseNot gradedqualityBmaintenanceConnects 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
- AlicenseNot gradedqualityCmaintenanceGives 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