outlook-mcp
This MCP server provides comprehensive access to on-premises Microsoft Exchange via EWS for managing email, calendar, contacts, folders, and availability data.
Email: List, search, read, send, reply, forward, move, copy, delete, and mark emails; create and send drafts; download attachments.
Folders: List and create mailbox folders.
Calendar: List, get, create, update, and delete events; respond to meeting invites; find free time slots; get personal availability; list calendars.
Contacts: Search (personal and GAL), get, create, update, and delete contacts.
System: Test connectivity (ping) and retrieve mailbox metadata.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@outlook-mcpfind my unread emails from last week"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
outlook-ews-mcp
outlook-ews-mcp is an MCP server for on-prem Microsoft Exchange via EWS (exchangelib).
It gives MCP-compatible clients access to email, calendar, contacts, folders, attachments, and availability data through a single, testable Python service.
Note: this project was previously referred to as
outlook-mcp. It was renamed because that name is already taken on PyPI by an unrelated project — useoutlook-ews-mcpforpip/uvxinstalls and for the CLI commands below.
Short description
Secure MCP server for on-prem Microsoft Exchange (EWS) with tools for email, calendar, contacts, folders, attachments, and free/busy availability.
Related MCP server: mcp-email
Suggested repository topics / tags
mcp, model-context-protocol, exchange, microsoft-exchange, ews, outlook, email, calendar, contacts, python, automation, exchangelib
Highlights
email operations: list, search, read, send, reply, forward, move, copy, delete, mark
calendar operations: list, create, update, delete, respond to invites, find free slots
contacts operations: search, read, create, update, delete
folder operations and attachment download
Exchange auth via
NTLMandBasicMCP transport via
stdioandSSEcentralized error mapping and a single
ExchangeClientabstractionprivacy-safer smoke check output by default
Docker support and GitLab CI/CD pipeline included
Tool catalog
System
ping_exchangeget_mailbox_info
list_emailsget_emailsearch_emailssend_emailreply_emailforward_emailmove_emailcopy_emaildelete_emailmark_emaillist_folderscreate_foldercreate_draftsend_draftget_attachment
Calendar
list_eventsget_eventcreate_eventupdate_eventdelete_eventrespond_to_invitefind_free_slotsget_my_availabilitylist_calendars
Contacts
search_contactsget_contactcreate_contactupdate_contactdelete_contact
Typical use cases
connect Claude Desktop or another MCP client to on-prem Exchange
search inbox messages and fetch full email content
send or draft emails from AI workflows
inspect calendars and create meetings
check free/busy windows for scheduling
search personal contacts or the GAL
expose Exchange operations through a controlled MCP boundary instead of direct mailbox scripting
Security notes
What the current code does:
connects only to the Exchange/EWS endpoint configured in
EXCHANGE_SERVERdoes not contain telemetry, analytics, or third-party data export logic
keeps secrets in environment variables /
.envignores local secret files via
.gitignore(.env,.env.*, while keeping.env.example)logs only tool name, status, duration, and error code; it does not log message bodies, attachment contents, or passwords
excludes
.env, tests, caches, and VCS metadata from Docker build context via.dockerignore
What you should still be careful with:
EXCHANGE_VERIFY_SSL=falsedisables TLS certificate verification and should be used only for trusted internal/self-signed environmentsget_attachmentwrites files to disk, so choose a safe destination directoryoutlook-ews-mcp-smokeis privacy-safe by default and prints only masked mailbox info plus counts; setOUTLOOK_MCP_SMOKE_INCLUDE_DATA=trueonly if you explicitly want real inbox/event data in stdoutif you enable file logging with
LOG_FILE, protect that file with OS permissionsif you publish Docker images from CI, protect GitLab/GitHub project access and registry permissions
Quick start
uv venv
source .venv/bin/activate
uv pip install -e .[dev]
cp .env.example .env
outlook-ews-mcpBy default the server runs in stdio mode. Set MCP_TRANSPORT=sse to start an HTTP server.
Configuration
Example .env:
EXCHANGE_SERVER=https://mail.company.com/EWS/Exchange.asmx
EXCHANGE_USERNAME=DOMAIN\\username
EXCHANGE_PASSWORD=secret
EXCHANGE_EMAIL_ADDRESS=user@company.com
EXCHANGE_VERIFY_SSL=true
EXCHANGE_AUTH_TYPE=NTLM
EXCHANGE_VERSION=EXCHANGE_2016
EXCHANGE_TIMEOUT=30
EXCHANGE_MAX_RETRY_WAIT_SECONDS=90
EXCHANGE_TIMEZONE=Europe/Moscow
EXCHANGE_IMPERSONATE_AS=
ATTACHMENT_MAX_SIZE_MB=10
MCP_TRANSPORT=stdio
MCP_SSE_HOST=127.0.0.1
MCP_SSE_PORT=8080
LOG_LEVEL=INFO
LOG_FILE=Notes:
set
EXCHANGE_EMAIL_ADDRESSwhenEXCHANGE_USERNAMEis not an SMTP addressOAuth2is reserved in config, but this build currently supports live auth withNTLMorBasicEXCHANGE_IMPERSONATE_ASenables mailbox impersonation when Exchange permissions are configured accordinglyATTACHMENT_MAX_SIZE_MBis enforced before sending/replying/forwarding/drafting with local attachmentsEXCHANGE_MAX_RETRY_WAIT_SECONDSis a total backoff time budget (exchangelib retries transient errors with exponential backoff until this many seconds have elapsed), not a retry count; set to0to disable retries and fail fast on the first error
Claude Desktop example
{
"mcpServers": {
"outlook": {
"command": "outlook-ews-mcp",
"env": {
"EXCHANGE_SERVER": "https://mail.company.com/EWS/Exchange.asmx",
"EXCHANGE_USERNAME": "DOMAIN\\username",
"EXCHANGE_PASSWORD": "secret",
"EXCHANGE_EMAIL_ADDRESS": "user@company.com",
"EXCHANGE_AUTH_TYPE": "NTLM"
}
}
}
}Smoke check
After filling .env, run:
outlook-ews-mcp-smokeDefault output is sanitized for safer verification. If you intentionally want sample mailbox/event data in the output:
OUTLOOK_MCP_SMOKE_INCLUDE_DATA=true outlook-ews-mcp-smokeDocker
docker build -t outlook-ews-mcp .
docker run --rm --env-file .env outlook-ews-mcpCI/CD
The repository includes both a GitHub Actions workflow (.github/workflows/ci.yml) and a GitLab CI pipeline (.gitlab-ci.yml), each running the same lint (ruff) and test (pytest) stages on pushes and pull/merge requests.
GitLab CI additionally has:
build— builds Python package artifacts intodist/release— builds and pushes a Docker image to the GitLab Container Registry on the default branch and on tags
Default image tagging behavior:
default branch: pushes
:$CI_COMMIT_SHORT_SHAand:latestgit tag: pushes
:$CI_COMMIT_TAG
GitLab built-in registry variables are used:
CI_REGISTRYCI_REGISTRY_USERCI_REGISTRY_PASSWORDCI_REGISTRY_IMAGE
Development
uv run --python 3.12 --with '.[dev]' ruff check .
uv run --python 3.12 --with '.[dev]' pytest -qProject notes
The implementation is centered around a single
ExchangeClientabstraction so auth, transport, retries, and error mapping stay centralized.Errors are returned in a structured JSON form suitable for MCP
isError=truehandling.RTK.mdis not present in this repository, so the implementation followsPLAN.md.
Contributing
Bug reports and PRs are welcome — see CONTRIBUTING.md for how to set up a dev environment and run the test suite without a real Exchange server. For vulnerability reports, see SECURITY.md.
License
MIT — see LICENSE.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityDmaintenanceMCP server for any Microsoft Exchange / OWA deployment. Gives LLM agents access to email, calendar, directory search, folders, availability, and meeting analytics via 30 tools.Last updated306MIT
- AlicenseAqualityBmaintenanceMCP server that enables email management (send, read, search, delete, etc.) via IMAP/SMTP, compatible with Gmail, Outlook, Yahoo, iCloud, and other standard mail servers.Last updated11MIT
- Alicense-qualityBmaintenanceProduction-grade MCP server for Microsoft 365, providing tools to manage Email, Calendar, Contacts, OneDrive, Teams, Tasks, and Users via delegated OAuth.Last updated1,134MIT
- Flicense-qualityCmaintenanceMCP server for corporate Exchange that provides access to email, calendar, and people directory via OWA JSON API.Last updated
Related MCP Connectors
Read, search, send, organize, draft and schedule email across your inboxes from any MCP client.
MCP server for Appcircle mobile CI/CD platform.
MCP Server for agents to onboard, pay, and provision services autonomously with InFlow
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/viartemev/outlook-ews-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server