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

@ahmedshaikh/api-diff-mcp

v0.1.0

Published

Detect breaking changes to a TypeScript/JavaScript module's public API as an MCP server — extract the export surface (signatures) and diff two versions, flagging removed/changed exports. Built on the TypeScript compiler API.

Readme

api-diff

Did my refactor break the public API? Extract a TypeScript/JavaScript module's export surface (functions, classes, interfaces, types, consts — with their signatures) and diff two versions to flag breaking changes. Built on the TypeScript compiler API, so it's accurate — not regex guessing.

api_diff({ old_path: "src/api.ts@HEAD", new_path: "src/api.ts" })
→ { breaking: true, breaking_count: 1,
    summary: { added: 1, removed: 0, changed: 1 },
    changes: [
      { name: "fetchUser", change: "changed", breaking: true,
        old: "function fetchUser(id: string): User",
        new: "function fetchUser(id: string, opts: Opts): User" },
      { name: "fetchUsers", change: "added", breaking: false } ] }

Why it's new

The rest of an agent toolkit handles making edits safely (checkpoint, apply-patch, verify). None of them answer "is this change backward-compatible?" — agents rename a param or drop an export and silently break every consumer. This is the missing refactor-safety check, and a natural semver gate.

Tools

  • api_surface(code | path) — the public API of a module: every export + a normalized signature. (Great for "what does this module expose?")
  • api_diff(old, new | old_path, new_path){ breaking, breaking_count, summary{added,removed,changed}, changes[] }. Removed and signature-changed exports are breaking; added exports are compatible.

Signatures are whitespace-normalized, so formatting/reorder noise doesn't show up — only real surface changes do. Private/protected class members are ignored.

Setup

npm install
npm test
claude mcp add api-diff -- node /abs/path/api-diff/dist/server.js
# CLI:  agent-apidiff old.ts new.ts          (exit 1 if breaking)
#       agent-apidiff surface src/api.ts
# git:  agent-apidiff <(git show HEAD:src/api.ts) src/api.ts

Honest limits

  • TS/JS surface only — exported names + their written signatures. It does not resolve types across files or run a full type-checker, so an unannotated export const x = makeThing() is compared by name, not inferred type.
  • "Breaking" is structural and conservative: any removed/changed export is flagged. A widened-but-compatible type change still shows as changed — treat it as a prompt to look, not a verdict.
  • Re-exports are tracked by name; it doesn't follow them into other modules.