setup

A setup guide for connecting Gmail to Claude through mailwarden, a local tool that uses your own Google OAuth credentials.

In plain words
What is it for?
Use it to check or repair mailwarden, create the required OAuth credentials, authorize Gmail, and verify that the connection works.
Why use it?
It explains the Google Cloud setup and authorization steps needed when mailwarden is not authorized or its credentials are missing.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/csitte/mailwarden/setup
Any agent
npx skills add csitte/mailwarden --skill setup
Clone the repo
git clone --depth 1 https://github.com/csitte/mailwarden

Made for: Claude Code, Codex.

Per session 94 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 752 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00094 $0.00752
Opus 5 $0.00047 $0.00376
Sonnet 5 $0.00019 $0.00150
Haiku 4.5 $0.00009 $0.00075

Measured yesterday against content hash df16f72a2133, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

setup scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/setup/SKILL.md · 46 lines

How it starts

The opening of the file, as written. The whole thing — 46 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Set up mailwarden

mailwarden runs locally and talks to Gmail with the user's OWN Google OAuth client — there is no hosted service and no shared credential. Setup is a one-time dance with the Google Cloud console and one terminal command. The authoritative, step-by-step guide ships with this plugin:

${CLAUDE_PLUGIN_ROOT}/docs/SETUP.md

Read it before you start (it is short) and follow it rather than improvising — in particular the part about setting the OAuth consent screen to Production, which is what keeps the token from expiring after seven days.

How to run this

  1. Diagnose first. Run npx -y mailwarden --check and read its report. It tells you exactly which step is missing (no credentials.json, no token, wrong scopes, encrypted token without passphrase, …) and what to do. If it passes, setup is already done — say so and stop.
  2. Walk the user through the console steps from docs/SETUP.md §1–§4 (Cloud project → Gmail API → consent screen in Production → Desktop-app OAuth client → download credentials.json into ~/.mailwarden/). These happen in the user's browser; you cannot do them for them. Give one step at a time and wait.
  3. Authorize (§5): the user runs npx -y mailwarden --auth in their own terminal — it opens a browser for Google consent and stores the refresh token in ~/.mailwarden/token.json. Do not run this from a tool call yourself; it needs an interactive browser session. The "unverified app" warning is expected for a personal OAuth client (§5, "The unverified app warning is normal").
  4. Verify with npx -y mailwarden --check again, then call the get_profile tool to confirm which mailbox is connected.

Options worth mentioning

  • Least privilege: MAILWARDEN_TOOLS=read (or MAILWARDEN_READONLY=1) registers only the read tools and requests only gmail.readonly at --auth. The plugin's default server entry runs the full surface; a user who wants a narrower tier should add the server themselves with claude mcp add mailwarden -e MAILWARDEN_TOOLS=read -- npx -y mailwarden and disable this plugin's server. Widening the tiers needs a fresh --auth; narrowing does not.
  • Second account: npx -y mailwarden --auth --account work, then a second server entry with MAILWARDEN_ACCOUNT=work (README → "Multiple accounts"). One server = one mailbox, by design.
  • Troubleshooting: every known error message has an entry in docs/SETUP.md → Troubleshooting. Quote the matching entry instead of guessing.

Read the full file on GitHub · 46 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 46 lines · 94 tokens per session scan A df16f72a2133

Subscribe to this mod's changes

setup is a skill published in the GitHub repository csitte/mailwarden (0 stars, last pushed yesterday), licensed MIT. It adds 94 tokens to every session and 752 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

gmail

Send, read, and manage Gmail messages and email attachments automatically.

AbdullahMalik17/malikclaw · 15 tokens

gmail-tool

Gmail integration tool for unread checks, reading bodies, and drafts via OAuth2 Gmail API access. Use when: reading inbox mail, fetching message bodies, writing drafts, or searching labeled mail.

xuiltul/animaworks · 42 tokens

c-email

Read, send, search, and label email via gog (Gmail CLI) or himalaya (IMAP). Supports inbox management, drafting replies, thread viewing, and label/folder operations across Gmail and standard IMAP accounts.

daxaur/openpaw · 49 tokens

imap-smtp-email

Read, search, and manage email via IMAP protocol. Send email via SMTP. Supports Gmail, Outlook, 163.com, 126.com, QQ Mail, and any standard IMAP/SMTP server with multi-account support.

wentorai/Research-Claw · 51 tokens

mail-operations

Use this skill whenever the user wants to interact with email. This includes reading inbox, sending emails, replying, searching messages, managing labels and categories, downloading attachments, setting up auto-reply rules, or triggering agents to handle incoming emails. Supports Gmail, Outlook, and IMAP/SMTP (QQ…

desirecore/market · 151 tokens

mail-muncher

Give an agent or script its own read-only mailbox as files on disk. Works with any IMAP server (Fastmail, iCloud, Gmail, Proton Bridge, work and self-hosted accounts) or with the Gmail API. Use when the user wants email in an agent workflow, wants to archive or export mail, wants to monitor an inbox for specific…

craigjmidwinter/mail-muncher · 139 tokens