Google Gmail MCP server
{
"mcpServers": {
"a1-x-tech-google-gmail": {
"command": "npx",
"args": [
"-y",
"mcp-google-gmail@latest"
],
"env": {
"GOOGLE_GMAIL_CLIENT_ID": "<google_gmail_client_id>",
"GOOGLE_GMAIL_CLIENT_SECRET": "<google_gmail_client_secret>",
"GOOGLE_GMAIL_REFRESH_TOKEN": "<google_gmail_refresh_token>",
"GOOGLE_GMAIL_ACCESS_TOKEN": "<google_gmail_access_token>"
}
}
}
}{
"mcpServers": {
"a1-x-tech-google-gmail": {
"command": "npx",
"args": [
"-y",
"mcp-google-gmail@latest"
],
"env": {
"GOOGLE_GMAIL_CLIENT_ID": "<google_gmail_client_id>",
"GOOGLE_GMAIL_CLIENT_SECRET": "<google_gmail_client_secret>",
"GOOGLE_GMAIL_REFRESH_TOKEN": "<google_gmail_refresh_token>",
"GOOGLE_GMAIL_ACCESS_TOKEN": "<google_gmail_access_token>"
}
}
}
}{
"mcpServers": {
"a1-x-tech-google-gmail": {
"command": "npx",
"args": [
"-y",
"mcp-google-gmail@latest"
],
"env": {
"GOOGLE_GMAIL_CLIENT_ID": "<google_gmail_client_id>",
"GOOGLE_GMAIL_CLIENT_SECRET": "<google_gmail_client_secret>",
"GOOGLE_GMAIL_REFRESH_TOKEN": "<google_gmail_refresh_token>",
"GOOGLE_GMAIL_ACCESS_TOKEN": "<google_gmail_access_token>"
}
}
}
}{
"servers": {
"a1-x-tech-google-gmail": {
"command": "npx",
"args": [
"-y",
"mcp-google-gmail@latest"
],
"env": {
"GOOGLE_GMAIL_CLIENT_ID": "${input:google_gmail_client_id}",
"GOOGLE_GMAIL_CLIENT_SECRET": "${input:google_gmail_client_secret}",
"GOOGLE_GMAIL_REFRESH_TOKEN": "${input:google_gmail_refresh_token}",
"GOOGLE_GMAIL_ACCESS_TOKEN": "${input:google_gmail_access_token}"
}
}
},
"inputs": [
{
"id": "google_gmail_client_id",
"type": "promptString",
"description": "Google gmail client id",
"password": true
},
{
"id": "google_gmail_client_secret",
"type": "promptString",
"description": "Google gmail client secret",
"password": true
},
{
"id": "google_gmail_refresh_token",
"type": "promptString",
"description": "Google gmail refresh token",
"password": true
},
{
"id": "google_gmail_access_token",
"type": "promptString",
"description": "Google gmail access token",
"password": true
}
]
}{
"mcpServers": {
"a1-x-tech-google-gmail": {
"command": "npx",
"args": [
"-y",
"mcp-google-gmail@latest"
],
"env": {
"GOOGLE_GMAIL_CLIENT_ID": "<google_gmail_client_id>",
"GOOGLE_GMAIL_CLIENT_SECRET": "<google_gmail_client_secret>",
"GOOGLE_GMAIL_REFRESH_TOKEN": "<google_gmail_refresh_token>",
"GOOGLE_GMAIL_ACCESS_TOKEN": "<google_gmail_access_token>"
}
}
}
}file .mcp.json (in your project root)file claude_desktop_config.jsonfile ~/.cursor/mcp.jsonfile .vscode/mcp.jsonfile ~/.codeium/windsurf/mcp_config.jsoninstall npx -y mcp-google-gmailversion 0.1.0
What it does
MCP server for Gmail API that lets AI apps search, read, and send emails, manage drafts, labels, and trash through plain language commands. Designed for developers building AI applications that need Gmail integration with explicit control over destructive operations.
- Search and read unread emails from a specific time period to triage which ones need responses.
- Compose email replies as drafts for review before sending, keeping sending as a separate deliberate step.
- Move emails to trash as a reversible alternative to permanent deletion, with no permanent delete capability.
Tools this server exposes
| Tool | Does |
|---|---|
| search_messages | Search Gmail messages using Gmail query syntax with support for filtering by sender, subject, date and other criteria. |
| read_message | Read a single email message with decoded body content truncated at an explicit limit and attachments as metadata. |
| read_thread | Read an entire email thread with all messages and their contents. |
| create_draft | Create a new draft email in a thread for review before sending. |
| update_draft | Update the content of an existing draft email. |
| send_message | Send an email directly or send an existing draft message. |
| delete_draft | Delete a draft email without sending it. |
| manage_labels | Add, remove, or organize labels on emails. |
| move_to_trash | Move emails to trash for reversible deletion within approximately 30 days. |
Before you enable it
An MCP server runs with whatever access you give it. Start with a development account rather than production, and check which tools the server exposes before you let an agent call them unattended.