m365 mcp
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.
m365-cli
m365-cli gives an AI agent access to your own Outlook mailbox, calendar and Teams chats.
It has an MCP server for Claude Code (m365 mcp) and a CLI (m365). The results are short text, so the agent uses few tokens.
The tool controls classic Outlook through COM and uses the Outlook profile that is already signed in. For Teams, it uses the Teams web app in a separate browser profile. The calls run inside the signed-in Teams tab, so the sign-in tokens stay in the browser. It needs no Graph app registration and no admin consent.
Tools
Each MCP tool has a CLI command with the same function.
MCP tool | CLI | What it does |
|
| Finds mail in a folder or in all folders ( |
|
| Groups many mails by sender: count, unread, newest time, top subjects. Use it for "what is new". |
|
| Shows one mail as plain text, without the quoted history ( |
|
| Shows a full conversation over all folders, from the first message to the last. |
|
| Shows sent mails that have no reply after N days. |
|
| Shows the mailboxes you can use: your mailbox, other accounts, shared mailboxes. |
|
| Saves a draft: new, reply, reply-all or forward. Adds your Outlook font and signature. The body is Markdown. |
|
| Sends a draft now, or at a later time ( |
|
| Marks read or unread, flags, sets categories, moves, deletes. Works on one mail, many refs, or all mails that agree with a filter. |
|
| Lists or saves the attachments, or shows the text of a PDF, DOCX, PPTX, XLSX or text file. |
Most mail tools accept mailbox (a shared mailbox or another account). mail_draft accepts from_mailbox.
A reply to a mail in another mailbox goes out from that mailbox.
Calendar
MCP tool | CLI | What it does |
|
| Lists the events of a period, also recurring and moved occurrences. With |
|
| Shows one event: organizer, attendees, Teams link, description. |
|
| Finds periods in working hours when you and the attendees are free. |
|
| Saves a meeting (not sent) or a personal appointment. |
|
| Moves a meeting, or changes attendees, title or location. The attendees get no message yet. |
|
| Sends the invitation or the update of a meeting that you organize. |
|
| Accepts, tentatively accepts or declines a meeting. |
|
| Cancels a meeting that you organize, or deletes a personal appointment. |
|
| Removes canceled meetings of other people from your calendar. It notifies nobody. |
Briefing
MCP tool | CLI | What it does |
|
| One "what needs me today" summary across calendar, mail and Teams: today's meetings, unread and awaiting mail, and Teams mentions and unread. |
People
MCP tool | CLI | What it does |
|
| Shows the contact card (email, title, department, phone, manager) and the availability: free or busy now, out of office. |
Teams
MCP tool | CLI | What it does |
|
| Lists chats, group chats, meeting chats and channels, newest activity first. Filters: name, kind, unread. |
|
| Shows the newest messages of a chat: sender, time, text, quoted message, reactions, files. Pages with |
|
| What needs you: @mentions and replies to you, plus unread chats and channels. Use it for "what is new". |
|
| Full-text search across your Teams chats and channels. Each hit links to its conversation. |
|
| Lists files shared in a chat, or reads the text of one (PDF, DOCX, PPTX, XLSX, and text files such as .txt, .md, .csv, .json). |
|
| Prepares a message, a reply (with quote) or a first message to a person. The body is Markdown. |
|
| Sends a draft now, or at a later time ( |
|
| Shows a colleague's live Teams presence (available, busy, in a meeting, away, out of office, offline), status note and card. |
|
| Marks a chat or channel read up to its newest message (only your read state). |
|
| Reacts to a message, or edits/deletes one of your own. Visible to others, so it needs approval. |
A chat can be a ref (c:…) or a name: the chat title, or the other person of a 1:1 chat.
For a search across both mail and Teams, the agent combines mail_find and teams_search.
Limits
A mail with rights protection (Microsoft Information Protection) or S/MIME has the mark
[protected]. The tool cannot read its content.Most colleagues share only free/busy. Then
cal_findwithownergives an error and tells you to use free/busy.Teams uses your home account only. Guest accounts in other tenants are not used.
Teams has no supported API for this. The tool uses the internal API of the Teams web app, which can change. See docs/teams-api.md.
The first Teams listing can take one minute, because the tool looks up the names of 1:1 chats. Later listings use a cache.
Related MCP server: outlook-mcp
Safety
Each send has two steps.
mail_draft,cal_draft,cal_updateandteams_draftsave and show a preview. Onlymail_send,cal_send,cal_respond,cal_cancelandteams_sendsend.The five send tools have the flag
anthropic/requiresUserInteraction. Claude Code asks you before each call. Allow rules and auto mode do not skip the question.A Teams draft stays on your computer until
teams_send. The tool never sends to the chats inteams_protected.A send limit applies (default: 5 per minute). All sends go into a log. Run
m365 logto see the log.Mail bodies, attachment text, event descriptions and Teams messages are between
<<<UNTRUSTED …>>>markers. The server instructions tell the model to not obey text from other people.The tool removes control characters and invisible characters from all output.
The CLI asks before it sends. Use
--yesto send without a question. Use--draftto save only.
Install (Windows)
What you need
Classic Outlook, signed in. It can run in the background. Used for mail, calendar and people.
Google Chrome (google.com/chrome), only if you want Teams. The tool drives Teams in a separate Chrome profile.
The Microsoft Single Sign On Chrome extension (web store), only for Teams. On a work-joined (Entra/Intune) PC it is usually installed for you, and it signs Teams in automatically with your Windows login — no password prompt.
First-time install
Install uv and git:
winget install astral-sh.uv Git.GitInstall the tool (one command — it fetches the code and all dependencies, and puts
m365on your PATH as%USERPROFILE%\.local\bin\m365.exe):uv tool install git+https://github.com/JersyJ/m365-cli(Alternative without git: download the
.whlfrom the latest release and runuv tool install <the .whl>.)Sign in to classic Outlook (once), then test it:
m365 mail list -n 5Teams (optional): run
m365 teams browseronce to check the sign-in. The tool uses its own Chrome profile in%LOCALAPPDATA%\m365-cli\chrome-teams, started off-screen. On a work-joined (Intune) PC the Single Sign On extension is force-installed by policy into every profile, so Teams signs in by itself — the output shows"skype"and"me"when it is ready. Without that policy the fresh profile has no extension: runm365 teams browser --install-ssoto open its Web Store page in that profile and add it with one click, or simply sign in once with your work account in the window the tool shows.Later Teams commands start the browser by themselves. Keep it open if you use Teams often: a cold start takes about 20 seconds.
Connect your agent — see the next sections.
Update
m365 updateIt checks the latest release, downloads the wheel and reinstalls it in the background (a few seconds). Check with m365 version.
For developers
Work from the source instead of a release: clone the repo anywhere under C:\Users\<you>\, run uv sync, and use uv run m365 … (or .venv\Scripts\m365.exe). Update with git pull + uv sync; close Claude Code first if dependencies changed, because it locks the CLI binary. m365 update is only for the release install.
To cut a release: bump the version in pyproject.toml (the only place — the code reads it from the package metadata), commit, and push a matching tag, for example git tag -m v0.2.0 v0.2.0 && git push origin main v0.2.0. The workflow in .github/workflows/release.yml builds the wheel and attaches it to a GitHub Release; m365 update picks it up from there.
Connect Claude Code
Run this command once (in WSL or in Windows), then start a new Claude Code session:
claude mcp add m365 -s user -- /mnt/c/Users/<you>/.local/bin/m365.exe mcpConnect GitHub Copilot
Copilot CLI (in WSL or in Windows):
copilot mcp add m365 -- /mnt/c/Users/<you>/.local/bin/m365.exe mcpVS Code (Copilot agent mode): add this server to the user file %APPDATA%\Code\User\mcp.json, then select "Agent" in Copilot Chat:
{
"servers": {
"m365": {
"type": "stdio",
"command": "C:\\Users\\<you>\\.local\\bin\\m365.exe",
"args": ["mcp"]
}
}
}Safety with Copilot: the flag anthropic/requiresUserInteraction works only in Claude Code.
Copilot asks before each tool call by default. Do not auto-approve the send tools.
In Copilot CLI, block them for unattended runs: --deny-tool 'm365(mail_send)' --deny-tool 'm365(cal_send)' --deny-tool 'm365(cal_respond)' --deny-tool 'm365(cal_cancel)' --deny-tool 'm365(teams_send)'.
Settings
The file %APPDATA%\m365-cli\config.toml is optional. All keys are optional.
disabled_features = ["people"]
signature_new = "auto"
signature_reply = "auto"
signoff = ""
list_limit = 15
body_max_chars = 6000
work_hours = [8, 17]
max_sends_per_minute = 5
teams_protected = ["All Company*", "*Announcements*"]
teams_port = 9222Key | Meaning |
| Features to remove ( |
|
|
| Text that the tool adds to each text that it sends. |
| Number of items in a list (default 15). |
| Maximum length of a mail body in the result (default 6000). |
| Start hour and end hour for free-time searches. |
| Send limit for mail, invitations and Teams messages (default 5). |
| Teams chat titles that the tool never sends to. |
| DevTools port of the Teams browser on 127.0.0.1 (default 9222). |
| Browser executable (default: Chrome, then Edge) and its profile directory. |
More documentation
Disclaimer
This is an unofficial tool, not affiliated with or endorsed by Microsoft. It automates the products you are already signed in to, with your own account, on your own computer: classic Outlook through its public COM API, and the Teams web app through its own web requests. It accesses only data you can already see in those apps, it does not bypass any protection (rights-protected mail stays unreadable), and your sign-in tokens never leave the browser. The Teams web interface is not a supported API and can change at any time — the tool can break without notice. Check the IT policy of your organization before you use it at work. Use at your own risk.
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 inboxes and calendars for AI agents: send, receive, search, draft and schedule.
Email inboxes and calendars for AI agents: send, receive, search, draft and schedule.
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.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with Microsoft Outlook via the Microsoft Graph API for managing emails and calendar events. It allows users to read and send emails, list messages, and create calendar appointments with automatic Teams links.1ISC
- AlicenseBqualityCmaintenanceEnables AI assistants to manage Microsoft Outlook email and calendar through the Microsoft Graph API, including reading, sending, searching emails, and handling calendar events.4389 npm30MIT
- FlicenseBqualityDmaintenanceEnables LLMs to manage your Microsoft 365 calendar, tasks, and email via Microsoft Graph API, acting as a personal secretary.14-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to manage Outlook calendars and emails through the Microsoft Graph API, supporting calendar events, email operations, and selective tool control.12 npm1MIT