mcp-gmail

mcp-gmail

Enables interaction with Gmail through the Gmail API to read unread messages, retrieve email threads, and create draft replies programmatically. Supports OAuth authentication and automated email processing through natural language.

Category
Visit Server

README

mcp-gmail

A toy demo of an MCP server that can write you some nifty draft emails

https://github.com/user-attachments/assets/2dcba8aa-81c5-4098-bccd-d07a6324be7c

Requirements

Example claude_desktop_config.json

{
  "mcpServers": {
    "email": {
      "command": "uv",
      "args": ["--directory", "/your/path/to/mcp-gmail", "run", "main.py"]
    },
  "preferences": {
    "quickEntryShortcut": "off"
  }
}

Getting started in Claude Desktop

  • Clone the repo,
  • Add the MCP server to your claude_desktop_config.json (see above)
  • Quit and restart the application
  • The MCP server should run via the stdio transport locally; you can check it's enabled in the 'connectors' section of the prompt (click the + icon)

What The Server Does

This repository implements a Gmail automation server using FastMCP and the Google Gmail API. The gmail.py file contains a Gmail class that handles authentication with the Gmail API and provides methods for interacting with Gmail, such as get_unread_messages to retrieve unread emails, get_thread to fetch an entire email thread, and create_draft to compose a draft reply within a specific thread. The models.py file defines Pydantic models for structuring Gmail message data, ensuring data integrity and type safety when interacting with the dynamic Gmail API responses. The main.py file sets up a FastMCP server, exposing the Gmail functionalities as callable tools: get_unread_emails, get_email_thread, and create_draft_reply. This allows external clients to interact with Gmail programmatically through a well-defined API, enabling automated email processing and drafting. The server is designed to run locally, authenticating users and performing actions on their behalf.

Notes

  • I was using Claude Desktop, and my original plan was to use MCP Sampling, but Claude Desktop does not appear to support sampling; instead we just expose the tools needed to draft an email
  • AuthN/AuthZ through MCP clients/servers feels somewhat complex; this just has the app deal with it when it spins up.
  • The messages returned by the Gmail API are unread, but don't appear to have guaranteed ordering: the first message returned might not be the most recent message. This is likely to be undesired behaviour.

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