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

gmail-workspace-mcp-server

v0.0.3

Published

MCP server for Gmail integration with service account support

Readme

Gmail Workspace MCP Server

An MCP (Model Context Protocol) server that provides Gmail integration for AI assistants using Google Workspace service accounts with domain-wide delegation.

Features

  • List Recent Emails: Retrieve recent emails within a specified time horizon
  • Get Email Details: Fetch full email content including body and attachments info
  • Service Account Authentication: Secure domain-wide delegation for Google Workspace organizations

Installation

npm install gmail-workspace-mcp-server

Or run directly with npx:

npx gmail-workspace-mcp-server

Prerequisites

This server requires a Google Cloud service account with domain-wide delegation to access Gmail on behalf of users in your Google Workspace domain.

Setup Steps

  1. Go to Google Cloud Console
  2. Create or select a project
  3. Enable the Gmail API
  4. Create a service account with domain-wide delegation enabled
  5. In Google Workspace Admin Console, grant the service account access to the https://www.googleapis.com/auth/gmail.readonly scope
  6. Download the JSON key file

Environment Variables

| Variable | Required | Description | | ------------------------------------ | -------- | ---------------------------------------- | | GMAIL_SERVICE_ACCOUNT_CLIENT_EMAIL | Yes | Service account email address | | GMAIL_SERVICE_ACCOUNT_PRIVATE_KEY | Yes | Service account private key (PEM format) | | GMAIL_IMPERSONATE_EMAIL | Yes | Email address to impersonate |

You can find the client_email and private_key values in your service account JSON key file.

Configuration

Claude Desktop

Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "gmail": {
      "command": "npx",
      "args": ["gmail-workspace-mcp-server"],
      "env": {
        "GMAIL_SERVICE_ACCOUNT_CLIENT_EMAIL": "[email protected]",
        "GMAIL_SERVICE_ACCOUNT_PRIVATE_KEY": "-----BEGIN PRIVATE KEY-----\nMIIE...\n-----END PRIVATE KEY-----",
        "GMAIL_IMPERSONATE_EMAIL": "[email protected]"
      }
    }
  }
}

Note: For the private key, you can either:

  1. Use the key directly with \n for newlines (as shown above)
  2. Set the environment variable from a shell that preserves newlines

Available Tools

gmail_list_recent_emails

List recent emails from Gmail within a specified time horizon.

Parameters:

  • hours (number, optional): Time horizon in hours (default: 24)
  • labels (string, optional): Comma-separated label IDs (default: "INBOX")
  • max_results (number, optional): Maximum emails to return (default: 10, max: 100)

Example:

{
  "hours": 48,
  "labels": "INBOX,STARRED",
  "max_results": 20
}

gmail_get_email

Retrieve the full content of a specific email by its ID.

Parameters:

  • email_id (string, required): The unique identifier of the email

Example:

{
  "email_id": "18abc123def456"
}

Development

Setup

# Install dependencies
npm run install-all

# Build
npm run build

# Run in development mode
npm run dev

Testing

# Run functional tests
npm test

# Run integration tests
npm run test:integration

# Run manual tests (requires service account credentials)
npm run test:manual

License

MIT