m365-mcp
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., "@m365-mcpshow my upcoming calendar events"
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.
m365-mcp
Production-grade Microsoft 365 MCP server — Email, Calendar, Contacts, OneDrive, Teams, Tasks, and Users via delegated OAuth.
Built from the best of both office365-connector (delegated OAuth, multi-account) and mcp-microsoft365 (MCP protocol, full scope), with all the gaps fixed: pagination, rate limiting, retry logic, proper timezone handling, and TypeScript throughout.
Why this exists
This comparison reflects the code shipped in
mcp-microsoft365 v1.0.0
and
office365-connector v2.0.0
as reviewed on July 18, 2026.
Feature |
|
|
|
Auth flow | Client credentials (app-only) | Device code + client secret | Public-client device code |
Access model | Application permissions (tenant-wide) | Delegated (signed-in user) | Delegated (signed-in user) |
Client secret | Required | Required and stored locally | None ✅ |
MCP server | ✅ | ❌ (CLI scripts) | ✅ |
Multi-account | ❌ | ✅ | ✅ |
Pagination | ❌ | ❌ | ✅ |
Graph 429 retries | ❌ | ❌ (not implemented in shipped code) | ✅ |
Read-only mode | ❌ | ❌ | ✅ |
✅ | ✅ | ✅ | |
Calendar | ✅ | ✅ | ✅ |
Contacts | ❌ | ❌ (documented, not shipped) | ✅ |
OneDrive | ✅ | ❌ | ✅ |
Teams | ✅ | ❌ | ✅ |
Tasks | ✅ | ❌ | ✅ |
Users | ✅ | ❌ | ✅ |
Implementation | TypeScript | JavaScript CLI | TypeScript |
Interface coverage | 19 MCP tools | CLI scripts | 44 MCP tools |
m365-mcp does not store a client secret or password. Tenant and client IDs are
non-secret identifiers; sensitive OAuth access and refresh tokens are stored
locally as permission-restricted plaintext files. See Security for
the storage and revocation details.
Related MCP server: Microsoft 365 MCP Server
Scope
Delegated permissions — the app acts AS YOU, not as the tenant. It can only access YOUR data:
Mail.Read/Mail.ReadWrite/Mail.SendCalendars.Read/Calendars.ReadWriteContacts.Read/Contacts.ReadWritePeople.Read(relevance-ranked people search)Files.Read.All(your OneDrive)Tasks.ReadWrite(To Do)Chat.Read/Chat.ReadWrite(Teams)User.Read+offline_access
These are delegated scopes, not tenant-wide application permissions. Set
M365_MCP_READ_ONLY=true before authentication and when running the server to
request only the read variants and disable mutating MCP tools.
Organization-wide mail application permissions such as Mail.Read.All are not used.
Setup
1. Create Azure Entra ID App Registration
New registration
Name:
m365-mcpSupported account types: Single tenant (or multi-tenant if you manage your own tenant)
Redirect URI: leave this blank; device-code flow does not use one
Click Register
Go to Authentication → Advanced settings
Set "Allow public client flows" to Yes, then click Save
This is required for device-code OAuth. Do not create or configure a client secret;
m365-mcpis a public client.
2. Add API Permissions
Under API Permissions → Add a permission → Microsoft Graph → Delegated permissions:
offline_access
User.Read
Mail.Read
Mail.ReadWrite
Mail.Send
Calendars.Read
Calendars.ReadWrite
Contacts.Read
Contacts.ReadWrite
People.Read
Files.Read.All
Tasks.ReadWrite
Chat.Read
Chat.ReadWriteClick Grant admin consent (or each user will consent individually during login).
Organization-wide user listing and lookup additionally requires delegated
User.Read.Allwith admin consent. This broader scope is not requested by default.
3. Install
Install the published command-line tools:
npm install --global @sam2kb/m365-mcpOr build from source:
# Clone
git clone https://github.com/sam2kb/m365-mcp.git
cd m365-mcp
# Install dependencies
npm install
# Build
npm run build4. Add Your Account & Authenticate
m365-mcp-auth add work <tenant-id> <client-id> you@company.com "Work account"
m365-mcp-auth login --account=work
AADSTS7000218or a missingclient_secret/client_assertionerror: Microsoft is treating the registration as a confidential client. Confirm that the configured Application (client) ID belongs to the registration you edited, then return to Authentication and verify Allow public client flows is saved as Yes. Do not work around this error by adding a client secret.
When running from a source checkout, use node dist/auth-cli.js instead of
m365-mcp-auth.
Follow the on-screen URL + code to sign in. Access and refresh tokens are stored
as plaintext JSON in ~/.m365-mcp/auth/ by default, protected with directory
mode 0700 and file mode 0600 where supported. Set M365_MCP_AUTH_DIR to
use another protected location.
5. Configure an MCP Client
The server uses standard MCP over stdio and works with any MCP client (Claude Desktop, Cursor, Continue, etc.).
OpenClaw
For the global npm installation, add this to your mcporter config at ~/.openclaw/mcporter.json:
{
"mcpServers": {
"m365": {
"command": "m365-mcp",
"args": [],
"env": {
"M365_ACCOUNT": "work",
"M365_TIMEZONE": "America/Chicago"
}
}
}
}Or via mcporter CLI:
mcporter config add m365 --stdio "m365-mcp" \
--env M365_ACCOUNT=work \
--env M365_TIMEZONE=America/ChicagoFor a source checkout, use "command": "node" with
"args": ["/absolute/path/to/m365-mcp/dist/index.js"].
Then restart OpenClaw for the server to load.
Other MCP Clients
Use the same JSON config in your client's MCP server configuration — m365-mcp is a standard stdio MCP server with no client-specific requirements.
Multi-Account
# Add more accounts
node dist/auth-cli.js add personal <tenant2> <client2> you@outlook.com "Personal"
node dist/auth-cli.js add client <tenant3> <client3> you@client.com "Consulting"
# Authenticate each
node dist/auth-cli.js login --account=personal
node dist/auth-cli.js login --account=client
# Set default
node dist/auth-cli.js default work
# List
node dist/auth-cli.js listEach account needs its own App Registration in its respective tenant. Tokens are isolated per account.
Available Tools (43)
📧 Mail (9 tools)
Tool | Description |
| List emails (folder, filter, search, paginated) |
| Read full email by ID |
| Send email (to/cc/bcc, HTML or plain) |
| Reply / reply-all to an email |
| Search emails across folders |
| Move email to another folder |
| Delete email |
| Mark as read/unread |
| List all mail folders with counts |
📅 Calendar (7 tools)
Tool | Description |
| Events in a date range (paginated) |
| Today's events, nicely formatted |
| Week view grouped by day |
| Create event (optional Teams meeting) |
| Update event |
| Cancel event with message |
| Free/busy lookup |
👤 Contacts (12 tools)
Tool | Description |
| List by folder and filter by one or more exact categories (any/all) |
| Search by name, email, or company |
| Full contact details |
| Create with multiple emails, phones, categories, addresses, and work or personal details |
| Update or clear contact fields and category assignments |
| Move a contact to Deleted Items |
| List unique categories in the default or selected folder with usage counts |
| List top-level or child contact folders |
| Create a child contact folder |
| Rename or move a contact folder |
| Delete a non-default contact folder |
| Fuzzy-search relevance-ranked recipients from mailbox signals, the organization directory, or both; filter identity type and optionally include profile details |
Outlook categories are tags stored on each contact; contact folders are containers. Category filtering is exact and case-insensitive, supports any/all matching, and can be combined with folder selection. Folder tools manage top-level folders and one direct child level, keeping the interface predictable.
The People API is intended for people-picker scenarios. m365_contacts_people_list
defaults to mailbox-relevant people and can target the organization directory or
both sources. Results include the primary email relevance score; optional profile
details add company, department, job title, office, and phones. Filters distinguish
organization users, personal contacts, and groups. The API does not expose private
Outlook Contact Lists or their membership.
📁 OneDrive (5 tools)
Tool | Description |
| List files/folders (paginated) |
| Search files |
| Read text file content |
| File/folder metadata |
| Create folder |
💬 Teams (3 tools)
Tool | Description |
| List your chats |
| Get chat messages |
| Send chat message |
✅ Tasks (5 tools)
Tool | Description |
| List To Do lists |
| List tasks in a list |
| Create task |
| Update task |
| Delete task |
👥 Users (3 tools)
Tool | Description |
| List org users |
| Get user profile |
| Get user's manager |
Development
npm install
npm run dev # tsx watch mode
npm run build # compile TypeScriptSecurity
Delegated OAuth — the app acts as the authenticated user; it does not use application credentials or tenant-wide mail permissions.
Device code flow — you never type your password into anything but Microsoft's login page.
Sensitive reads — mail, files, calendar entries, contacts, Teams messages, tasks, and user profiles can enter the MCP client's model context.
Real side effects — send, reply, move, create, update, and delete tools change Microsoft 365 data. Configure your MCP client to require explicit user approval before it invokes them.
MCP safety annotations — every tool declares read-only, destructive, idempotent, and open-world hints for clients that enforce tool policies.
Enforced read-only mode — set
M365_MCP_READ_ONLY=trueboth when authenticating and running the server. The auth flow requests read-only Graph scopes, mutating tools are omitted from discovery, and direct calls are blocked.Local token storage — access and refresh tokens are plaintext JSON protected by
0700directories and0600files where supported. Protect~/.m365-mcp/auth/or your configuredM365_MCP_AUTH_DIR.Auto-refresh — tokens refreshed before expiry, expired refresh tokens trigger re-auth.
No telemetry, no analytics, no third-party calls besides
login.microsoftonline.comandgraph.microsoft.com.
To delete a local token, remove its account:
m365-mcp-auth remove workIf a token or device may be compromised, also revoke the application's consent
from the Microsoft account or Entra ID portal. Re-authenticate after changing
M365_MCP_READ_ONLY so the stored token reflects the intended scope set.
License
MIT
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
- Alicense-qualityAmaintenanceA production-ready MCP server that provides secure, delegated access to Microsoft 365 services including Email, SharePoint, OneDrive, and Calendar. It enables AI models to search messages, browse files, manage calendar events, and parse document contents using OAuth 2.1 authentication.MIT
- AlicenseCquality-maintenanceAn MCP server that enables interaction with Microsoft 365 services like Outlook, OneDrive, Teams, and SharePoint via the Microsoft Graph API. It supports comprehensive operations including email management, file access, and organizational collaboration for personal and work accounts.78
- Alicense-qualityAmaintenanceMCP server for Microsoft 365 via the Microsoft Graph API, providing read-only access to profile, calendar, email, Teams chats, OneDrive files, and meeting transcripts from any MCP client.182MIT
Related MCP Connectors
Self-hosted federated MCP gateway: one OAuth 2.1 MCP server in front of N apps, user-level scopes.
Streamable HTTP MCP server for Google Calendar and Sheets with OAuth login.
Official Microsoft MCP Server to query Microsoft Entra data using natural language
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/sam2kb/m365-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server