Skip to main content
Glama
ashutoshchaubeypm

Gmail Storage & Cleanup MCP

Gmail Storage & Cleanup MCP

A focused local MCP plugin for Codex and Claude Code that monitors shared Google storage and helps recover Gmail space through a deterministic, review-first cleanup workflow.

It checks Google storage quota, finds large Gmail cleanup candidates, explains every safety decision, and requires confirmation before moving mail to Trash. It never permanently deletes mail. No credentials are included in this repository.

Why this exists

The official Gmail plugin is the better choice for general inbox work such as searching mail, summarizing threads, drafting replies, forwarding, and applying labels.

This project deliberately focuses on a different problem: preventing a Google account from running out of storage without blindly deleting important email.

Capability

Official Gmail plugin

Gmail Storage & Cleanup MCP

Search, read, summarize, reply, and forward

Yes

Not its goal

Gmail labels and everyday inbox organization

Yes

Not its goal

Shared Google storage quota and free-space monitoring

Not a documented core capability

Yes, through Drive storageQuota

Rank cleanup candidates using Gmail sizeEstimate

Not a documented core capability

Yes

Deterministic, test-covered safety scoring

No project-specific policy

Yes

Protected/review/safe decision with reasons

No project-specific policy

Yes

Review-before-trash enforcement inside the tool

General confirmation safeguards

Yes, candidate-bound and explicit

Permanent deletion

No

No

This comparison describes the documented focus of each plugin, not every capability an upstream connector may add in the future.

Related MCP server: Gmail MCP Server

Install

Requirements: Python 3.12+, Git, and a Google account with Gmail.

git clone https://github.com/ashutoshchaubeypm/Gmail-MCP-tool.git
cd Gmail-MCP-tool
./scripts/setup.sh

1. Create Google credentials

In Google Cloud Console:

  1. Create a project and enable Gmail API and Google Drive API.

  2. Configure Google Auth Platform. For personal testing, use External/Testing and add your Gmail address as a test user.

  3. Create an OAuth client with application type Desktop app.

  4. Open .env and add the generated values:

GOOGLE_CLIENT_ID=your-client-id
GOOGLE_CLIENT_SECRET=your-client-secret

Authorize once:

.venv/bin/python -m app.auth_cli

The local token is written to work/google-token.json. Both it and .env are ignored by Git.

2. Install in Codex

From the repository root:

codex plugin marketplace add "$PWD"
codex plugin add gmail-mcp-tool@personal

Start a new Codex task, then ask: “Check my Google storage and find Gmail cleanup candidates for review.”

3. Install in Claude Code

From the repository root:

claude plugin marketplace add "$PWD"
claude plugin install gmail-mcp-tool@gmail-mcp-tool

Start a new Claude Code session after installation.

Focused tools

  • get_storage_quota — shared Google storage usage

  • scan_cleanup_candidates — read-only Gmail discovery and deterministic scoring

  • get_candidate_details — review one result from the latest scan

  • move_message_to_trash — moves one confirmed, non-protected message to Trash

Protected labels include STARRED, IMPORTANT, SENT, and DRAFT. Ambiguous mail stays in review. A message must come from the latest scan before it can be moved, and protected messages cannot be actioned by the tool. The plugin does not empty Trash or permanently delete messages.

Development

.venv/bin/python scripts/security_check.py
.venv/bin/python -m pytest -q

Plugin source: plugins/gmail-mcp-tool/

Deliberate scope

  • Storage forecasting and scheduled quota checks

  • More transparent cleanup policies and rule customization

  • Aggregate recovery estimates and cleanup reports

  • Optional classification for ambiguous candidates, without bypassing deterministic protections

General inbox search, email summaries, reply drafting, and forwarding are intentionally left to the official Gmail plugin.

Security

Never commit .env, downloaded OAuth JSON, or work/google-token.json. Before publishing changes, run python scripts/security_check.py. If credentials are ever committed, revoke and rotate them immediately—removing them from the latest commit is not enough.

MIT licensed.

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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

  • A
    license
    Not graded
    quality
    F
    maintenance
    Provides comprehensive Gmail integration with 25+ tools for intelligent email management, including AI-powered categorization, advanced search and filtering, automated archiving and cleanup, analytics, and secure OAuth2 authentication.
    192
    2
    MIT
  • F
    license
    Not graded
    quality
    Not graded
    maintenance
    Enables intelligent Gmail management, including email triage, newsletter classification, promotional email cleanup, summarization, filter suggestions, draft replies, and audit logging.

View all related MCP servers

Related MCP Connectors

  • Manage Gmail end-to-end: search, read, send, draft, label, and organize threads. Automate workflow…

  • Manage Gmail messages, threads, labels, drafts, and settings from your workflows. Send and organiz…

  • AI-powered medical document management for cancer patients. Google Drive, Gmail, Calendar via MCP.

View all MCP Connectors

Latest Blog Posts

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/ashutoshchaubeypm/Gmail-MCP-tool'

If you have feedback or need assistance with the MCP directory API, please join our Discord server