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

@grabow/safe-gmail-mcp

v1.0.6

Published

Security-hardened Gmail MCP server - read, label, archive, draft only (no send/delete)

Readme

Safe Gmail MCP

A security-hardened Gmail MCP server for Claude Code. Supports reading, labeling, archiving, and drafting emails - but cannot send or delete.

Quick Start

git clone <this-repo>
cd safe-gmail-mcp
npm install
npm run init

The setup wizard will guide you through:

  1. Creating Google Cloud OAuth credentials
  2. Authenticating with your Gmail account
  3. Configuring Claude Code

Why This Exists

The original Gmail MCP has powerful capabilities that could be dangerous if misused:

  • Send emails (impersonation risk)
  • Delete emails (data loss)
  • Create filters (auto-forward/delete)

This fork removes those dangerous operations while keeping everything needed for email triage workflows.

What You Can Do

| Tool | Description | |------|-------------| | draft_email | Create a draft email (you send manually) | | send_email | Send email to yourself only (for reminders) | | read_email | Read email content by ID | | search_emails | Search with Gmail syntax | | list_email_labels | List all labels | | create_label | Create a new label | | update_label | Update a label | | delete_label | Delete a user-created label | | get_or_create_label | Get existing or create new label | | modify_email | Add/remove labels from an email | | batch_modify_emails | Bulk label modifications | | download_attachment | Save attachment to disk |

What You CANNOT Do

  • Send emails to others (only drafts)
  • Delete emails
  • Create filters

Commands

| Command | Description | |---------|-------------| | npm run init | Interactive setup wizard | | npm run auth | Re-authenticate (if token expires) | | npm run status | Check authentication status | | npm start | Run the MCP server |

Manual Setup

If you prefer not to use the wizard:

1. Create Google Cloud OAuth Credentials

  1. Go to Google Cloud Console
  2. Create a new project
  3. Enable the Gmail API: APIs & Services > Library > Gmail API > Enable
  4. Configure OAuth consent screen:
    • User type: External
    • Add your email as a test user
  5. Create credentials: Credentials > Create > OAuth Client ID > Desktop app
  6. Download the JSON file

2. Set Up Credentials

mkdir -p ~/.safe-gmail-mcp
chmod 700 ~/.safe-gmail-mcp
mv ~/Downloads/client_secret_*.json ~/.safe-gmail-mcp/gcp-oauth.keys.json
chmod 600 ~/.safe-gmail-mcp/gcp-oauth.keys.json

3. Authenticate

npm run auth

4. Configure Claude Code

Add to your .mcp.json:

{
  "mcpServers": {
    "safe-gmail": {
      "command": "node",
      "args": ["/path/to/safe-gmail-mcp/src/index.js"],
      "env": {
        "GMAIL_OAUTH_PATH": "/Users/you/.safe-gmail-mcp/gcp-oauth.keys.json",
        "GMAIL_CREDENTIALS_PATH": "/Users/you/.safe-gmail-mcp/credentials.json"
      }
    }
  }
}

Troubleshooting

"Gmail API has not been used"

Enable Gmail API: APIs & Services > Library > Gmail API > Enable

"Access denied" or 403 error

Add your email as a test user in the OAuth consent screen.

Token expired

Run npm run auth to re-authenticate.

Port already in use

The auth flow tries ports 3000, 3001, 3002. Close any apps using these ports.

Security

See SECURITY.md for detailed security design documentation.

License

ISC (inherited from original project)

Credits

Fork of @gongrzhe/server-gmail-autoauth-mcp