Skip to main content
Glama
Denovarix

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)

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    C
    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
    504 npm
    39
    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
    D
    maintenance
    MCP server providing full control over Outlook.com, Hotmail, Live, or Microsoft 365 email via Microsoft Graph API, enabling reading, searching, sending, and managing messages and folders securely.
    1
    MIT
  • A
    license
    Not graded
    quality
    B
    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