npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@theethosteam/gmail-mcp

v0.1.1

Published

MCP server (and CLI) for Gmail — create/update/send DRAFTS, search + read mail, labels — over OAuth. The missing create_draft: stage emails in the user's Drafts folder so a human presses Send. Runs via npx, locally or in cloud.

Readme

@theethosteam/gmail-mcp

Drafts-first MCP server and CLI for Gmailcreate_draft / update_draft / list_drafts (the missing piece in the stock Gmail connector), plus search + read mail, threads, labels, and confirm-gated send — authenticated over OAuth as the mailbox owner. Runs via npx, identically locally or in a cloud session, because auth is a refresh token in env vars.

Built on the same pattern as the GA4 / GSC / GTM MCPs: one shared core/, exposed as both an MCP server (mcp.ts) and a commander CLI (cli.ts), run directly with tsx (no build step). Includes a generic raw tool so every users.* Gmail method is reachable.

Why this exists

The claude.ai Gmail connector can send and update an existing draft but cannot create one. The workflow we want is the opposite of send-on-behalf: the agent writes the email, stages it in the human's Drafts folder, and the human reads it and presses Send. So:

  • create_draft is the primary tool — nothing leaves the mailbox. Returns a deep link straight into the compose window.
  • Anything that actually sends (send_draft, send_message) is refused without confirm: true.
  • Replies thread correctly: pass threadId + inReplyTo (the RFC messageId returned by get_message / get_thread).

Scopes: gmail.compose (drafts + send), gmail.readonly (search/read), gmail.modify (labels/archive). No delete scope.

One-time setup

  1. Enable the Gmail API in the Google Cloud project that owns your Desktop OAuth client: https://console.cloud.google.com/apis/library/gmail.googleapis.com
  2. OAuth client: reuse the existing Desktop app client (same as GA4/GSC/GTM) — client id + secret.
  3. Mint a refresh token (this scope needs its own token):
    GMAIL_OAUTH_CLIENT_ID=… GMAIL_OAUTH_CLIENT_SECRET=… npx -y @theethosteam/gmail-mcp gmail auth:url
    # open the URL, approve, copy the ?code=… from the localhost redirect that fails to load
    GMAIL_OAUTH_CLIENT_ID=… GMAIL_OAUTH_CLIENT_SECRET=… npx -y @theethosteam/gmail-mcp gmail auth:exchange <code>

Env vars

GMAIL_OAUTH_CLIENT_ID · GMAIL_OAUTH_CLIENT_SECRET · GMAIL_OAUTH_REFRESH_TOKEN

Connect to Claude

Local (Claude Code CLI), every project:

claude mcp add gmail --scope user \
  -e GMAIL_OAUTH_CLIENT_ID=… -e GMAIL_OAUTH_CLIENT_SECRET=… -e GMAIL_OAUTH_REFRESH_TOKEN=… \
  -- npx -y @theethosteam/gmail-mcp

(Desktop app users: put the three vars in ~/.claude/settings.json env and register with an empty env: {} — the desktop app doesn't expand ${VAR}.)

Cloud (Claude Code on the web): .mcp.json with env via ${VAR}.

Tools

get_profile · create_draft · update_draft · list_drafts · get_draft · delete_draft† · send_draft† · search_messages · get_message · get_thread · list_labels · modify_message · send_message† · raw

† requires confirm: true.

CLI

gmail whoami
gmail search "from:[email protected] newer_than:7d" --body
gmail draft -t [email protected] -s "Subject" --body-file ./draft.txt
gmail draft -t [email protected] -s "Re: thing" --thread <threadId> --in-reply-to "<[email protected]>" -b "…"
gmail drafts
gmail draft:send <draftId> --confirm
gmail raw settings.sendAs.list