Provides Gmail access via Google Apps Script to search, fetch, and download attachments from a Gmail account through MCP clients.
Configuration
View docs{
"mcpServers": {
"kazuph-mcp-gmail-gas": {
"command": "npx",
"args": [
"-y",
"@kazuph/mcp-gmail-gas"
],
"env": {
"GAS_ENDPOINT": "YOUR_DEPLOYMENT_URL",
"VALID_API_KEY": "YOUR_API_KEY"
}
}
}
}MCP Gmail lets you interact with your Gmail account through Google Apps Script using an MCP client. It provides a bridge between Claude Desktop (and other MCP clients) and your Gmail, enabling you to search messages, fetch content, and download attachments with secure, script-based access.
You can use the Gmail MCP to perform common email tasks from your MCP client, such as searching for messages with Gmail query syntax, retrieving a complete message, and downloading attachments. Start by configuring the MCP client to connect to the Gmail MCP server, then issue appropriate high-level actions from your client to perform those tasks. The following configuration and usage patterns describe how to connect and operate the Gmail MCP server.
Prerequisites you need before installing and using the Gmail MCP server:
Step 1. Deploy Google Apps Script
Step 2. Open Claude Desktop and configure the local settings as described in the deployment and configuration steps below.
Step 3. Add the MCP configuration to Claude Desktop to enable Gmail tools.
You’ll manage two kinds of configurations: a deployment-based configuration that points to your Google Apps Script Web App, and a development configuration that runs locally via tsx for testing. The configurations below show how to wire your client to the Gmail MCP server.
{
"tools": {
"gmail": {
"command": "npx",
"args": ["-y", "@kazuph/mcp-gmail-gas"],
"env": {
"GAS_ENDPOINT": "YOUR_DEPLOYMENT_URL",
"VALID_API_KEY": "YOUR_API_KEY"
}
}
}
}Replace YOUR_DEPLOYMENT_URL with your Google Apps Script deployment URL and YOUR_API_KEY with the API key you generated for security.
{
"tools": {
"gmail": {
"args": ["tsx", "/path/to/mcp-gmail-gas/index.ts"],
"env": {
"GAS_ENDPOINT": "YOUR_DEPLOYMENT_URL",
"VALID_API_KEY": "YOUR_API_KEY"
}
}
}
}Keep your API key secure. Do not commit VALID_API_KEY to version control. This key ensures only authorized clients can access Gmail through the Google Apps Script deployment.
Search for emails using Gmail query syntax (e.g., subject:Meeting newer_than:1d)
Retrieve the full content and details of a specific email
Download an attachment from a specific email