gmail-mcp
A read-only, multi-account Gmail MCP server for Claude Code that lets Claude search threads, read messages, and list labels across authorized Gmail accounts.
README
gmail-mcp
A read-only, multi-account Gmail MCP server for Claude Code. Lets Claude search threads, read messages, and list labels across one or more Gmail accounts you've authorized, over stdio.
Tools
| Tool | Description |
|---|---|
search_threads |
Search Gmail threads using standard Gmail query syntax (e.g. invoice newer_than:7d -category:promotions). Searches one account or all connected accounts and merges results. |
get_message |
Fetch the full body and headers of a message by ID. |
list_labels |
List Gmail labels for one or all connected accounts. |
list_accounts |
List all Gmail accounts that currently have an authorized token saved. |
All access is read-only (gmail.readonly scope) — this server cannot send, delete, or modify anything in Gmail.
Setup
1. Install dependencies
npm install
2. Get OAuth credentials
- Create (or reuse) a project in the Google Cloud Console.
- Enable the Gmail API.
- Create an OAuth client ID of type Desktop app.
- Download the credentials and save them as
credentials.jsonin the project root.
credentials.json and everything under tokens/ are gitignored — never commit them.
3. Authorize one or more Gmail accounts
npm run build
npm run auth -- youraccount@gmail.com
This opens a Google consent screen in your browser and, on approval, saves the resulting token to tokens/youraccount@gmail.com.json. Repeat for each account you want Claude to have access to.
4. Register the server with Claude Code
Point Claude Code at the built server, e.g. in your MCP config:
{
"mcpServers": {
"gmail": {
"command": "node",
"args": ["<path-to-repo>/dist/index.js"]
}
}
}
Development
npm run build # compile TypeScript to dist/
npm start # run the compiled server
Project structure
src/
auth.ts # one-off OAuth flow: authorizes an account and saves its token
index.ts # MCP server: exposes search_threads, get_message, list_labels, list_accounts
Tokens are stored per account in tokens/<email>.json and are loaded on demand from TOKENS_DIR at request time, so accounts can be added or removed without restarting the server.
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.