mcp-headless-gmail

This repository provides a Docker-ready MCP server for headless Gmail access, enabling remote email retrieval and sending without local credentials or browser setup, using decoupled architecture and automatic token refresh.

19
3

MCP Headless Gmail Server

This project provides a Model Context Protocol (MCP) server for interacting with Gmail, enabling functionalities like sending and receiving emails without local credential storage or browser access. It offers a decoupled architecture where OAuth flow is handled independently, and credentials are then passed to the server.

Key features include retrieving recent emails (with truncated or full bodies), sending emails, and refreshing access tokens. It's designed for containerization using Docker and relies on the google-api-python-client library.

The server is intended for use cases where only Gmail access is needed, such as marketing applications. It supports headless operation in remote environments. The server can be integrated with MCP clients like Claude, where Google API credentials are provided in the tool calls. The server handles automatic token refreshing.

To use the server, you need Google API credentials, including client ID, client secret, access token, and refresh token. The README provides instructions for obtaining these credentials and using the server's tools.

Repository

BA
baryhuang

baryhuang/mcp-headless-gmail

Created

March 20, 2025

Updated

March 27, 2025

Language

Python

Category

Communication