gmail.com
gmail.com logo

Gmail

Integrates with Gmail API to enable email operations like sending, managing labels, and searching messages.

Created byApr 22, 2025

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.

Components

Tools

  • send-email
  • trash-email
  • mark-email-as-read
  • get-unread-emails
  • read-email
  • open-email

Setup

Gmail API Setup

  1. Create a new Google Cloud project
  1. Enable the Gmail API
  1. Configure an OAuth consent screen
  1. Add OAuth scope https://www.googleapis.com/auth/gmail/modify
  1. Create an OAuth Client ID for application type "Desktop App"
  1. Download the JSON file of your client's OAuth keys
  1. Rename the key file and save it to your local machine in a secure location. Take note of the location.

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].:
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]

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.
The following parameters must be set
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]

Troubleshooting with MCP Inspector

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

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.

Components

Tools

  • send-email
  • trash-email
  • mark-email-as-read
  • get-unread-emails
  • read-email
  • open-email

Setup

Gmail API Setup

  1. Create a new Google Cloud project
  1. Enable the Gmail API
  1. Configure an OAuth consent screen
  1. Add OAuth scope https://www.googleapis.com/auth/gmail/modify
  1. Create an OAuth Client ID for application type "Desktop App"
  1. Download the JSON file of your client's OAuth keys
  1. Rename the key file and save it to your local machine in a secure location. Take note of the location.

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].:
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]

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.
The following parameters must be set
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]

Troubleshooting with MCP Inspector

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