gmail-writer

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.

Category
Visit Server

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

  1. In Google Cloud Console: create a project, enable the Gmail API, create a Desktop app OAuth client.
  2. Run any google-auth-oauthlib installed-app flow with scope https://www.googleapis.com/auth/gmail.modify and write the result to ~/.gmail_token.json as {client_id, client_secret, token, refresh_token, expiry}: the file is self-contained and the server refreshes it automatically.
  3. npm install, then register with Claude Code:
claude mcp add gmail-writer -- node /path/to/gmail-writer/index.js
  1. node test.js runs 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

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured