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

email-local-core

v0.3.0

Published

The portable half of Email Local MCP: the email tool vocabulary (~25 MCP tools), the MailProvider contract, and the host seam. Runs on Node and in a V8 isolate (Cloudflare Workers, Deno) — no IMAP, no filesystem, no credential store.

Readme

email-local-core

The portable half of Email Local MCP: the email tool vocabulary (~25 MCP tools with their schemas and descriptions), the MailProvider contract every backend implements, and the MailHost seam a deployment plugs into.

It contains no way to actually fetch mail. No IMAP, no HTTP client, no filesystem, no credential store — those belong to whoever is hosting it. It type-checks with no @types/node and a Workers lib, so it runs unchanged on Node and in a V8 isolate (Cloudflare Workers, Deno).

Why it is a package

The tool names are a contract. Email Local runs in two places — a local macOS app speaking IMAP/SMTP with App Passwords in the Keychain, and a hosted Worker speaking provider REST APIs over per-user OAuth — and an agent must not be able to tell them apart. Publishing the vocabulary makes that identity structural: both hosts call the same registerTools, so the surfaces cannot drift without someone changing this package on purpose.

Usage

import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { buildInstructions, registerTools, type MailHost } from "email-local-core";

const host: MailHost = {
  listAccounts: async () => [...],          // what `list_accounts` reports
  resolveEmail: async (account) => "...",   // optional arg -> an address
  assertWritable: async (email) => {},      // throw to refuse writes
  getProvider: async (email) => provider,   // a MailProvider for that address
  // accountAdmin is optional: supply it only if this deployment owns a
  // credential store to put a password in. Omitting it means `add_account`
  // is not registered at all, rather than registered and broken.
};

const server = new McpServer(
  { name: "my-mail", version: "1.0.0" },
  { instructions: buildInstructions("What this deployment connects to.") },
);
registerTools(server, host);

@modelcontextprotocol/sdk and zod are peer dependencies on purpose: the host owns the McpServer instance, so both sides must resolve the same copy.

Implementing a provider

MailProvider is ~25 methods over read / create / update / delete plus the query-first bulk operations. ProviderCapabilities (labels, threads, nativeSearch) is how a backend says what it cannot do, so the tool layer never assumes Gmail: bulk_modify_labels throws on a folder-only backend and points the caller at bulk_move, with no branch in the tools themselves.

The three flags are independent, and the tool descriptions name the flag they depend on rather than a provider. Do not treat them as a Gmail-vs-rest switch: Microsoft Graph is labels: false with threads: true and nativeSearch: true, and it is your host's listAccounts that reports them — AccountSummary carries capabilities, which is where every one of those descriptions sends the agent to look. ProviderId names the service and is informational; the same Microsoft mailbox is a folder store over IMAP and a threaded, searchable one over Graph, so it can never stand in for the flags.

Source

The sources live in src/core/ of the main repository; this directory is the published package (build output lands in core/dist). Build it from the repo root with npm run build:core, and pack it with npm run pack:core.

License

MIT — see the repository LICENSE.