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

gsuite-mcp

v0.2.0

Published

MCP server for Gmail + Google Calendar. Bulk export, bulk label modify, draft-first safety, gated send, RFC 5322 reply threading, in-MCP OAuth setup.

Readme

gsuite-mcp

MCP server for Gmail + Google Calendar. TypeScript, stdio transport.

Design

  • Send is gated. Send tools (gmail_send_message, gmail_send_draft) are only registered when GMAIL_ENABLE_SEND=true. By default the server can search, read, label, draft, export, and modify labels in bulk — but cannot send.
  • Proper RFC 5322 reply threading. Pass reply_to_message_id to gmail_create_draft or gmail_send_message and the server fetches the source message, sets In-Reply-To / References, and reuses threadId.
  • Bulk-first. gmail_bulk_export dumps a query result (metadata + bodies + attachments) to a directory; gmail_bulk_modify_labels calls batchModify so 1000 messages cost one API call.
  • Tokens stored under ~/.config/gmail-mcp/ with 0600. Refresh tokens are persisted on rotation. Override with GMAIL_MCP_CONFIG_DIR=/some/path.

Install

npx -y gsuite-mcp@latest

Prerequisites

A Google account. That's it — the package ships with a default OAuth client, so you do not need to create your own GCP project.

Optional: bring your own OAuth client

If you'd rather run against your own Google Cloud project (separate quota, your own consent screen):

  1. Enable the Gmail API and Calendar API on the project.
  2. Configure the OAuth consent screen (External, Testing mode is fine — add yourself as a Test user).
  3. Create an OAuth 2.0 Client ID of type Desktop app and download the credentials JSON.
  4. Save it as ~/.config/gmail-mcp/oauth-client.json. When present, this file overrides the bundled defaults.

Register with your MCP client

For Claude Code, add to ~/.claude.json under mcpServers:

{
  "mcpServers": {
    "gmail": {
      "command": "npx",
      "args": ["-y", "gsuite-mcp@latest"],
      "env": {}
    }
  }
}

To enable sending: "env": { "GMAIL_ENABLE_SEND": "true" }.

Authorize (one-time, in-MCP)

After the server is registered:

  1. Ask the model to call setup_auth with no arguments. It returns a URL.
  2. Open the URL in a browser, pick the account, grant access.
  3. Your browser shows ERR_CONNECTION_REFUSED on http://localhost/?code=... — expected. Copy the full URL from the address bar.
  4. Ask the model to call setup_auth again, passing the URL as url_or_code. Token is saved; Gmail/Calendar tools become live without restart.

PKCE is used end-to-end. No loopback server is run.

Tool surface

Setup

  • setup_auth — call with no args for a consent URL; call again with the post-consent URL/code to finish

Gmail (always on)

  • gmail_search — Gmail query syntax. Returns enriched metadata (from/subject/date/snippet/labelIds/hasAttachments) by default; pass format: 'ids' for ID-only.
  • gmail_get_message, gmail_get_thread
  • gmail_list_labels, gmail_modify_labels, gmail_bulk_modify_labels
  • gmail_list_drafts, gmail_get_draft, gmail_create_draft, gmail_update_draft, gmail_delete_draft
  • gmail_download_attachments — bulk by query, with mime/filename filters
  • gmail_bulk_export — bulk export to per-message subdirectories (metadata, body, attachments) plus a top-level index.json

Gmail (only when GMAIL_ENABLE_SEND=true)

  • gmail_send_message, gmail_send_draft

Calendar (always on)

  • calendar_list_calendars, calendar_list_events, calendar_get_event
  • calendar_create_event, calendar_update_event, calendar_delete_event

Scopes

  • https://www.googleapis.com/auth/gmail.modify (read, draft, label, send)
  • https://www.googleapis.com/auth/calendar

Gmail has no scope that grants drafts without also granting send. Send is gated at the tool layer, not the scope layer — Google's own official MCP makes the same tradeoff.

Config paths

  • OAuth client (optional override): ~/.config/gmail-mcp/oauth-client.json
  • Token: ~/.config/gmail-mcp/token.json

Override with GMAIL_MCP_CONFIG_DIR=/some/path.

License

MIT