Gmail MCP logo

Gmail MCP

Organization
shinzo-labs

MCP Implementation for Gmail Services

Publishershinzo-labs
Repositorygmail-mcp
LanguageJavaScript
Forks
51
Stars
59
Available tools
64
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    Gmail MCP exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 64 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    59 stars and 51 forks from the linked repository.

A Model Context Protocol (MCP) server implementation for the Gmail API, providing a standardized interface for email management, sending, and retrieval.

Features

  • Complete Gmail API coverage including messages, threads, labels, drafts, and settings
  • Support for sending, drafting, and managing emails
  • Label management with customizable colors and visibility settings
  • Thread operations for conversation management
  • Settings management including vacation responder, IMAP/POP, and language settings
  • History tracking for mailbox changes
  • Secure OAuth2 authentication using Google Cloud credentials

Prerequisites

Dependencies

For simplest installation, install Node.js 18+. If you would like to build locally, you will also need to install pnpm.

Google Workspace Setup

To run this MCP server, you will need to set up a Google API Client for your organization, with each user running a script to retrieve their own OAuth refresh token.

Google API Client Setup (once per organization)

  1. Go to the Google Cloud Console.
  2. Create a new project or select an existing one.
  3. Enable the Gmail API for your project.
  4. Go to Credentials and create an OAuth 2.0 Client ID. Choose "Desktop app" for the client type.
  5. Download and save the OAuth keys JSON as ~/.gmail-mcp/gcp-oauth.keys.json. ⚠️ NOTE: to create ~/.gmail-mcp/ through MacOS's Finder app you need to enable hidden files first.
  6. (Optional) For remote server installation (ex. using Smithery CLI), note the CLIENT_ID and CLIENT_SECRET from this file.

Client OAuth (once per user)

  1. Have the user copy ~/.gmail-mcp/gcp-oauth.keys.json to their computer at the same path.
  2. Run npx @shinzolabs/gmail-mcp auth.
  3. A browser window will open where the user may select a profile, review the requested scopes, and approve.
  4. (Optional) For remote server installation, note the file path mentioned in the success message (~/.gmail-mcp/credentials.json by default). The user's REFRESH_TOKEN will be found here.

Client Configuration

There are several options to configure your MCP client with the server. For hosted/remote server setup, use Smithery's CLI with a Smithery API Key. For local installation, use npx or build from source. Each of these options is explained below.

Smithery Remote Server (Recommended)

To add a remote server to your MCP client config.json, run the following command from Smithery CLI:

bash
npx -y @smithery/cli install @shinzo-labs/gmail-mcp

Enter your CLIENT_ID, CLIENT_SECRET, and REFRESH_TOKEN when prompted.

Smithery SDK

If you are developing your own agent application, you can use the boilerplate code here.

NPX Local Install

To install the server locally with npx, add the following to your MCP client config.json:

javascript
{
  "mcpServers": {
    "gmail": {
      "command": "npx",
      "args": [
        "@shinzolabs/gmail-mcp"
      ]
    }
  }
}

Build from Source

  1. Download the repo:
bash
git clone https://github.com/shinzo-labs/gmail-mcp.git
  1. Install packages and build with pnpm (inside cloned repo):
bash
pnpm i && pnpm build
  1. Add the following to your MCP client config.json:
javascript
{
  "mcpServers": {
    "gmail": {
      "command": "node",
      "args": [
        "/path/to/gmail-mcp/dist/index.js"
      ]
    }
  }
}

Config Variables

VariableDescriptionRequired?Default
AUTH_SERVER_PORTPort for the temporary OAuth authentication serverNo3000
CLIENT_IDGoogle API client ID (found in GMAIL_OAUTH_PATH)Yes if remote server connection''
CLIENT_SECRETGoogle API client secret (found in GMAIL_OAUTH_PATH)Yes if remote server connection''
GMAIL_CREDENTIALS_PATHPath to the user credentials fileNoMCP_CONFIG_DIR/credentials.json
GMAIL_OAUTH_PATHPath to the Google API Client fileNoMCP_CONFIG_DIR/gcp-oauth.keys.json
MCP_CONFIG_DIRDirectory for storing configuration filesNo~/.gmail-mcp
REFRESH_TOKENOAuth refresh token (found in GMAIL_CREDENTIALS_PATH)Yes if remote server connection''
PORTPort for Streamable HTTP transport methodNo3000
TELEMETRY_ENABLEDEnable telemetryNotrue

