Gmail
This is Gmail MCP server by using this you can directly use your with claude desktop.
claude mcp add --transport stdio vijay-2005-gmail-mcp-server uv --directory /absolute/path/to/gmail-mcp run gmail --creds-file-path /absolute/path/to/credentials.json --token-path /absolute/path/to/tokens.json
How to use
This Gmail MCP server provides a feature-rich interface to manage Gmail directly from an AI assistant via the Model Context Protocol. It exposes a Gmail-focused MCP service that supports sending emails, reading messages with metadata, labeling and filtering, drafting emails, and archiving. The server workflows are designed so an agent can perform natural-language actions such as drafting emails, retrieving threads, applying labels, creating folders (labels), and executing advanced searches using Gmail query language. To connect, configure your MCP client (e.g., Claude Desktop or MCP Inspector) to point at this Gmail MCP server and supply the required credentials file and token path. The server relies on Google Cloud OAuth 2.0 credentials to authenticate with the Gmail API and handles token refresh automatically during operation.
How to install
Prerequisites:
- Python 3.8+
- Access to Google Cloud and Gmail API credentials (OAuth 2.0 desktop app, credentials.json)
- network access to Google APIs
-
Clone the repository and navigate to the project
git clone https://github.com/theposch/gmail-mcp.git cd gmail-mcp
-
Set up a virtual environment and activate it
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
-
Install the package in editable mode
pip install -e .
-
Prepare Google Cloud credentials
- Follow Google Cloud Setup steps in the README to create a project, enable Gmail API, and download the credentials JSON as credentials.json
- Place the credentials file somewhere secure, e.g. ~/.gmail-mcp/credentials.json
-
Run the server (example using MCP via UV)
Ensure the credentials path is correct for your setup
uv run gmail --creds-file-path /absolute/path/to/credentials.json --token-path /absolute/path/to/tokens.json
-
Optional: test the server with the MCP Inspector or Claude Desktop using the provided command templates in the README.
Additional notes
Tips and considerations:
- Never commit credentials or tokens to version control. Use secure paths and consider environment variables for sensitive paths.
- The server uses OAuth2 with automatic token refresh; ensure the credentials.json file is kept secure and accessible by the server process.
- When creating labels or folders, remember Gmail treats folders as labels; use label-related operations to organize messages.
- If you modify credentials or tokens, restart the MCP server to ensure updated credentials are loaded.
- For testing, the MCP Inspector can execute commands directly against the server using the specified credentials and token paths.
- Ensure the OAuth consent screen includes the required Gmail scopes (modify, read, etc.) as described in the setup guide.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP