Gmail Storage & Cleanup MCP
Provides tools to scan Gmail messages for large cleanup candidates, review message details, and move confirmed, non-protected messages to Trash while avoiding permanent deletion.
Provides access to Google Drive storage quota information to monitor shared Google storage usage and help prevent the account from running out of space.
Click on "Install 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., "@Gmail Storage & Cleanup MCPCheck my Google storage and find Gmail cleanup candidates for review."
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.
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 |
Rank cleanup candidates using Gmail | 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.sh1. Create Google credentials
Create a project and enable Gmail API and Google Drive API.
Configure Google Auth Platform. For personal testing, use External/Testing and add your Gmail address as a test user.
Create an OAuth client with application type Desktop app.
Open
.envand add the generated values:
GOOGLE_CLIENT_ID=your-client-id
GOOGLE_CLIENT_SECRET=your-client-secretAuthorize once:
.venv/bin/python -m app.auth_cliThe 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@personalStart 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-toolStart a new Claude Code session after installation.
Focused tools
get_storage_quota— shared Google storage usagescan_cleanup_candidates— read-only Gmail discovery and deterministic scoringget_candidate_details— review one result from the latest scanmove_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 -qPlugin 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.
This server cannot be installed
Maintenance
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
- AlicenseAqualityAmaintenanceConnects Claude Desktop to your Gmail so you can start managing your inbox using natural language. Bulk delete promos & newsletters, organize labels and get useful insights.1289MIT
- AlicenseAqualityDmaintenanceEnables natural language interaction with Gmail, providing email search, categorized daily summaries, and Home Assistant integration through REST API with read-only access to your inbox.20MIT
- AlicenseNot gradedqualityFmaintenanceProvides 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.1922MIT
- FlicenseNot gradedqualityNot gradedmaintenanceEnables intelligent Gmail management, including email triage, newsletter classification, promotional email cleanup, summarization, filter suggestions, draft replies, and audit logging.
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.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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