gmail_MCP

RustSandbox/gmail_MCP

3.3

If you are the rightful owner of gmail_MCP and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

A clean, simplified Model Context Protocol (MCP) server for Gmail integration, built with Rust, providing secure Gmail access through OAuth2 authentication for AI assistants and automation tools.

The Gmail MCP Server is a streamlined server designed to integrate Gmail functionalities into AI assistants and automation tools using the Model Context Protocol (MCP). Developed as a Rust learning exercise, this server emphasizes secure OAuth2 authentication, efficient email processing, and high performance. Inspired by the Rig framework, it showcases Rust's capabilities in async programming, error handling, and clean code architecture. The server connects AI assistants with Gmail, allowing them to fetch and process emails securely and efficiently. With a focus on simplicity and maintainability, the server is an excellent resource for developers looking to integrate Gmail into their AI solutions.

Features

  • Secure OAuth2 Authentication - Ensures Google-standard security for accessing Gmail.
  • Gmail Integration - Fetches and processes emails directly from the inbox.
  • Clean Email Processing - Converts HTML emails to text and removes URLs for cleaner data.
  • High Performance - Built with Rust, offering speed and safety.
  • MCP Protocol - Provides a standard interface for AI tool integration.

Usages

usage with local integration stdio

python
mcp.run(transport='stdio')  # Tools defined via @mcp.tool() decorator

usage with remote integration sse

python
mcp.run(transport='sse', host="0.0.0.0", port=3003)  # Specify SSE endpoint

usage with remote integration streamable http

yaml
paths:
  /mcp:
    post:
      x-ms-agentic-protocol: mcp-streamable-1.0  # Copilot Studio integration

usage with platform integration github

{"command": "docker", "args": ["run", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "ghcr.io/github/github-mcp-server"]}

usage with platform integration copilot studio

yaml
paths:
  /mcp:
    post:
      x-ms-agentic-protocol: mcp-streamable-1.0  # Copilot Studio integration

Tools

  1. gmail_reader

    Read Gmail emails with options to specify actions and limit results.