A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/gangradeamitesh/mcp-google-email below:

GitHub - gangradeamitesh/mcp-google-email

A Gmail service implementation using MCP (Model Context Protocol) that provides functionality for sending, receiving, and managing emails through Gmail's API.

The MCP Google Email Service was developed to address several key needs in modern application development:

  1. Standardized Email Integration: Provides a consistent interface for Gmail integration across different applications, eliminating the need to write boilerplate code for Gmail API interactions.

  2. Simplified Authentication: Handles the complexity of Gmail API authentication through multiple methods (Service Account, OAuth 2.0, and Application Default Credentials), making it easier to integrate Gmail functionality into applications.

  3. Environment-Based Configuration: Supports flexible configuration through environment variables, making it suitable for various deployment scenarios (development, staging, production).

  4. Model Context Protocol (MCP) Integration: Implements the Model Context Protocol, ensuring consistent behavior and integration with other MCP-compliant services. MCP provides a standardized way to handle context and state management across different services.

This service is particularly useful for:

pip install mcp-google-email
from src.server import FastMCP

# Initialize the Gmail service
gmail_service = FastMCP("GMail")

# List unread messages
messages = gmail_service.list_message(query='is:unread', max_results=10)

# Send an email
gmail_service.send_message(
    to='recipient@example.com',
    subject='Test Email',
    message_text='Hello, this is a test email'
)

# Get today's messages
todays_messages = gmail_service.get_todays_messages(max_results=20)

# Reply to a message
gmail_service.reply_to_message(
    message_id='message_id_here',
    reply_text='Thank you for your email'
)

The package supports multiple authentication methods:

  1. Service Account (via GOOGLE_APPLICATION_CREDENTIALS or GOOGLE_CREDENTIALS_CONFIG)
  2. OAuth 2.0 (via credentials.json and token.json)
  3. Application Default Credentials (ADC)

The following environment variables can be used to configure the service:

To set up the development environment:

  1. Clone the repository:
git clone https://github.com/yourusername/mcp-google-email.git
cd mcp-google-email
  1. Create and activate a virtual environment:
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt

MIT License

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


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4