Skip to main content
Glama

lethe

Lethaei ad fluminis undam / securos latices et longa oblivia potant. At the waters of the river Lethe they drink the draught that frees from care, and long forgetting. — Virgil, Aeneid VI.714–715

An MCP server that finds every mailing list in your mailbox and unsubscribes from the ones you choose. It reads headers only. It cannot send, move or delete mail.

Point it at a Microsoft 365 or Gmail mailbox, ask your assistant to scan the last 90 days, pick what to keep, and lethe makes the unsubscribe requests: the standard one-click kind (RFC 8058) that senders publish in their own List-Unsubscribe header.

What it can and cannot do

Microsoft 365

Gmail

Scope requested

Mail.Read

gmail.metadata

Reads message bodies

No (it asks only for headers, but the scope would allow it)

Cannot — the scope does not expose bodies

Sends, moves, deletes, labels mail

Cannot

Cannot

Outbound network calls

Only the unsubscribe URLs of senders you name, with confirm=true

Same

Senders that only accept an unsubscribe email are never contacted. lethe cannot send mail, so it hands you the address instead.

See SECURITY.md for what these guarantees rest on and where they stop.

Related MCP server: multi-email

Tools

Tool

What it does

lethe_auth_status

Provider, signed-in account, scope, kill-switch state

lethe_login / lethe_login_finish

Sign in (M365 device code; Gmail opens a browser on the host)

lethe_scan(days=90)

Read From + List-Unsubscribe headers, group by sender, save a scan

lethe_senders(query, method, limit, offset)

Page through a scan, biggest senders first

lethe_unsubscribe(senders=[...], confirm)

Without confirm, returns the plan. With it, sends one-click unsubscribes

lethe_report

Everything done for a scan, per sender

Typical session: "Scan my mail for the last 90 days, show me the 40 biggest senders, then unsubscribe from everything except my bank and the airline."

On its first real mailbox (90 days, 13,042 messages), lethe found 592 senders with an unsubscribe header covering 10,894 of those messages. 98% of them supported one-click.

How unsubscribing works

  • one-click — the sender advertises List-Unsubscribe-Post: List-Unsubscribe=One-Click. lethe POSTs that body to the sender's https URL. It is the same mechanism mail providers use behind their own Unsubscribe buttons, and Gmail and Yahoo require it of bulk senders, so most lists support it.

  • link — an https URL with no one-click support. Skipped unless you pass allow_link_visits=true; a visited link may still need a confirm click on the sender's page.

  • mailto — reported back to you, never sent.

Safety rails

  • Flagged senders are skipped by default — freemail addresses with list headers, display names imitating postal/tax/government brands on unrelated domains, and headers with unrendered templates. Unsubscribing from phishing only confirms your address is live; block those instead.

  • SSRF guard — https only; every host, including every redirect hop, must resolve to a public IP.

  • Newest header wins — unsubscribe tokens can expire, so the scan keeps each sender's most recent header.

  • Audit log — every scan and request is appended to audit.log in LETHE_HOME.

  • Kill switch — create LETHE_HOME/DISABLED or set LETHE_DISABLED=1.

Install

Install straight from GitHub with uv:

uvx --from git+https://github.com/SuperAngryMonkey/lethe@v0.1.0 lethe-mcp --version

(A PyPI package, lethe-mcp, and an MCP registry listing are coming. Until then, use the GitHub form in the configs below.)

Microsoft 365

lethe has no shared app registration. Register your own (five minutes):

  1. Entra admin center → App registrations → New registration. Single tenant. No redirect URI.

  2. Authentication → Settings → Allow public client flows: Yes.

  3. API permissions → Microsoft Graph → Delegated → Mail.Read. Nothing else.

  4. Copy the Application (client) ID and Directory (tenant) ID.

{
  "mcpServers": {
    "lethe": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/SuperAngryMonkey/lethe@v0.1.0", "lethe-mcp"],
      "env": {
        "LETHE_PROVIDER": "m365",
        "LETHE_M365_CLIENT_ID": "<client id>",
        "LETHE_M365_TENANT_ID": "<tenant id>"
      }
    }
  }
}

Then ask your assistant to run lethe_login, enter the code it shows, and run lethe_login_finish. Or run lethe-mcp auth in a terminal with the same environment.

Gmail

  1. Google Cloud console → new project → enable the Gmail API.

  2. OAuth consent screen → External, Testing, add yourself as a test user. Add the scope https://www.googleapis.com/auth/gmail.metadata.

  3. Credentials → Create OAuth client ID → Desktop app. Download the JSON.

"lethe-gmail": {
  "command": "uvx",
  "args": ["--from", "git+https://github.com/SuperAngryMonkey/lethe@v0.1.0", "lethe-mcp"],
  "env": {
    "LETHE_PROVIDER": "gmail",
    "LETHE_GMAIL_CLIENT_SECRETS": "/path/to/client_secret.json",
    "LETHE_HOME": "~/.config/lethe-gmail"
  }
}

