Skip to content
Automation
Skill

/add-gmail

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.

From plugin
claudeclaw
19427 skills

Claude Code

$ npx -y skills add sbusso/claudeclaw --skill add-gmail --agent claude-code

SKILL.md

add-gmail.SKILL.md
name: add-gmail
description: 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.

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

git remote -v

If `gmail` is missing, add it:

git remote add gmail https://github.com/qwibitai/claudeclaw-gmail.git

Merge the skill branch

git fetch gmail main
git merge gmail/main || {
  git checkout --theirs package-lock.json
  git add package-lock.json
  git merge --continue
}

This merges in:

  • `src/channels/gmail.ts` (GmailChannel class with self-registration via `registerChannel`)
  • `src/channels/gmail.test.ts` (unit tests)
  • `import './gmail.js'` appended to the channel barrel file `src/channels/index.ts`
  • Gmail credentials mount (`~/.gmail-mcp`) in `src/orchestrator/container-runner.ts`
  • Gmail MCP server (`@gongrzhe/server-gmail-autoauth-mcp`) and `mcp__gmail__*` allowed tool in `agent/runner/src/index.ts`
  • `googleapis` npm dependency in `package.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):

## Email Notifications

When you receive an email notification (messages starting with `[Email from ...`), inform the user about it but do NOT reply to the email unless specifically asked. You have Gmail tools available — use them only when the user explicitly asks you to reply, forward, or take action on an email.

Validate code changes

npm install
npm run build
npx vitest run src/channels/gmail.test.ts

All tests must pass (including the new Gmail tests) and build must be clean before proceeding.

Phase 3: Setup

Check existing Gmail credentials

ls -la ~/.gmail-mcp/ 2>/dev/null || echo "No Gmail config found"

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 existing > 2. Go to **APIs & Services > Library**, search "Gmail API", click **Enable** > 3. 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 as `gcp-oauth.keys.json` > > Where did you save the file? (Give me the full path, or paste the file contents here)

If user provides a path, copy it:

mkdir -p ~/.gmail-mcp
cp "/path/user/provided/gcp-oauth.keys.json" ~/.gmail-mcp/gcp-oauth.keys.json

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:

npx -y @gongrzhe/server-gmail-autoauth-mcp auth

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):

rm -r data/sessions/*/agent-runner-src 2>/dev/null || true

Rebuild the container (agent-runner changed):

cd container && ./build.sh

> **Service name:** Derived from the directory name: `com.claudeclaw.<dirname>` (macOS) / `claudeclaw-<dirname>` (Linux). For example, if cwd is `my-assistant`, the service is `com.claudeclaw.my-assistant`. Determine the correct service name before running service commands below.

Then compile and restart:

npm run build
launchctl kickstart -k gui/$(id -u)/com.claudeclaw  # macOS
# Linux: systemctl --user restart claudeclaw

Phase 4: Verify

Test tool access (both modes)

Tell the user:

> Gmail is connected! Send this in your main channel: > > `@Andy check my recent emails` or `@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

tail -f logs/claudeclaw.log

Troubleshooting

Gmail connection not responding

Test directly:

npx -y @gongrzhe/server-gmail-a
Read more
@sbusso
Ships withclaudeclaw

Use Claude to orchestrate agents like OpenClaw

Stars on GitHub

Momentum

stars in total
194
Star history of sbusso/claudeclaw on GitHub, a chart by star-history.com

Other skills on claudeclaw.

agent-browser

agent-browser

Browse the web for any task — research topics, read articles, interact with web apps, fill forms, take screenshots, extract data,…

@sbusso@sbussoInstall Skill
add-compact

add-compact

Add /compact command for manual context compaction. Solves context rot in long sessions by forwarding the SDK's built-in /compact…

@sbusso@sbussoInstall Skill
add-image-vision

add-image-vision

Add image vision to ClaudeClaw agents. Resizes and processes WhatsApp image attachments, then sends them to Claude as multimodal…

@sbusso@sbussoInstall Skill
add-ollama-tool

add-ollama-tool

Add Ollama MCP server so the container agent can call local models for cheaper/faster tasks like summarization, translation, or…

@sbusso@sbussoInstall Skill

More skills from other plugins.

agent-builder

agent-builder

Load immediately after an Agent intent, before the first agent_builder_* call. Governs how you create, configure, test, and…

n8n10d209k
@n8n-io@n8n-ioInstall Skill
browser-use

browser-use

Direct browser control via CDP for web interaction: automation, scraping, testing, screenshots, and site/app work. Also covers…

@browser-use@browser-useInstall Skill
agent-browser

agent-browser

Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling…

@vercel-labs-2@vercel-labs-2Install Skill
add-anydoc

add-anydoc

Add local office-document-to-Markdown conversion to NanoClaw agent containers with the pinned Firecrawl AnyDoc CLI. Use when…

@nanocoai@nanocoaiInstall Skill

Questions about add-gmail.

Which coding agents can use add-gmail?
add-gmail installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.