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

@franciscpd/gmail-mcp-server

v1.0.0

Published

MCP server for Gmail — read, search, send, reply, and manage emails via AI agents

Downloads

111

Readme

@franciscpd/gmail-mcp-server

CI npm version License: MIT

A Model Context Protocol (MCP) server for Gmail. Read, search, send, reply, forward emails and manage labels — powered by 3 environment variables.

Quick Start

npx -y @franciscpd/gmail-mcp-server

Set these environment variables:

| Variable | Description | |----------|-------------| | GMAIL_CLIENT_ID | OAuth2 client ID from Google Cloud Console | | GMAIL_CLIENT_SECRET | OAuth2 client secret | | GMAIL_REFRESH_TOKEN | OAuth2 refresh token (see Setup Guide) |

Setup Guide

1. Create a Google Cloud Project

  1. Go to Google Cloud Console
  2. Create a new project (or select an existing one)
  3. Note your project name for the next steps

2. Enable the Gmail API

  1. Navigate to APIs & ServicesLibrary
  2. Search for "Gmail API"
  3. Click Enable

3. Create OAuth2 Credentials

  1. Navigate to APIs & ServicesCredentials
  2. Click Create CredentialsOAuth client ID
  3. If prompted, configure the OAuth consent screen:
    • User type: External (or Internal for Workspace)
    • Add the scope: https://mail.google.com/
    • Add your email as a test user
  4. Application type: Web application
  5. Add https://developers.google.com/oauthplayground as an authorized redirect URI
  6. Save your Client ID and Client Secret

4. Get a Refresh Token

  1. Go to Google OAuth2 Playground
  2. Click the ⚙️ gear icon (top right) and check Use your own OAuth credentials
  3. Enter your Client ID and Client Secret
  4. In the left panel, find Gmail API v1 and select https://mail.google.com/
  5. Click Authorize APIs and grant access
  6. Click Exchange authorization code for tokens
  7. Copy the Refresh token

Configuration

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "gmail": {
      "command": "npx",
      "args": ["-y", "@franciscpd/gmail-mcp-server"],
      "env": {
        "GMAIL_CLIENT_ID": "your-client-id",
        "GMAIL_CLIENT_SECRET": "your-client-secret",
        "GMAIL_REFRESH_TOKEN": "your-refresh-token"
      }
    }
  }
}

Cursor

Add to your Cursor MCP settings:

{
  "mcpServers": {
    "gmail": {
      "command": "npx",
      "args": ["-y", "@franciscpd/gmail-mcp-server"],
      "env": {
        "GMAIL_CLIENT_ID": "your-client-id",
        "GMAIL_CLIENT_SECRET": "your-client-secret",
        "GMAIL_REFRESH_TOKEN": "your-refresh-token"
      }
    }
  }
}

Generic MCP Client

GMAIL_CLIENT_ID=your-client-id \
GMAIL_CLIENT_SECRET=your-client-secret \
GMAIL_REFRESH_TOKEN=your-refresh-token \
npx -y @franciscpd/gmail-mcp-server

The server communicates over stdio using the MCP protocol.

Tools

| Tool | Description | |------|-------------| | gmail_read_emails | List emails from a label with pagination | | gmail_get_email | Get full email content by ID | | gmail_search_emails | Search with Gmail query syntax | | gmail_get_thread | Get all messages in a thread | | gmail_get_attachment | Download attachment by ID | | gmail_send_email | Compose and send a new email | | gmail_reply_email | Reply to an email in-thread | | gmail_forward_email | Forward an email to new recipients | | gmail_list_labels | List all labels with counts | | gmail_modify_labels | Batch add/remove labels |

Development

# Install dependencies
npm install

# Build
npm run build

# Run tests
npm test

# Run tests with coverage
npm run test:coverage

# Start the server
npm start

License

MIT