gmail-mcp
A read-only Gmail MCP server enabling users to search and read emails via Gmail search syntax without sending, deleting, or modifying anything.
README
gmail-mcp
A read-only Gmail MCP server, built from scratch on the MCP SDK — no third-party Gmail MCP packages. Lets Claude Code (or any MCP client) search and read a Gmail inbox without ever being able to send, delete, or modify anything.
Tools
| Tool | What it does |
|---|---|
list_emails |
Search the inbox with full Gmail search syntax (from:, newer_than:, has:attachment, …), with a maxResults cap |
get_email |
Fetch a single message by id: headers plus the full plain-text body |
Design notes
- Read-only by construction. The OAuth scope is
gmail.readonly— the token Google issues cannot send or delete mail even if the server were compromised. - Google OAuth 2.0 Desktop-app flow. A one-time
npm run authopens a browser for consent, then stores a refresh token locally. The server auto-refreshes access tokens and persists them back to disk, so auth survives restarts. - Secrets stay out of the repo.
credentials.json(OAuth client) andtoken.json(tokens) are gitignored; the code loads them from disk at startup.
Setup
-
In Google Cloud Console, create a project, enable the Gmail API, and create an OAuth client of type Desktop app. Download it as
credentials.jsoninto this folder. While the consent screen is in Testing mode, add your address under Audience → Test users. -
Install and authenticate:
npm install npm run auth # opens browser, writes token.json -
Register with Claude Code (user scope makes it available in every session):
claude mcp add gmail -s user -- node /absolute/path/to/gmail-mcp/index.jsVerify with
claude mcp list— the server should show as Connected.
Files
index.js— the MCP server (tool definitions, Gmail API calls, token refresh persistence)auth.js— one-time OAuth consent flow; writestoken.json
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.