Supported Endpoints

User Management

  • get_profile: Get the current user's Gmail profile
  • stop_mail_watch: Stop receiving push notifications
  • watch_mailbox: Set up push notifications for mailbox changes

Message Management

Managing Messages

  • list_messages: List messages with optional filtering
  • get_message: Get a specific message
  • get_attachment: Get a message attachment
  • modify_message: Modify message labels
  • send_message: Send an email message to specified recipients
  • delete_message: Permanently delete a message
  • trash_message: Move message to trash
  • untrash_message: Remove message from trash
  • batch_modify_messages: Modify multiple messages
  • batch_delete_messages: Delete multiple messages

Label Management

  • list_labels: List all labels
  • get_label: Get a specific label
  • create_label: Create a new label
  • update_label: Update a label
  • patch_label: Partial update of a label
  • delete_label: Delete a label

Thread Management

  • list_threads: List email threads
  • get_thread: Get a specific thread
  • modify_thread: Modify thread labels
  • trash_thread: Move thread to trash
  • untrash_thread: Remove thread from trash
  • delete_thread: Delete a thread

Draft Management

  • list_drafts: List drafts in the user's mailbox
  • get_draft: Get a specific draft by ID
  • create_draft: Create a draft email in Gmail
  • update_draft: Replace a draft's content
  • delete_draft: Delete a draft
  • send_draft: Send an existing draft

Settings Management

Auto-Forwarding

  • get_auto_forwarding: Get auto-forwarding settings
  • update_auto_forwarding: Update auto-forwarding settings

IMAP Settings

  • get_imap: Get IMAP settings
  • update_imap: Update IMAP settings

POP Settings

  • get_pop: Get POP settings
  • update_pop: Update POP settings

Vacation Responder

  • get_vacation: Get vacation responder settings
  • update_vacation: Update vacation responder

Language Settings

  • get_language: Get language settings
  • update_language: Update language settings

Delegates

  • list_delegates: List account delegates
  • get_delegate: Get a specific delegate
  • add_delegate: Add a delegate
  • remove_delegate: Remove a delegate

Filters

  • list_filters: List email filters
  • get_filter: Get a specific filter
  • create_filter: Create a new filter
  • delete_filter: Delete a filter

Forwarding Addresses

  • list_forwarding_addresses: List forwarding addresses
  • get_forwarding_address: Get a specific forwarding address
  • create_forwarding_address: Create a forwarding address
  • delete_forwarding_address: Delete a forwarding address

Send-As Settings

  • list_send_as: List send-as aliases
  • get_send_as: Get a specific send-as alias
  • create_send_as: Create a send-as alias
  • update_send_as: Update a send-as alias
  • patch_send_as: Partial update of a send-as alias
  • verify_send_as: Send verification email
  • delete_send_as: Delete a send-as alias

S/MIME Settings

  • list_smime_info: List S/MIME configurations
  • get_smime_info: Get a specific S/MIME config
  • insert_smime_info: Upload a new S/MIME config
  • set_default_smime_info: Set default S/MIME config
  • delete_smime_info: Delete an S/MIME config

Contributing

Contributions are welcomed and encouraged! Please read CONTRIBUTING.md for guidelines on issues, contributions, and contact information.

Data Collection and Privacy

Shinzo Labs collects limited anonymous telemetry from this server to help improve our products and services. No personally identifiable information is collected as part of this process. Please review the Privacy Policy for more details on the types of data collected and how to opt-out of this telemetry.

License

MIT

Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "mcpServers": {
    "shinzo-labs-gmail-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@shinzolabs/gmail-mcp"
      ]
    }
  }
}

