Skip to main content
Glama

Gmail Plugin MCP Server

Gmail Plugin MCP Server

A powerful MCP server that enables Gmail integration, allowing you to manage emails directly through MCP clients. This plugin provides seamless access to Gmail's core functionality including reading, sending, and managing emails.

Reference: For a sample MCP server implementation using uvx, check out this example.

🎥 Demo

https://github.com/user-attachments/assets/df9e86cf-1f6b-4265-9c68-b3ed88103d1f

✨ Features

  • 📧 Send and receive emails
  • 📥 Read unread messages
  • 🗑️ Trash emails
  • 📱 Open emails in browser
  • 📝 Mark emails as read
  • 🔒 Secure OAuth2 authentication

🚀 Quick Start

Prerequisites

  • Python 3.12 or higher
  • Gmail API credentials
  • MCP client (like Claude Desktop)

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/gmail-plugin.git cd gmail-plugin
  1. Install dependencies (choose one method):
# Method 1: Install in editable mode uv pip install -e . # Method 2: Install using requirements.txt uv pip install -r requirements.txt # Method 3: Install using uv sync (recommended) uv sync --dev --all-extras
  1. Configure your Gmail API credentials:
    • Go to Google Cloud Console
    • Create a new project or select existing one
    • Enable Gmail API
    • Configure OAuth consent screen:
      • Select "External" user type (no publishing required)
      • Go to the Audiences tab : Add your email as a "Test user"
      • Add OAuth scope: https://www.googleapis.com/auth/gmail/modify
    • Create OAuth 2.0 credentials:
      • Choose "Desktop App" as application type
      • Download the JSON credentials file
    • Save the credentials file and note its absolute path (will be used for --creds-file-path)

Configuration

For Development/Unpublished Servers

Add this to your MCP client configuration:

"mcpServers": { "gmail-plugin": { "command": "uv", "args": [ "--directory", "[absolute path to working directory]", "run", "server.py" "--creds-file-path", "[absolute-path-to-credentials-file]", "--token-path", "[absolute-path-to-access-tokens-file]" ] } }
For Published Servers
"mcpServers": { "gmail-plugin": { "command": "uvx", "args": [ "gmail-plugin" ] } }

🛠️ Development

Building and Publishing

  1. Sync dependencies:
uv sync
  1. Build package:
uv build
  1. Publish to PyPI:
uv publish

Debugging

Use the MCP Inspector for debugging:

npx @modelcontextprotocol/inspector uv --directory C:\Users\sanch\Desktop\gmail_plugin\gmail-plugin run gmail-plugin

📚 API Reference

Available Tools

Tool NameDescriptionRequired Arguments
send-emailSend an emailrecipient_id, subject, message
get-unread-emailsRetrieve unread emailsNone
read-emailRead email contentemail_id
trash-emailMove email to trashemail_id
mark-email-as-readMark email as reademail_id
open-emailOpen email in browseremail_id

Available Prompts

Prompt NameDescriptionArguments
manage-emailAct as email administratorNone
draft-emailDraft a new emailcontent, recipient, recipient_email
edit-draftEdit existing email draftchanges, current_draft

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

-
security - not tested
A
license - permissive license
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

An MCP server that enables Gmail integration, allowing users to manage emails (send, receive, read, trash, mark as read) directly through MCP clients like Claude Desktop.

  1. 🎥 Demo
    1. ✨ Features
      1. 🚀 Quick Start
        1. Prerequisites
        2. Installation
        3. Configuration
      2. 🛠️ Development
        1. Building and Publishing
        2. Debugging
      3. 📚 API Reference
        1. Available Tools
        2. Available Prompts
      4. 🤝 Contributing
        1. 📄 License

          Related MCP Servers

          • A
            security
            A
            license
            A
            quality
            Provides tools for interacting with Gmail and Calendar APIs. This server enables you to manage your emails and calendar events programmatically through the MCP interface.
            Last updated -
            8
            25
            JavaScript
            MIT License
          • A
            security
            A
            license
            A
            quality
            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.
            Last updated -
            3
            420
            11
            JavaScript
            MIT License
            • Apple
          • -
            security
            A
            license
            -
            quality
            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.
            Last updated -
            2
            Python
            GPL 3.0
          • -
            security
            A
            license
            -
            quality
            MCP server that integrates with Gmail to enable sending, reading, and managing emails through tools like send-email, trash-email, get-unread-emails, and read-email.
            Last updated -
            54
            Python
            GPL 3.0
            • Apple

          View all related MCP servers

          MCP directory API

          We provide all the information about MCP servers via our MCP API.

          curl -X GET 'https://glama.ai/api/mcp/v1/servers/sanchisingh01/MCP-Server---Gmail-Plugin-for-Claude-Desktop'

          If you have feedback or need assistance with the MCP directory API, please join our Discord server