vikas0sharma/GmailMCP
If you are the rightful owner of GmailMCP and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
GmailMCP is a .NET 8 application that provides Gmail operations as MCP server tools, utilizing the Google Gmail API.
ReadLatestEmail
Reads the latest email.
SendEmail
Sends an email.
DraftEmail
Creates a draft email.
GmailMCP
GmailMCP is a .NET 8 application that exposes Gmail operations (read, send, draft emails) as Model Context Protocol (MCP) server tools. It uses the Google Gmail API and can be integrated with MCP-compatible clients.
Features
- Read Latest Email: Fetches the most recent email from your Gmail inbox.
- Send Email: Sends an email using your Gmail account.
- Draft Email: Creates a draft email in your Gmail account.
Requirements
- .NET 8 SDK
- Google Cloud project with Gmail API enabled
- OAuth 2.0 credentials (
credentials.json
)
Setup
- Clone the repository
- Enable Gmail API in your Google Cloud project and download
credentials.json
. - Place
credentials.json
in the project root directory. - Build and run the project:
dotnet build dotnet run
- On first run, authenticate in the browser. A
token.json
file will be created for future runs.
Usage
The MCP server exposes the following tools:
ReadLatestEmail
: Reads the latest email.SendEmail(to, subject, body)
: Sends an email.DraftEmail(to, subject, body)
: Creates a draft email.
You can interact with these tools using any MCP-compatible client.
Project Structure
GmailTool.cs
: Implements the Gmail operations as MCP tools.Program.cs
: Configures dependency injection, Gmail API, and MCP server.credentials.json
: OAuth 2.0 credentials (not included; provide your own).
Dependencies
License
This project is for demonstration purposes. See individual package licenses for details.