sbusso/claudeclaw/add-gmail
Claude Code and agent skill by sbusso/claudeclaw
- community
Checking that the SKILL.md file is still in the repository.
Add Gmail integration to ClaudeClaw. Can be configured as a tool (agent reads/sends emails when triggered from WhatsApp) or as a full channel (emails can trigger the agent, schedule tasks, and receive replies). Guides through GCP OAuth setup and implements the integration.
Install
npx vskill@latest install sbusso/claudeclaw/add-gmailSKILL.md
Add Gmail Integration
This skill adds Gmail support to ClaudeClaw — either as a tool (read, send, search, draft) or as a full channel that polls the inbox.
Phase 1: Pre-flight
Check if already applied
Check if src/channels/gmail.ts exists. If it does, skip to Phase 3 (Setup). The code changes are already in place.
Ask the user
Use AskUserQuestion:
AskUserQuestion: Should incoming emails be able to trigger the agent?
- Yes — Full channel mode: the agent listens on Gmail and responds to incoming emails automatically
- No — Tool-only: the agent gets full Gmail tools (read, send, search, draft) but won't monitor the inbox. No channel code is added.
Phase 2: Apply Code Changes
Ensure channel remote
If gmail is missing, add it:
Merge the skill branch
This merges in:
src/channels/gmail.ts(GmailChannel class with self-registration viaregisterChannel)src/channels/gmail.test.ts(unit tests)import './gmail.js'appended to the channel barrel filesrc/channels/index.ts- Gmail credentials mount (
~/.gmail-mcp) insrc/orchestrator/container-runner.ts - Gmail MCP server (
@gongrzhe/server-gmail-autoauth-mcp) andmcp__gmail__*allowed tool inagent/runner/src/index.ts googleapisnpm dependency inpackage.json
If the merge reports conflicts, resolve them by reading the conflicted files and understanding the intent of both sides.
Add email handling instructions (Channel mode only)
If the user chose channel mode, append the following to groups/main/CLAUDE.md (before the formatting section):
Validate code changes
All tests must pass (including the new Gmail tests) and build must be clean before proceeding.
Phase 3: Setup
Check existing Gmail credentials
If credentials.json already exists, skip to "Build and restart" below.
GCP Project Setup
Tell the user:
I need you to set up Google Cloud OAuth credentials:1. Open https://console.cloud.google.com — create a new project or select existing2. Go to APIs & Services > Library, search "Gmail API", click Enable3. Go to APIs & Services > Credentials, click + CREATE CREDENTIALS > OAuth client ID- If prompted for consent screen: choose "External", fill in app name and email, save- Application type: Desktop app, name: anything (e.g., "ClaudeClaw Gmail")4. Click DOWNLOAD JSON and save asgcp-oauth.keys.jsonWhere did you save the file? (Give me the full path, or paste the file contents here)
If user provides a path, copy it:
If user pastes JSON content, write it to ~/.gmail-mcp/gcp-oauth.keys.json.
OAuth Authorization
Tell the user:
I'm going to run Gmail authorization. A browser window will open — sign in and grant access. If you see an "app isn't verified" warning, click "Advanced" then "Go to [app name] (unsafe)" — this is normal for personal OAuth apps.
Run the authorization:
If that fails (some versions don't have an auth subcommand), try timeout 60 npx -y @gongrzhe/server-gmail-autoauth-mcp || true. Verify with ls ~/.gmail-mcp/credentials.json.
Build and restart
Clear stale per-group agent-runner copies (they only get re-created if missing, so existing copies won't pick up the new Gmail server):
Rebuild the container (agent-runner changed):
Service name: Derived from the directory name:com.claudeclaw.<dirname>(macOS) /claudeclaw-<dirname>(Linux). For example, if cwd ismy-assistant, the service iscom.claudeclaw.my-assistant. Determine the correct service name before running service commands below.
Then compile and restart:
Phase 4: Verify
Test tool access (both modes)
Tell the user:
Gmail is connected! Send this in your main channel:@Andy check my recent emailsor@Andy list my Gmail labels
Test channel mode (Channel mode only)
Tell the user to send themselves a test email. The agent should pick it up within a minute. Monitor: tail -f logs/claudeclaw.log | grep -iE "(gmail|email)".
Once verified, offer filter customization via AskUserQuestion — by default, only emails in the Primary inbox trigger the agent (Promotions, Social, Updates, and Forums are excluded). The user can keep this default or narrow further by sender, label, or keywords. No code changes needed for filters.
Check logs if needed
Troubleshooting
Gmail connection not responding
Test directly:
OAuth token expired
Re-authorize:
Container can't access Gmail
- Verify
~/.gmail-mcpis mounted: checksrc/orchestrator/container-runner.tsfor the.gmail-mcpmount - Check container logs:
cat groups/main/logs/container-*.log | tail -50
Emails not being detected (Channel mode only)
- By default, the channel polls unread Primary inbox emails (
is:unread category:primary) - Check logs for Gmail polling errors
Removal
Tool-only mode
- Remove
~/.gmail-mcpmount fromsrc/orchestrator/container-runner.ts - Remove
gmailMCP server andmcp__gmail__*fromagent/runner/src/index.ts - Rebuild and restart
- Clear stale agent-runner copies:
rm -r data/sessions/*/agent-runner-src 2>/dev/null || true - Rebuild:
cd container && ./build.sh && cd .. && npm run build && launchctl kickstart -k gui/$(id -u)/com.claudeclaw(macOS) orsystemctl --user restart claudeclaw(Linux)
Channel mode
- Delete
src/channels/gmail.tsandsrc/channels/gmail.test.ts - Remove
import './gmail.js'fromsrc/channels/index.ts - Remove
~/.gmail-mcpmount fromsrc/orchestrator/container-runner.ts - Remove
gmailMCP server andmcp__gmail__*fromagent/runner/src/index.ts - Uninstall:
npm uninstall googleapis - Rebuild and restart
- Clear stale agent-runner copies:
rm -r data/sessions/*/agent-runner-src 2>/dev/null || true - Rebuild:
cd container && ./build.sh && cd .. && npm run build && launchctl kickstart -k gui/$(id -u)/com.claudeclaw(macOS) orsystemctl --user restart claudeclaw(Linux)
Security
- Security scanPassed, 93 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/add-gmail/SKILL.md
Popularity
- Repository stars
- 173
- Repository forks
- 56
- 7-day trend score
- 26
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/sbusso/claudeclaw/add-gmail)