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

@mimicai/adapter-gmail

v0.13.0

Published

Gmail API mock adapter for Mimic. Provides 34 Gmail v1 routes covering messages, threads, labels, drafts, history, and the user profile — all backed by an in-memory state store and seeded with realistic, persona-consistent data.

Readme

@mimicai/adapter-gmail

Gmail API mock adapter for Mimic. Provides 34 Gmail v1 routes covering messages, threads, labels, drafts, history, and the user profile — all backed by an in-memory state store and seeded with realistic, persona-consistent data.

Built for AI agents that need to read mailbox state during testing without hitting real Google infrastructure: pre-call briefing agents, customer-success automations, anything that "reads the inbox".

Install

npm install @mimicai/adapter-gmail

What it covers

| Resource | Operations | |----------|-----------| | users.getProfile | GET /users/{userId}/profile | | users.watch / users.stop | Push notifications stubs | | users.messages | list, get, send, modify, trash, untrash, batchModify, batchDelete, insert, import, delete | | users.messages.attachments | get | | users.threads | list, get, modify, trash, untrash, delete | | users.labels | list, get, create, update, patch, delete (8 system labels seeded automatically) | | users.drafts | list, get, create, update, send, delete | | users.history | list (incremental sync via startHistoryId) |

The Gmail Settings surface (vacation responder, IMAP/POP, filters, sendAs, delegates, CSE) is intentionally deferred — see issue #150.

Auth

Real Gmail uses OAuth 2.0 / service-account delegation. For mock usage, requests with the auth header Bearer mimic_<personaId>_* resolve to the persona id <personaId>. The userId path segment is conventionally me.

Response shapes

  • List endpoints wrap items under the resource key Gmail uses (messages, threads, labels, drafts, history) plus resultSizeEstimate and an opaque nextPageToken when paginated.
  • Errors match Google's standard JSON error envelope:
    { "error": { "code": 404, "message": "...", "errors": [...], "status": "NOT_FOUND" } }
  • Pagination uses pageToken + maxResults (default 100, max 500), matching Gmail.

MCP tools

The adapter ships 10 MCP tools (get_gmail_profile, list_gmail_messages, get_gmail_message, send_gmail_message, modify_gmail_message_labels, list_gmail_threads, get_gmail_thread, list_gmail_labels, list_gmail_drafts, list_gmail_history). Names and descriptions are tuned for LLM consumption.

Running

Standalone MCP server (stdio):

npx -y @mimicai/adapter-gmail mcp

Or via mimic host after configuring it in mimic.json:

{
  "apis": {
    "gmail": { "enabled": true, "mcp": true }
  }
}

Regenerating from spec

Routes, resource specs, and default factories are produced from Google's Gmail Discovery doc:

curl -fsSL "https://gmail.googleapis.com/\$discovery/rest?version=v1" \
  -o packages/adapters/adapter-gmail/gmail-discovery.json
pnpm --filter @mimicai/adapter-gmail generate

The codegen script (scripts/gmail-codegen.ts) walks the discovery doc, skips users.settings.* (deferred), and writes four files into src/generated/. The default-factory bodies are hand-tuned templates inside the codegen script — preserved across regeneration.

License

Apache 2.0