Skip to main content

A resilient MCP server built with fastMCP for sending emails through Gmail's SMTP server using AI agents

Project description

Gmail MCP Server

A resilient MCP (Model Context Protocol) server built with fastMCP for sending emails through Gmail's SMTP server using AI agents.

PyPI version Python 3.8+ License: MIT

Features

  • Send emails via Gmail SMTP
  • Fetch recent emails from Gmail folders
  • Handle email attachments
  • Health check endpoint for deployment monitoring

Deployment on Smithery.ai

This server is configured for deployment on Smithery.ai using Streamable HTTP transport.

Configuration

The server requires the following configuration parameters:

  • smtp_username: Your Gmail email address
  • smtp_password: Your Gmail app password (not your regular password)

Health Check

The server provides a health check endpoint at /health for Smithery deployment monitoring.

CLAUDE CONFIG EXAMPLE

{
  "mcpServers": {
    "terminal_server": {
      "command": "/Users/maitreyamishra/.local/bin/uv",
      "args": [
        "--directory", "Path to your mcp server file",
        "run",
        "terminal_server.py"
      ]
    },
    "web3_server": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "http://localhost:3000/mcp"
      ]
    },
    "gmail_mcp": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "http://localhost:8989/mcp"
      ]
    }
  }
}

Port

The server runs on port 5000 and binds to all interfaces (0.0.0.0) for container deployment.

Installation

Install the package from PyPI:

pip install rickjang-gmail-mcp-server

Quick Start

  1. Set up your Gmail credentials as environment variables:

    export SMTP_USERNAME="your-email@gmail.com"
    export SMTP_PASSWORD="your-app-password"
    
  2. Run the server:

    rickjang-gmail-mcp-server
    

Local Development

  1. Clone the repository:

    git clone https://github.com/rickjang/Gmail-mcp-server.git
    cd Gmail-mcp-server
    
  2. Install in development mode:

    pip install -e .
    
  3. Set environment variables and run:

    export SMTP_USERNAME="your-email@gmail.com"
    export SMTP_PASSWORD="your-app-password"
    rickjang-gmail-mcp-server
    

Docker

Build and run with Docker:

docker build -t gmail-mcp .
docker run -p 5000:5000 -e SMTP_USERNAME=your-email -e SMTP_PASSWORD=your-password gmail-mcp

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rickjang_gmail_mcp_server-1.0.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rickjang_gmail_mcp_server-1.0.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file rickjang_gmail_mcp_server-1.0.0.tar.gz.

File metadata

File hashes

Hashes for rickjang_gmail_mcp_server-1.0.0.tar.gz
Algorithm Hash digest
SHA256 021b9d57d3fc627f1fe96a97d5165a38a656ca46f85329877960139516864806
MD5 b3a653fc2af55a702465c8da6b423e90
BLAKE2b-256 7798bc5fde1d860ac15b579d50e90c4e959a7a79ab48b862cdde31a109dfd91e

See more details on using hashes here.

File details

Details for the file rickjang_gmail_mcp_server-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for rickjang_gmail_mcp_server-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 03107f2cdc5d7f2ab150f197228a0daac58e52e24b9fd06f291d13c6c8898ce1
MD5 58fd57df807e4c0ac17c5e7634a37687
BLAKE2b-256 ebd71c6a1249c92d7294c0a43a46bff1a9be07bebcbe25db6553e1516a20968a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page