Skip to main content
Glama
m365-organizer

m365-organizer

by Denovarix

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

mail_folder_tree

Every folder with path, total and unread counts

mail_create_folder

Create nested paths like Finance/Banking in one call

mail_sender_stats

Top senders and domains in a folder, the input for a plan

mail_move_from_senders

Bulk-move existing mail from addresses or @domains (JSON batch, 20 per request)

mail_list_rules / mail_add_sender_rule / mail_delete_rule

Server-side inbox rules so future mail files itself

drive_list / drive_create_folder / drive_move

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-organizer

On Windows, enable long paths first if pip fails on deep package paths (admin PowerShell):

Set-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem LongPathsEnabled 1

3 · 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 auth

5 · 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 only

A 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 tools
drive_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

    B3.4/5.0

    Scored across 10 tools

    Disambiguation5/5

    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.

    Naming Consistency4/5

    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.

    Tool Count5/5

    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.

    Completeness4/5

    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

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      22 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.
      22
      315 npm
      40
      MIT
    • A
      license
      C
      quality
      Not graded
      maintenance
      An 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
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables personal Outlook/Hotmail/Live account email management through Microsoft Graph, letting users list, search, read, and delete emails (with confirmation) via MCP.
      ISC
    • F
      license
      A
      quality
      C
      maintenance
      Lets 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
      -