The @kazuph/mcp-gmail-gas server enables Gmail integration via Google Apps Script, allowing interaction with Gmail accounts through three main functions:
- Search Emails: Use
gmail_search_messages
with standard Gmail query syntax (e.g., 'subject newer_than:1d') - Retrieve Email Details: Use
gmail_get_message
to fetch the full content of specific emails by messageId - Download Attachments: Use
gmail_download_attachment
to download attachments with options to rename files
Allows Claude Desktop to interact with Gmail accounts through Google Apps Script, enabling capabilities like searching emails, retrieving email content and details, and downloading attachments.
Uses Google Apps Script as the backend service to interface with Gmail, requiring users to deploy a script to their Google account that provides the necessary API endpoints for Gmail interaction.
MCP Gmail
Model Context Protocol server for Gmail integration. This allows Claude Desktop (or any MCP client) to interact with your Gmail account through Google Apps Script.
Quick Start (For Users)
Prerequisites
- Node.js 18+ (install via
brew install node
) - Gmail account
- Google Apps Script deployment
- Claude Desktop (install from https://claude.ai/desktop)
Configuration
- Deploy the Google Apps Script
- Visit Google Apps Script and create a new project
- Copy the entire contents of
code.gs
and paste it into the script editor - Click on "Deploy" > "New deployment"
- Select "Web app" as the deployment type
- Configure the following settings:
- Execute as: Me
- Who has access: Anyone
- Click "Deploy"
- When prompted, review and authorize the app to access your Gmail account
- Copy the deployment URL and generate a random API key for security
Note: The script requires Gmail access permissions. When you first deploy and run the script, Google will ask you to review and grant these permissions. Make sure to:
- Click "Review Permissions"
- Select your Google account
- Click "Advanced" if you see a warning
- Click "Go to [Your Project Name] (unsafe)"
- Click "Allow" to grant the necessary Gmail permissions
- Open your Claude Desktop configuration file at:
~/Library/Application Support/Claude/claude_desktop_config.json
You can find this through the Claude Desktop menu:
- Open Claude Desktop
- Click Claude on the Mac menu bar
- Click "Settings"
- Click "Developer"
- Add the following to your configuration:
Note: Replace YOUR_DEPLOYMENT_URL
and YOUR_API_KEY
with your actual values.
For Developers
Prerequisites
- Node.js 18+ (install via
brew install node
) - Gmail account
- Google Apps Script
- Claude Desktop (install from https://claude.ai/desktop)
- tsx (install via
npm install -g tsx
)
Installation
Development Configuration
- Make sure Claude Desktop is installed and running.
- Install tsx globally if you haven't:
- Modify your Claude Desktop config located at:
~/Library/Application Support/Claude/claude_desktop_config.json
Add the following to your MCP client's configuration:
Available Tools
gmail_search_messages
: Search for emails using Gmail search query syntax (e.g., "subject newer_than:1d")gmail_get_message
: Get the full content and details of a specific emailgmail_download_attachment
: Download an attachment from a specific email
Security Note
Always keep your VALID_API_KEY
secret and never commit it to version control. This key helps ensure that only authorized clients can access your Gmail through the Google Apps Script deployment.
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Model Context Protocol server for Gmail integration. This allows Claude Desktop (or any MCP client) to interact with your Gmail account through Google Apps Script.
Related MCP Servers
- -securityAlicense-qualityModel Context Protocol (MCP) server implementation that enables Claude Desktop to interact with Google's Gemini AI models.Last updated -182JavaScriptMIT License
- -securityAlicense-qualityAn MCP server that enables Gmail integration, allowing users to manage emails (send, receive, read, trash, mark as read) directly through MCP clients like Claude Desktop.Last updated -PythonMIT License
- -securityAlicense-qualityA Model Context Protocol server that enables AI assistants like Claude to interact with Gmail through natural language, providing comprehensive email management capabilities including sending, reading, organizing, searching, and managing drafts and labels.Last updated -4PythonGPL 3.0
- -securityAlicense-qualityA Model Context Protocol server that enables Claude AI to interact with Gmail, supporting email sending, reading, searching, labeling, draft management, and batch operations through natural language commands.Last updated -PythonMIT License