gmail-writer
A local MCP server enabling Gmail write operations (modify threads, search, handle attachments) by using a Desktop OAuth client with correct scopes, fixing the hosted Gmail MCP's broken write tools.
README
gmail-writer
A local MCP server that gives Claude working Gmail write operations: because the hosted Gmail MCP's write tools are broken by design.
The bug this fixes
The claude.ai hosted Gmail MCP shows write tools (label_thread,
unlabel_thread, …) but every call fails with "insufficient
authentication scopes". Root cause, found the hard way: the hosted MCP has
a tool cap during OAuth negotiation, and under it it only requests
gmail.readonly: never gmail.modify. The write tools are advertised
but can never work. This server sidesteps the whole path: a local MCP
process with its own Desktop OAuth client requesting the correct scope.
Tools
| Tool | Description |
|---|---|
gmail_modify_thread |
Add/remove labels on a thread: move, archive, star, mark read/unread |
gmail_search_threads |
Search threads with Gmail query syntax |
gmail_list_labels |
List all labels with IDs |
gmail_list_attachments |
Find attachments across messages matching a query (metadata only) |
gmail_download_attachment |
Download one attachment by ID |
gmail_download_all_attachments |
Bulk-download every attachment matching a query, foldered per email |
Also included: label-for-deletion.mjs, a standalone script that applies a
review label to inbox junk matching your queries (edit the QUERIES array;
set GMAIL_DELETION_LABEL_ID) so you bulk-delete from the Gmail UI with
one filtered view.
Setup
- In Google Cloud Console: create a project, enable the Gmail API, create a Desktop app OAuth client.
- Run any
google-auth-oauthlibinstalled-app flow with scopehttps://www.googleapis.com/auth/gmail.modifyand write the result to~/.gmail_token.jsonas{client_id, client_secret, token, refresh_token, expiry}: the file is self-contained and the server refreshes it automatically. npm install, then register with Claude Code:
claude mcp add gmail-writer -- node /path/to/gmail-writer/index.js
node test.jsruns the read-only test suite against your mailbox.
Security notes
The token file grants mail write access: keep it out of any repo
(chmod 600, never commit). The server runs locally and talks only to
Google's API; nothing is proxied through third parties.
Licence
MIT.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.