gmail-modify-mcp
Lets an AI agent modify Gmail message labels via the gmail.modify OAuth scope: add or remove labels on a message to mark it read, archive it, move it between labels, or send it to Trash/Spam — enabling zero-inbox tidy-up workflows after the agent has read and evaluated messages.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
gmail-modify-mcp
Work in progress. Setup instructions are being refined and have only been tested on Windows 11. Feedback welcome.
A minimal MCP server that lets an AI agent modify Gmail message labels — and nothing else.
The gap it fills
Gmail MCP integrations (including Anthropic's built-in claude.ai Gmail connector) are typically read-only: they can search and read messages but cannot mark them as read, archive them, or move them between labels. This server adds just that missing piece, enabling "zero inbox" agent workflows where the agent reads, evaluates, and then tidies up.
Related MCP server: Gmail MCP Server
When to use this
You want an AI agent to automatically archive or mark emails as read after processing them
No official, narrowly-scoped Gmail modify integration exists yet from Anthropic or Google
When to reconsider
Google and Anthropic have both signaled investment in official Gmail MCP integrations. If a first-party option emerges that supports label modification, prefer it — it will have better security guarantees, no local credential management, and longer-term maintenance. Check Google Workspace MCP and Anthropic's connector catalog before using this.
How credentials work
This tool has no central OAuth app and no shared credentials. Each user creates their own Google Cloud project and OAuth client. Your credentials never leave your machine — they are stored in ~/.gmail-modify-mcp/ and used only to make API calls directly to Google.
This means setup requires a one-time visit to Google Cloud Console to create an OAuth client. The guided setup script walks you through it.
Security scope
This server requests exactly one OAuth scope: gmail.modify
That scope permits:
✅ Read all messages and metadata
✅ Add and remove labels (including moving to Trash or Spam)
❌ Send email
❌ Permanently delete messages
❌ Manage filters, forwarding, or account settings
You can audit or revoke access at any time at myaccount.google.com/permissions.
Setup
Windows 11 (guided)
Run this in PowerShell:
irm https://raw.githubusercontent.com/portablestew/gmail-modify-mcp/main/setup.ps1 | iexThe script will install Git and uv if needed, walk you through creating an OAuth client in Google Cloud Console, authenticate, and print the MCP config snippet to add to your client.
Note: this runs whatever is at that URL directly. You are trusting this GitHub repository. Review the setup.ps1 source first if you prefer.
If PowerShell blocks the script, your execution policy may be restricting scripts. You can allow them for your user account with:
Set-ExecutionPolicy -Scope CurrentUser RemoteSignedThis is a user-level change and does not affect other accounts or system policy.
Manual setup
1. Create a Google Cloud OAuth client
Go to console.cloud.google.com/apis/dashboard:
Click Enable APIs & Services, search for Gmail API, enable it
In the left menu, click Credentials
Click Create Credentials → OAuth client ID
If prompted to configure a consent screen: choose External, set publishing status to Testing, and add your Gmail address as a test user via OAuth consent screen → Audience → Add users. Other fields can be left as defaults.
Application type: Desktop app. Click Create, then Download JSON
Save the downloaded file to
~/.gmail-modify-mcp/gcp-oauth.keys.json
2. Authenticate
uvx --from git+https://github.com/portablestew/gmail-modify-mcp gmail-modify-mcp-authA browser window will open. You will see a "Google hasn't verified this app" warning — this is expected. Click Advanced then Go to [app] (unsafe) to continue.
To validate the scope, the consent screen should show something like "Read, compose, and send emails from your Gmail account" — Google's wording for gmail.modify sounds broader than it is. You should not see anything mentioning permanently deleting email or managing account settings. If you do, the OAuth client was configured with a wider scope than intended.
3. Add to your MCP config
{
"mcpServers": {
"gmail-modify": {
"command": "uvx",
"args": ["--from", "git+https://github.com/portablestew/gmail-modify-mcp", "gmail-modify-mcp"]
}
}
}The location of this config depends on your MCP client — see your client's documentation for where mcpServers should be placed.
Tools exposed
Tool | Parameters | Description |
|
| Add or remove labels on a message |
Common label operations:
Mark as read:
removeLabelIds=["UNREAD"]Archive:
removeLabelIds=["INBOX"]Archive + mark read:
removeLabelIds=["UNREAD", "INBOX"]Trash:
addLabelIds=["TRASH"], removeLabelIds=["INBOX"]
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
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…
- MyAgentMailDeprecatedcom.myagentmail
Email inboxes and calendars for AI agents: send, receive, search, draft and schedule.
Email inboxes and calendars for AI agents: send, receive, search, draft and schedule.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to manage Gmail through natural language, supporting operations like sending, searching, and reading emails. It includes comprehensive label management, batch processing, and a streamlined OAuth2 auto-authentication flow.MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to manage Gmail accounts through natural language for tasks like sending, reading, searching, and organizing emails. It supports advanced features including draft management, label operations, and batch actions via secure OAuth 2.0 authentication.MIT
- AlicenseAqualityDmaintenanceEnables Gmail label management with tools to list, create, delete labels, and modify labels on messages and threads, handling OAuth2 authentication automatically.7MIT
- AlicenseAqualityBmaintenanceEnables AI assistants to search, read, draft, and send Gmail messages, as well as manage labels and trash using natural language.24168 npmMIT