Available Tools

  • create_draft

    Create a draft email in Gmail. Note the mechanics of the raw parameter.

  • delete_draft

    Delete a draft

  • get_draft

    Get a specific draft by ID

  • list_drafts

    List drafts in the user's mailbox

  • send_draft

    Send an existing draft

  • create_label

    Create a new label

  • delete_label

    Delete a label

  • get_label

    Get a specific label by ID

  • list_labels

    List all labels in the user's mailbox

  • patch_label

    Patch an existing label (partial update)

  • update_label

    Update an existing label

  • batch_delete_messages

    Delete multiple messages

  • batch_modify_messages

    Modify the labels on multiple messages

  • delete_message

    Immediately and permanently delete a message

  • get_message

    Get a specific message by ID with format options

  • list_messages

    List messages in the user's mailbox with optional filtering

  • modify_message

    Modify the labels on a message

  • send_message

    Send an email message to specified recipients. Note the mechanics of the raw parameter.

  • trash_message

    Move a message to the trash

  • untrash_message

    Remove a message from the trash

  • get_attachment

    Get a message attachment

  • delete_thread

    Delete a thread

  • get_thread

    Get a specific thread by ID

  • list_threads

    List threads in the user's mailbox

  • modify_thread

    Modify the labels applied to a thread

  • trash_thread

    Move a thread to the trash

  • untrash_thread

    Remove a thread from the trash

  • get_auto_forwarding

    Gets auto-forwarding settings

  • get_imap

    Gets IMAP settings

  • get_language

    Gets language settings

  • get_pop

    Gets POP settings

  • get_vacation

    Get vacation responder settings

  • update_auto_forwarding

    Updates automatic forwarding settings

  • update_imap

    Updates IMAP settings

  • update_language

    Updates language settings

  • update_pop

    Updates POP settings

  • update_vacation

    Update vacation responder settings

  • add_delegate

    Adds a delegate to the specified account

  • remove_delegate

    Removes the specified delegate

  • get_delegate

    Gets the specified delegate

  • list_delegates

    Lists the delegates for the specified account

  • create_filter

    Creates a filter

  • delete_filter

    Deletes a filter

  • get_filter

    Gets a filter

  • list_filters

    Lists the message filters of a Gmail user

  • create_forwarding_address

    Creates a forwarding address

  • delete_forwarding_address

    Deletes the specified forwarding address

  • get_forwarding_address

    Gets the specified forwarding address

  • list_forwarding_addresses

    Lists the forwarding addresses for the specified account

  • create_send_as

    Creates a custom send-as alias

  • delete_send_as

    Deletes the specified send-as alias

  • get_send_as

    Gets the specified send-as alias

  • list_send_as

    Lists the send-as aliases for the specified account

  • patch_send_as

    Patches the specified send-as alias

  • update_send_as

    Updates a send-as alias

  • verify_send_as

    Sends a verification email to the specified send-as alias

  • delete_smime_info

    Deletes the specified S/MIME config for the specified send-as alias

  • get_smime_info

    Gets the specified S/MIME config for the specified send-as alias

  • insert_smime_info

    Insert (upload) the given S/MIME config for the specified send-as alias

  • list_smime_info

    Lists S/MIME configs for the specified send-as alias

  • set_default_smime_info

    Sets the default S/MIME config for the specified send-as alias

  • get_profile

    Get the current user's Gmail profile

  • watch_mailbox

    Watch for changes to the user's mailbox

  • stop_mail_watch

    Stop receiving push notifications for the given user mailbox

Use Gmail MCP MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Gmail MCP is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Gmail MCP as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Gmail MCP MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "shinzo-labs-gmail-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@shinzolabs/gmail-mcp"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Gmail MCP MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Gmail MCP MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Gmail MCP to help me with this task?
Gmail MCP
Sure. I read it.
Here is what I found using Gmail MCP.

Frequently asked questions

What is the Gmail MCP MCP server used for?

Gmail MCP is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Gmail MCP MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Gmail MCP with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Gmail MCP MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Gmail MCP connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Gmail MCP MCP to TypingMind?

Gmail MCP runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Gmail MCP MCP provide in TypingMind?

Gmail MCP exposes 64 MCP tools that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Gmail MCP MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Gmail MCP requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