agentleFS
b1rdmaniab1rdmania/ghostclaw/.claude/skills/add-gmail-agent/SKILL.md

add-gmail-agent

Skill91 starsChanged 7 months agoMITView on GitHub

Wire Gmail MCP server into the agent so it can read, search, and send emails. Optional — not core functionality.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Create a project (or use existing)

    line 32
  2. Distinctive:

    Create OAuth 2.0 credentials (Desktop app type)

    line 34
  3. Very specific:

    Follow the browser OAuth flow.

    line 43
  4. Very specific:

    Remove GMAIL_MCP_ENABLED=1 from .env and restart.

    line 86

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Add Email to Agent (Gmail)

Gives the agent access to email via MCP tools. Read, search, send, and manage emails from the bot.

This is optional. Email is not core to GhostClaw. But it's useful — your bot can read verification codes, check for urgent emails, send summaries, or flag things that need attention. One practical use: the bot reads its own auth codes automatically during setup.

Email providers

Gmail is the easiest path because there's a well-maintained MCP server for it. But this isn't Gmail-specific — any email provider with an MCP server or IMAP access works. Options:

ProviderApproachDifficulty
GmailMCP server with OAuth (documented below)Medium — Google Cloud setup required
Outlook/365Microsoft Graph MCP serverMedium — Azure app registration
Any IMAPGeneric IMAP MCP serverEasy — just server/user/password
Proton MailProton Bridge + IMAP MCPMedium — needs Bridge running

The Gmail route is documented here. For other providers, the wiring is identical — just swap the MCP server command in the agent runner config.

Gmail setup

1. Google Cloud OAuth (one-time)

This is the fiddly part. You need a Google Cloud project with Gmail API enabled:

  1. Go to Google Cloud Console
  2. Create a project (or use existing)
  3. Enable the Gmail API
  4. Create OAuth 2.0 credentials (Desktop app type)
  5. Download the credentials JSON

Then authenticate the MCP server:

npx @gongrzhe/server-gmail-autoauth-mcp

Follow the browser OAuth flow. This creates credentials in ~/.gmail-mcp/.

2. Enable in GhostClaw

Add to .env:

GMAIL_MCP_ENABLED=1

3. Rebuild and restart

cd agent-runner && npx tsc
launchctl kickstart -k gui/$(id -u)/com.ghostclaw  # macOS
# systemctl --user restart ghostclaw               # Linux

4. Test

Send a message to the bot: "Check my recent emails"

What the agent can do

With email enabled, the agent has these MCP tools:

ToolWhat it does
search_emailsSearch with Gmail query syntax
read_emailRead a specific email by ID
send_emailSend an email
draft_emailCreate a draft
modify_emailMove/label emails
list_email_labelsList all labels
create_filterCreate inbox filters
download_attachmentDownload attachments

How it works

The agent runner at agent-runner/src/index.ts conditionally adds the Gmail MCP server when GMAIL_MCP_ENABLED=1 is set. The server runs as a child process of the agent, inheriting HOME for OAuth credential discovery.

Disabling

Remove GMAIL_MCP_ENABLED=1 from .env and restart. The agent won't have email tools on next invocation.

Using other email providers

To swap Gmail for another provider, edit agent-runner/src/index.ts and change the MCP server command in the gmail config block. The rest of the wiring (conditional enable via env var, tool permissions) stays the same.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.