Gmail MCP Server

Gmail MCP Server

Integrates with Gmail to enable sending, reading, drafting, and managing emails via the Model Context Protocol (MCP), allowing users to interact with email tasks through automated client prompts.

jmonsellier

Communication
Local
Python
Visit Server

README

Gmail Server for Model Context Protocol (MCP)

This MCP server integrates with Gmail to enable sending, removing, reading, drafting, and responding to emails.

Note: This server enables an MCP client to read, remove, and send emails. However, the client prompts the user before conducting such activities.

https://github.com/user-attachments/assets/5794cd16-00d2-45a2-884a-8ba0c3a90c90

Components

Tools

  • send-email

    • Sends email to email address recipient
    • Input:
      • recipient_id (string): Email address of addressee
      • subject (string): Email subject
      • message (string): Email content
    • Returns status and message_id
  • trash-email

    • Moves email to trash
    • Input:
      • email_id (string): Auto-generated ID of email
    • Returns success message
  • mark-email-as-read

    • Marks email as read
    • Input:
      • email_id (string): Auto-generated ID of email
    • Returns success message
  • get-unread-emails

    • Retrieves unread emails
    • Returns list of emails including email ID
  • read-email

    • Retrieves given email content
    • Input:
      • email_id (string): Auto-generated ID of email
    • Returns dictionary of email metadata and marks email as read
  • open-email

    • Open email in browser
    • Input:
      • email_id (string): Auto-generated ID of email
    • Returns success message and opens given email in default browser

Setup

Gmail API Setup

  1. Create a new Google Cloud project
  2. Enable the Gmail API
  3. Configure an OAuth consent screen
    • Select "external". However, we will not publish the app.
    • Add your personal email address as a "Test user".
  4. Add OAuth scope https://www.googleapis.com/auth/gmail/modify
  5. Create an OAuth Client ID for application type "Desktop App"
  6. Download the JSON file of your client's OAuth keys
  7. Rename the key file and save it to your local machine in a secure location. Take note of the location.
    • The absolute path to this file will be passed as parameter --creds-file-path when the server is started.

Authentication

When the server is started, an authentication flow will be launched in your system browser. Token credentials will be subsequently saved (and later retrieved) in the absolute file path passed to parameter --token-path.

For example, you may use a dot directory in your home folder, replacing [your-home-folder].:

Parameter Example
--creds-file-path /[your-home-folder]/.google/client_creds.json
--token-path /[your-home-folder]/.google/app_tokens.json

Usage with Desktop App

Using uv is recommended.

To integrate this server with Claude Desktop as the MCP Client, add the following to your app's server configuration. By default, this is stored as ~/Library/Application\ Support/Claude/claude_desktop_config.json.

{
  "mcpServers": {
    "gdrive": {
      "command": "uv",
      "args": [
        "--directory",
        "[absolute-path-to-git-repo]",
        "run",
        "gmail",
        "--creds-file-path",
        "[absolute-path-to-credentials-file]",
        "--token-path",
        "[absolute-path-to-access-tokens-file]"
      ]
    }
  }
}

The following parameters must be set

Parameter Example
--directory Absolute path to gmail directory containing server
--creds-file-path Absolute path to credentials file created in Gmail API Setup.
--token-path Absolute path to store and retrieve access and refresh tokens for application.

Troubleshooting with MCP Inspector

To test the server, use MCP Inspector. From the git repo, run the below changing the parameter arguments accordingly.

npx @modelcontextprotocol/inspector uv run [absolute-path-to-git-repo]/src/gmail/server.py --creds-file-path [absolute-path-to-credentials-file] --token-path [absolute-path-to-access-tokens-file]

Recommended Servers

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
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
Excel MCP Server

Excel MCP Server

A Model Context Protocol server that enables AI assistants to read from and write to Microsoft Excel files, supporting formats like xlsx, xlsm, xltx, and xltm.

Featured
Local
Go
Playwright MCP Server

Playwright MCP Server

Provides a server utilizing Model Context Protocol to enable human-like browser automation with Playwright, allowing control over browser actions such as navigation, element interaction, and scrolling.

Featured
Local
TypeScript
Claude Code MCP

Claude Code MCP

An implementation of Claude Code as a Model Context Protocol server that enables using Claude's software engineering capabilities (code generation, editing, reviewing, and file operations) through the standardized MCP interface.

Featured
Local
JavaScript
Apple MCP Server

Apple MCP Server

Enables interaction with Apple apps like Messages, Notes, and Contacts through the MCP protocol to send messages, search, and open app content using natural language.

Featured
Local
TypeScript
DuckDuckGo MCP Server

DuckDuckGo MCP Server

A Model Context Protocol (MCP) server that provides web search capabilities through DuckDuckGo, with additional features for content fetching and parsing.

Featured
Python
YouTube Transcript MCP Server

YouTube Transcript MCP Server

This server retrieves transcripts for given YouTube video URLs, enabling integration with Goose CLI or Goose Desktop for transcript extraction and processing.

Featured
Python
@kazuph/mcp-gmail-gas

@kazuph/mcp-gmail-gas

Model Context Protocol server for Gmail integration. This allows Claude Desktop (or any MCP client) to interact with your Gmail account through Google Apps Script.

Featured
JavaScript
MCP Server Trello

MCP Server Trello

Facilitates interaction with Trello boards via the Trello API, offering features like rate limiting, type safety, input validation, and error handling for seamless management of cards, lists, and board activities.

Featured
TypeScript