
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.
概览
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. - Node.js 18+ (install via brew install node) - Gmail account - Google Apps Script deployment - Claude Desktop (install from https://claude.ai/desktop) 1. 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: 1. Click "Review Permissions" 2.
README
以下为原文 README 节选,完整内容请查看原文。
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.gsand 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:
{
"tools": {
"gmail": {
"command": "npx",
"args": ["-y", "@kazuph/mcp-gmail-gas"],
"env": {
"GAS_ENDPOINT": "YOUR_DEPLOYMENT_URL",
"VALID_API_KEY": "YOUR_API_KEY"
}
}
}
}
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
git clone https://github.com/kazuph/mcp-gmail-gas.git
cd mcp-gmail-gas
npm install
npm run build
Development Configuration
-
Make sure Claude Desktop is installed and running.
-
Install tsx globally if you haven’t:
npm install -g tsx
# or
pnpm add -g tsx
- Modify your Claude Desktop config located at:
~/Library/Application Support/Claude/claude_desktop_config.json
Add the following to your MCP client’s configuration:
{
"tools": {
"gmail": {
"args": ["tsx", "/path/to/mcp-gmail-gas/index.ts"],
"env": {
"GAS_ENDPOINT": "YOUR_DEPLOYMENT_URL",
"VALID_API_KEY": "YOUR_API_KEY"
安装
npx -y @kazuph/mcp-gmail-gas