- Home
- MCP servers
- Gmail
Gmail
- python
0
GitHub Stars
python
Language
6 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"mcp-mirror-samarth2001_gmail-mcp": {
"command": "python",
"args": [
"/absolute/path/to/gmail-mcp-server/gmail_server.py"
],
"env": {
"DEBUG": "false",
"MCP_PORT": "3000",
"GMAIL_TOKEN_PATH": "TOKEN_PATH_PLACEHOLDER",
"GOOGLE_CLIENT_ID": "YOUR_CLIENT_ID",
"GOOGLE_CLIENT_SECRET": "YOUR_CLIENT_SECRET",
"GMAIL_CREDENTIALS_PATH": "CREDENTIALS_PATH_PLACEHOLDER"
}
}
}
}You can run the Gmail MCP Server locally to let Claude interact with Gmail through natural language. It exposes a rich set of email-management capabilities, supports secure OAuth authentication, and can be run in standard or SSE (Server-Sent Events) modes for different integration patterns. This guide walks you through installing, configuring, and using the server end to end.
How to use
Start by launching the Gmail MCP Server on your machine. You will run a Python process that starts an MCP endpoint locally. The server authenticates with Google using OAuth, reads your Gmail data, and exposes a set of tools Claude can invoke to send, read, search, label, and manage emails. Use the standard local run to interact via the default MCP transport, or run in SSE mode to expose an HTTP-based endpoint for remote clients.
How to install
Prerequisites: Install Python 3.8 or higher and ensure you have a Google Cloud project with Gmail API enabled and OAuth credentials.
Step 1. Create a Python virtual environment and activate it.
python -m venv venv
# On Windows
venv\Scripts\activate
# On macOS/Linux
source venv/bin/activate
Step 2. Install dependencies.
pip install -r requirements.txt
Step 3. Set up Google Cloud and OAuth credentials. Create a Google Cloud project, enable the Gmail API, configure OAuth consent, create Desktop OAuth credentials, and download credentials.json to the project root.
First run and authentication
Run the server once to authenticate with Google. A browser window will prompt you to sign in. After you authorize access, a token.json file is created for subsequent runs.
python gmail_server.py
Configure Claude Desktop
Add the Gmail MCP server to Claude Desktop so it can communicate with your local MCP endpoint. Use the absolute path to the server script in your setup.
{
"mcpServers": {
"gmail": {
"command": "python",
"args": [
"/absolute/path/to/gmail-mcp-server/gmail_server.py"
]
}
}
}
Environment and transport notes
You can customize how the server runs using environment variables and by selecting the transport mode. SSE mode exposes an HTTP-based endpoint for integration, while the default mode uses the local transport.
Additional configuration and runtime options
To run in SSE mode on a specific port, start the server with the SSE flag and port number.
python gmail_server.py --sse 3000
Available tools
send_email
Send basic emails with text or HTML content
send_email_with_attachment
Send emails with file attachments
read_email
Read the content of a specific email by ID
search_emails
Search emails using Gmail query syntax
get_email_labels
List all Gmail labels/folders
create_email_label
Create a new Gmail label
update_email_draft
Update an existing draft email
list_email_drafts
List available drafts
send_draft
Send an existing draft
batch_apply_label
Apply a label to multiple emails
get_email_profile
Get Gmail profile information