Gmail

by quantum-369

12 stars
107 downloads
Not rated
GitHub

About

Integrates with Gmail APIs to enable reading, sending, and managing emails across multiple accounts, supporting automated email processing and workflow integration.

Details

Author
quantum-369
Repository
Quantum-369/Gmail-mcp-server
GitHub stars
12
Downloads
107
License
Apache License 2.0
Categories
Productivity, Developer Tools, Design, AI, Search, API, Automation, Communication
Tags
#integration

- Read emails from multiple Gmail accounts
- Send emails with attachments
- Search emails with advanced query options
- Download email attachments
- Handle email conversations and threads
- Real-time email monitoring
- Support for multiple Gmail accounts

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Gmail
    Command (node, npx, python, etc.) npx
    Arguments
    • Argument 1 -y
    • Argument 2 @highlight/mcp-server

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Prerequisites

Before running the Gmail MCP server, ensure you have the following:

1. Python 3.12 or higher
2. Google Cloud Project with Gmail API enabled
3. OAuth 2.0 Client ID credentials
4. Required Python packages (specified in pyproject.toml)

Installing Via Smithery

To install Gmail Integration Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @Quantum-369/Gmail-mcp-server --client claude

1. Clone the repository:

git clone <your-repository-url>
cd gmail-mcp-server

2. Create and activate a virtual environment:

python -m venv venv

Running On Ubuntu

1. Install Python 3.12 and create a virtual environment if you haven't already:

bash
sudo apt install python3.12 python3.12-venv -y
python3.12 -m venv venv
source venv/bin/activate
2. Place your downloaded client_secret.json in the project root.
3. Generate an OAuth token for the Gmail account you want to use. Copy the URL
printed by the script into a web browser and complete the sign-in process:
bash
python gmail_token_creator.py
4. Start the server:
bash
python gmail_server.py

Setup Google Cloud Project

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. Create OAuth 2.0 credentials:
- Go to "APIs & Services" > "Credentials"
- Click "Create Credentials" > "OAuth client ID"
- Choose "Desktop app" as application type
- Download the client configuration file
5. Rename the downloaded file to client_secret.json and place it in the project root directory

Running With Docker

You can also build a container image using the provided Dockerfile:

bash
docker build -t gmail-mcp-server .
docker run -v $(pwd)/client_secret.json:/app/client_secret.json \
-v $(pwd)/token_files:/app/token_files gmail-mcp-server
``

The container runs the same server and stores authentication tokens in the
token_files` directory on the host so they persist between runs.

send_gmail

Send an email from a specified Gmail account. Parameters: email_identifier (string), to (string), subject (string), body (string), attachment_paths (array of strings)

search_email_tool

Search for emails based on a query from a specified Gmail account. Parameters: email_identifier (string), query (string), max_results (integer), include_conversations (boolean)

read_latest_emails

Read the latest emails from a specified Gmail account. Parameters: email_identifier (string), max_results (integer), download_attachments (boolean)

download_email_attachments

Download attachments from a specific email in a Gmail account. Parameters: email_identifier (string), msg_id (string), download_all_in_thread (boolean)

1. Send Email:

await send_gmail(
email_identifier="your.email@gmail.com",
to="recipient@example.com",
subject="Test Subject",
body="Email body content",
attachment_paths=["path/to/attachment"]
)

2. Search Emails:

await search_email_tool(
email_identifier="your.email@gmail.com",
query="from:someone@example.com",
max_results=30,
include_conversations=True
)

3. Read Latest Emails:

await read_latest_emails(
email_identifier="your.email@gmail.com",
max_results=5,
download_attachments=False
)

4. Download Attachments:

await download_email_attachments(
email_identifier="your.email@gmail.com",
msg_id="message_id",
download_all_in_thread=False
)

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "gmail": {
            "env": {},
            "args": [
                "-y",
                "@highlight/mcp-server"
            ],
            "command": "npx"
        }
    }
}

Linux

{
    "env": [],
    "args": [
        "-y",
        "@highlight/mcp-server"
    ],
    "command": "npx"
}

Macos

{
    "env": [],
    "args": [
        "-y",
        "@highlight/mcp-server"
    ],
    "command": "npx"
}

Windows

{
    "env": [],
    "args": [
        "/c",
        "npx",
        "-y",
        "@highlight/mcp-server"
    ],
    "command": "cmd"
}

Gmail MCP Server

smithery badge

A powerful and flexible Gmail integration server built using the MCP (Message Control Protocol) framework. This server provides a robust interface to interact with Gmail APIs, offering functionality for reading, sending, and managing emails programmatically.

Features

- Read emails from multiple Gmail accounts
- Send emails with attachments
- Search emails with advanced query options
- Download email attachments
- Handle email conversations and threads
- Real-time email monitoring
- Support for multiple Gmail accounts

Prerequisites

Before running the Gmail MCP server, ensure you have the following:

1. Python 3.12 or higher
2. Google Cloud Project with Gmail API enabled
3. OAuth 2.0 Client ID credentials
4. Required Python packages (specified in pyproject.toml)

Installation

Installing via Smithery

To install Gmail Integration Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @Quantum-369/Gmail-mcp-server --client claude

1. Clone the repository:

git clone <your-repository-url>
cd gmail-mcp-server

2. Create and activate a virtual environment:
```bash
python -m venv venv

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.