This MCP server enables Gmail integration through Model Context Protocol, allowing you to manage emails directly through MCP clients like Claude Desktop. It provides seamless access to Gmail's core functionality including reading, sending, and managing emails.
git clone https://github.com/yourusername/gmail-plugin.git
cd gmail-plugin
# Method 1: Install in editable mode
uv pip install -e .
# Method 2: Install using requirements.txt
uv pip install -r requirements.txt
# Method 3: Install using uv sync (recommended)
uv sync --dev --all-extras
https://www.googleapis.com/auth/gmail/modify
Add this to your MCP client configuration:
"mcpServers": {
"gmail-plugin": {
"command": "uv",
"args": [
"--directory",
"[absolute path to working directory]",
"run",
"server.py"
"--creds-file-path",
"[absolute-path-to-credentials-file]",
"--token-path",
"[absolute-path-to-access-tokens-file]"
]
}
}
"mcpServers": {
"gmail-plugin": {
"command": "uvx",
"args": [
"gmail-plugin"
]
}
}
The Gmail plugin provides the following tools:
Tool Name | Description | Required Arguments |
---|---|---|
send-email |
Send an email | recipient_id, subject, message |
get-unread-emails |
Retrieve unread emails | None |
read-email |
Read email content | email_id |
trash-email |
Move email to trash | email_id |
mark-email-as-read |
Mark email as read | email_id |
open-email |
Open email in browser | email_id |
You can use these predefined prompts with your MCP client:
Prompt Name | Description | Arguments |
---|---|---|
manage-email |
Act as email administrator | None |
draft-email |
Draft a new email | content, recipient, recipient_email |
edit-draft |
Edit existing email draft | changes, current_draft |
If you encounter issues, you can use the MCP Inspector for debugging:
npx @modelcontextprotocol/inspector uv --directory [path-to-plugin] run gmail-plugin
send-email
tool with the following arguments:
get-unread-emails
tool to retrieve a list of unread messagesread-email
mark-email-as-read
trash-email
open-email
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.