m365-organizer
Click on "Deploy 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-organizer create a Jobs folder and move all @linkedin.com emails into it"
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.
Built to turn an inbox of 52,000 unread notifications into fourteen folders in one afternoon, and to give Claude Code (or any MCP client) the organising tools that mail-reading MCP servers leave out.
🟧 What it adds
Tool | What it does |
| Every folder with path, total and unread counts |
| Create nested paths like |
| Top senders and domains in a folder, the input for a plan |
| Bulk-move existing mail from addresses or |
| Server-side inbox rules so future mail files itself |
| OneDrive listing, nested folders, moves |
Teams is not covered. Graph refuses Teams endpoints for personal accounts ("requires a valid license").
Related MCP server: Microsoft 365 MCP Server
🟧 Setup
1 · Entra app registration (free, three minutes)
In the Azure portal create an app with Supported account types = Personal Microsoft accounts only, no redirect URI, and under Authentication → Advanced settings set Allow public client flows = Yes.
Delegated Graph permissions are requested at runtime: Mail.ReadWrite MailboxSettings.ReadWrite Files.ReadWrite.All User.Read.
2 · Install
pip install git+https://github.com/Denovarix/denovarix-m365-organizerOn Windows, enable long paths first if pip fails on deep package paths (admin PowerShell):
Set-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem LongPathsEnabled 13 · Configure ~/.m365-organizer/config.json (see examples/config.example.json)
{ "client_id": "YOUR-ENTRA-APP-CLIENT-ID", "tenant_id": "consumers" }4 · Sign in once with the device-code flow. Tokens are cached in ~/.m365-organizer/token_cache.bin.
m365-organizer auth5 · Add to Claude Code
claude mcp add --scope user m365-organizer -- m365-organizer serve🟧 Organise a mailbox from the command line
python examples/apply_plan.py examples/plan.example.json # folders + rules + move backlog
python examples/apply_plan.py examples/plan.example.json --no-move # folders + rules onlyA plan is a JSON map of folder path to senders. Domains start with @, addresses do not:
{
"Jobs & Freelance/LinkedIn": ["@linkedin.com"],
"Finance/Banking": ["@axisbank.com", "@icicibank.com"],
"Personal": ["someone@example.com"]
}The script is idempotent: existing folders and rules are reused, and moves only touch what is still in the Inbox.
🟧 Layout
m365_organizer/graph.py MSAL device-code auth, retry/backoff, paging, $batch
m365_organizer/mail.py folders, sender stats, bulk move, inbox rules
m365_organizer/drive.py OneDrive list / mkdir -p / move
m365_organizer/server.py MCP server + `auth` / `serve` CLI
examples/ config and plan examples, apply_plan.py
assets/ brand assets (banner, social preview, icons)Available Tools
10 toolsdrive_create_folderB
Create a nested OneDrive folder path. Returns id.
Inputs: path (required). Returns: result
drive_listB
List OneDrive items at a folder path ('' = root).
Inputs: path. Returns: result
drive_moveB
Move a OneDrive item into dest_path (created if missing).
Inputs: item_id (required), dest_path (required), new_name. Returns: result
mail_add_sender_ruleC
Create an inbox rule routing future mail from senders/domains into dest_path.
Inputs: name (required), senders (required), dest_path (required), mark_read. Returns: result
mail_create_folderB
Create a nested mail folder path like 'Work/Clients/Acme'. Returns the leaf id.
Inputs: path (required). Returns: result
mail_delete_ruleC
Delete an inbox rule.
Inputs: rule_id (required). Returns: result
mail_folder_treeA
List every mail folder with its path, total and unread counts.
Inputs: no named parameters. Returns: result
mail_list_rulesB
List inbox rules.
Inputs: no named parameters. Returns: result
mail_move_from_sendersC
Bulk-move existing mail from addresses or '@domain' entries into dest_path (created if missing).
Inputs: senders (required), dest_path (required), folder. Returns: result
mail_sender_statsC
Top senders and domains in a folder. sample limits how many messages to scan (0 = all).
Inputs: top, folder, sample. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Each tool targets a distinct resource and action, and the mail_/drive_ prefixes separate the two domains cleanly. The only near-pair, mail_move_from_senders (existing mail) vs mail_add_sender_rule (future mail via rule), is explicitly differentiated in the descriptions.
All names use snake_case with a consistent domain prefix (mail_/drive_) followed by a verb_noun pattern (create_folder, list_rules, delete_rule, move). The exceptions are the noun-phrase names mail_folder_tree and mail_sender_stats, which deviate from the verb-first convention but remain readable.
Ten tools is well within the ideal range and each earns its place: seven cover mail structure, bulk moves, and rule automation; three cover drive listing, folder creation, and moves. Nothing looks redundant or padded.
Mail side is strong (tree, create, stats, bulk move, rule list/add/delete), but has no folder delete/rename or rule update. The drive surface is noticeably thinner — list, create, move only, with no delete or rename, which limits cleanup workflows.
Related MCP Connectors
Manage Microsoft 365 email, calendar, contacts and inbox rules via the Graph API with OAuth 2.0.
Permissioned access to Outlook, OneDrive and Teams via the user's own Microsoft account
Hosted email MCP for your own Gmail, Outlook.com, Microsoft 365, iCloud or IMAP inbox: read, search, draft, reply in thread, forward and file mail. It moves or flags up to 500 messages in one call, and a send leaves exactly one copy in Sent. A calendar is a separate connection, and connecting one adds diary and scheduling tools.
Your Gmail, Calendar, Drive, GitHub, Oura, wallet and confirmed profile facts in any MCP client.
Related MCP Servers
- AlicenseAqualityBmaintenance22 consolidated MCP tools for email, calendar, contacts, folders, rules, categories, and settings with safety controls (dry-run preview, rate limiting, recipient allowlists) and MCP annotations on every tool. Works with personal Outlook.com and work/school Microsoft 365 accounts.22315 npm40MIT
- AlicenseCqualityNot gradedmaintenanceAn 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-
- AlicenseNot gradedqualityCmaintenanceEnables personal Outlook/Hotmail/Live account email management through Microsoft Graph, letting users list, search, read, and delete emails (with confirmation) via MCP.ISC
- FlicenseAqualityCmaintenanceLets MCP clients read and search mail, manage calendars and events, and check availability for personal Microsoft accounts, with per-account delegated authentication and human approval for sensitive writes.22-