MCP Gmail Server

MCP Gmail Server

Enables users to read unread emails and create drafts in Gmail via the Model Context Protocol. It leverages Google OAuth 2.0 for secure authentication and integrates with tools like Claude Desktop for natural language email management.

Category
Visit Server

README

MCP Gmail Server

A server that uses model context protocol[https://modelcontextprotocol.io/] to read and create drafts of emails from Gmail.

Project setup

Create Oauth client and add secrets:

Create a Google Cloud Project

  1. Go to https://console.cloud.google.com/
  2. In the top-left, open the project dropdown and click New Project
  3. Give your project a name (e.g., Gmail API Demo)
  4. Click Create Your project is now created; make sure it’s selected in the project dropdown.

Enable the Gmail API

  1. Go to the API Library: https://console.cloud.google.com/apis/library
  2. Search for Gmail API
  3. Click it → Enable

Configure OAuth 2.0 Credentials

  1. Navigate to: APIs & Services → Credentials

  2. You’ll be prompted to configure the OAuth Consent Screen (if first time creating OAuth credentials)

  3. Choose External if users outside your Google Workspace will use it

  4. Fill in details

  5. Add test users (email addresses allowed to authorize during development)

  6. Save the configuration

  7. Click Create CredentialsOAuth client ID

  8. Choose the application type: Desktop app (for testing/dev)

  9. Name it

  10. Click Create

You will now receive:

  • Client ID
  • Client Secret Download them as JSON for use in your code.

Save the JSON as "client_secret_oauth_gcp.json" in the root of this project. (note this should be stored securely and not commited to github.)

Install and run app

Install uv: https://docs.astral.sh/uv/getting-started/installation/

Install dependencies with uv: uv sync

Start server: uv run -m src.mcp_server_gmail

Claude desktop

Install Claude Desktop

Set claude_desktop_config.json file to:

{
  "mcpServers": {
    "gmail": {
      "command": "/Users/myname/Documents/Coding/fac-mcp-gmail-server/.venv/bin/python",
      "args": [
        "-m",
        "mcp_server_gmail"
      ],
      "env": {
        "PYTHONPATH": "/Users/myname/Documents/Coding/fac-mcp-gmail-server/src"
      },
      "cwd": "/Users/myname/Documents/Coding/fac-mcp-gmail-server"
    }
  }
}

Ensuring the directory paths are replaced appropriately with your local directory paths.

Test (manual)

Go to claude desktop

Try the following: "Get last 3 unread emails" "Create draft emails for these"

See /docs/working_examples, for examples screenshots of the mcp server

Features

  • Gmail Oauth set up
  • MCP server for read and drafting emails on gmail

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
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
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
Qdrant Server

Qdrant Server

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

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
E2B

E2B

Using MCP to run code via e2b.

Official
Featured