Sign in with lethe-mcp auth in a terminal (a browser opens), or ask for lethe_login. gmail.metadata is a restricted scope: in Testing mode Google lets you and your listed test users use your own client without verification, and the refresh token lasts seven days before you sign in again.

gmail.metadata does not allow Gmail's search syntax, so lethe pages through mail newest-first and stops at the cutoff date. A new Google Cloud project has a low per-minute quota; lethe backs off and retries when it hits it, so a large 90-day Gmail scan can take several minutes.

Several mailboxes

Run one entry per mailbox, each with its own LETHE_HOME.

Configuration

Variable

Default

LETHE_PROVIDER

—

m365 or gmail (required)

LETHE_HOME

~/.config/lethe

token, saved scans, audit log, kill switch

LETHE_M365_CLIENT_ID

—

your Entra app

LETHE_M365_TENANT_ID

organizations

your tenant

LETHE_GMAIL_CLIENT_SECRETS

—

path to the desktop-client JSON

LETHE_WORKERS

6

parallel unsubscribe requests (1–16)

Limits

  • Unsubscribing stops future mail; existing messages are untouched. Senders are allowed up to ten days to comply.

  • Some senders reject automated requests (403/429) or publish broken headers. These are reported as failures; do them by hand.

  • Microsoft 365 is /me only — no shared mailboxes.

Documentation

License

MIT © 2026 800 Pound Gorilla Inc.

Available Tools

7 tools
lethe_auth_statusA

Report the provider, whether lethe is signed in, its scope, and whether the kill switch is on.

Inputs: no named parameters.

lethe_loginA

Start sign-in. Microsoft 365: returns a URL and code to enter, then call lethe_login_finish. Gmail: opens a browser on this machine and waits up to four minutes for you to approve.

Inputs: no named parameters. Returns: result

lethe_login_finishA

Microsoft 365 only: complete the sign-in started by lethe_login. Safe to call repeatedly.

Inputs: no named parameters. Returns: result

lethe_reportC

What has been done for a scan: every sender with a recorded unsubscribe status.

Inputs: scan_id.

lethe_scanA

Read the From and List-Unsubscribe headers of every message received in the last days days (all folders except Sent, Drafts and Outbox), group them by sender, and save the result. Returns totals, the scan_id, and the top biggest senders that can be unsubscribed from. A large mailbox can take a few minutes.

Inputs: top, days.

lethe_sendersA

Page through a saved scan (latest by default), biggest senders first. query filters on address or display name; method filters on one-click | link | mailto; include_non_list also shows senders with no List-Unsubscribe header.

Inputs: limit, query, method, offset, +2 more.

lethe_unsubscribeA

Unsubscribe from the named sender addresses (from a saved scan; latest by default).

One-click senders (RFC 8058) get a single POST to their own unsubscribe URL. Senders with only a plain link are skipped unless allow_link_visits=true; a visited link may still need a confirm click on the sender's page. mailto-only senders are never contacted: lethe cannot send mail, so their addresses are returned for you to email yourself. Flagged senders (possible phishing or broken headers) are skipped unless include_flagged=true.

Nothing happens without confirm=true. Without it, this returns the plan.

Inputs: senders (required), confirm, scan_id, include_flagged, +1 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 7 tools

    Disambiguation5/5

    Each tool maps to a distinct stage of the workflow: auth_status/login/login_finish handle authentication, scan creates a saved scan, senders pages it, unsubscribe acts on senders, and report reviews outcomes. The two-step login pair is clearly differentiated by the descriptions.

    Naming Consistency4/5

    All seven tools use the lethe_ prefix and lowercase snake_case, with no mixed casing conventions. The only minor deviation is that some names are verbs (scan, unsubscribe) while others are nouns (senders, report), but the pattern remains readable.

    Tool Count5/5

    Seven tools are well scoped for a focused email-unsubscribe workflow, and each tool has a clear role. There is no obvious redundancy or missing operational stage that would require more tools.

    Completeness4/5

    The core lifecycle is covered: authenticate, scan the mailbox, inspect senders, unsubscribe, and report results. Minor gaps include no logout or kill-switch toggle despite auth_status mentioning it, and no explicit scan listing/deletion management.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables bulk Gmail inbox cleanup including trashing emails, managing filters, and extracting unsubscribe links, with dry-run previews and automatic retry/backoff to handle rate limits.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables safe, multi-account Gmail and Microsoft 365 operations with explicit aliases, including searching, reading, drafting, archiving, labels/categories, and human-reviewed sending via a localhost approval window.
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables monitoring shared Google storage quota and recovering Gmail space by scanning cleanup candidates, scoring them deterministically, and requiring review before moving non-protected messages to Trash.
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables reading and searching personal Outlook/Hotmail mail, filing into folders, deleting, and unsubscribing from newsletters via Microsoft Graph.
      12
      85 npm
      1
      MIT