gmail-mcp-server
7
The gmail-mcp-server project is designed to expose the Gmail API via the Model Context Protocol (MCP), facilitating its integration with large language models (LLMs) and platforms such as Claude Desktop. It offers a variety of tools to interact with Gmail functionalities like managing labels and retrieving email details.
gmail-mcp-server
The project provides a server to expose the Gmail API via the Model Context Protocol (MCP), allowing integration with LLMs and use in environments like Claude Desktop.
Description
This server exposes Gmail's API through MCP, enabling easy integration with LLMs and environments like Claude Desktop.
Available MCP Tools
- get_labels(): Retrieves all Gmail user labels.
- get_label_by_id(label_id): Retrieves specific label data by ID.
- create_label(name, bg_color, text_color): Creates a new Gmail label with optional colors.
- update_label(label_id, name, bg_color, text_color): Updates an existing label.
- delete_label(label_id): Deletes a label by its ID.
- mark_emails_as_read(emails_ids): Marks emails with provided IDs as read.
- mark_emails_as_unread(emails_ids): Marks emails with provided IDs as unread.
- add_labels(emails_ids, labels): Assigns labels to specified emails.
- get_all_emails_ids_by_query(query, max_results, next_page_token): Returns paginated email IDs based on Gmail query.
- get_email_detail(email_id): Returns complete details of an email by its ID.
Project Structure
src/gmail/
: Gmail integration logic, including authentication.src/gmail_mcp_server/
: MCP entry point and tools.pyproject.toml
: Package and dependencies configuration.
Requirements
- Python 3.11 or higher
- uv for dependency and environment management
- build for packaging
Installation Instructions
- Clone the repository.
- Install dependencies using uv.
Build and Packaging
- Optionally install the build tool.
- Package the module to generate
.whl
and.tar.gz
indist/
directory.
Local Package Installation
- Install using the generated
.whl
file.
License
- MIT License