{"_id":"@ahmedshaikh/api-diff-mcp","name":"@ahmedshaikh/api-diff-mcp","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@ahmedshaikh/api-diff-mcp","version":"0.1.0","type":"module","description":"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.","bin":{"agent-apidiff":"dist/cli.js"},"engines":{"node":">=18"},"scripts":{"serve":"tsx src/server.ts","apidiff":"tsx src/cli.ts","build":"tsc","test":"node --import tsx --test --test-force-exit test/*.test.ts","prepublishOnly":"npm run build"},"dependencies":{"@modelcontextprotocol/sdk":"^1.0.0","typescript":"^5.4.0","zod":"^3.23.8"},"devDependencies":{"@types/node":"^20.11.0","tsx":"^4.7.0"},"license":"MIT","author":{"name":"ahmedshaikh"},"keywords":["mcp","model-context-protocol","claude","agent","ai","api","breaking-changes","semver","typescript","public-api"],"repository":{"type":"git","url":"git+https://github.com/RaziStuff/api-diff-mcp.git"},"homepage":"https://github.com/RaziStuff/api-diff-mcp#readme","bugs":{"url":"https://github.com/RaziStuff/api-diff-mcp/issues"},"publishConfig":{"access":"public"},"gitHead":"fb390ff71ab55032aa9ecd51c14d6be948369155","_id":"@ahmedshaikh/api-diff-mcp@0.1.0","_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-hBdK8yfZjJhkTurAOgUMD6+//zZsyxqXjFHTgAp/lbfR8zIROMsdqzXwpIi93ijx41hXr5jYUeaFQjZeZqgSSw==","shasum":"641c3ad23b8d8e66bd1140832d252e08e5772db8","tarball":"https://registry.npmjs.org/@ahmedshaikh/api-diff-mcp/-/api-diff-mcp-0.1.0.tgz","fileCount":6,"unpackedSize":13920,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGdAE0z/Jv9uDUFXeY/QO6ujehZcEF6IFPwft+fH8EDKAiEAgDOutHcuJXHdqeBjJ7261CTYxUFDuerNofTbGUIiUbA="}]},"_npmUser":{"name":"ahmedshaikh","email":"ahmed@shaikh1.com"},"directories":{},"maintainers":[{"name":"ahmedshaikh","email":"ahmed@shaikh1.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/api-diff-mcp_0.1.0_1782762619894_0.37087166906612046"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-29T19:50:19.717Z","0.1.0":"2026-06-29T19:50:20.032Z","modified":"2026-06-29T19:50:20.274Z"},"maintainers":[{"name":"ahmedshaikh","email":"ahmed@shaikh1.com"}],"description":"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.","homepage":"https://github.com/RaziStuff/api-diff-mcp#readme","keywords":["mcp","model-context-protocol","claude","agent","ai","api","breaking-changes","semver","typescript","public-api"],"repository":{"type":"git","url":"git+https://github.com/RaziStuff/api-diff-mcp.git"},"author":{"name":"ahmedshaikh"},"bugs":{"url":"https://github.com/RaziStuff/api-diff-mcp/issues"},"license":"MIT","readme":"# api-diff\n\n**Did my refactor break the public API?** Extract a TypeScript/JavaScript module's\n**export surface** (functions, classes, interfaces, types, consts — with their\nsignatures) and **diff two versions** to flag breaking changes. Built on the\nTypeScript compiler API, so it's accurate — not regex guessing.\n\n```\napi_diff({ old_path: \"src/api.ts@HEAD\", new_path: \"src/api.ts\" })\n→ { breaking: true, breaking_count: 1,\n    summary: { added: 1, removed: 0, changed: 1 },\n    changes: [\n      { name: \"fetchUser\", change: \"changed\", breaking: true,\n        old: \"function fetchUser(id: string): User\",\n        new: \"function fetchUser(id: string, opts: Opts): User\" },\n      { name: \"fetchUsers\", change: \"added\", breaking: false } ] }\n```\n\n## Why it's new\n\nThe rest of an agent toolkit handles *making* edits safely (checkpoint, apply-patch,\nverify). None of them answer **\"is this change backward-compatible?\"** — agents\nrename a param or drop an export and silently break every consumer. This is the\nmissing refactor-safety check, and a natural semver gate.\n\n## Tools\n\n- **`api_surface(code | path)`** — the public API of a module: every export + a\n  normalized signature. (Great for \"what does this module expose?\")\n- **`api_diff(old, new | old_path, new_path)`** — `{ breaking, breaking_count,\n  summary{added,removed,changed}, changes[] }`. **Removed** and **signature-changed**\n  exports are breaking; **added** exports are compatible.\n\nSignatures are whitespace-normalized, so formatting/reorder noise doesn't show up —\nonly real surface changes do. Private/protected class members are ignored.\n\n## Setup\n\n```bash\nnpm install\nnpm test\n```\n\n```bash\nclaude mcp add api-diff -- node /abs/path/api-diff/dist/server.js\n# CLI:  agent-apidiff old.ts new.ts          (exit 1 if breaking)\n#       agent-apidiff surface src/api.ts\n# git:  agent-apidiff <(git show HEAD:src/api.ts) src/api.ts\n```\n\n## Honest limits\n\n- **TS/JS surface only** — exported names + their written signatures. It does not\n  resolve types across files or run a full type-checker, so an unannotated `export\n  const x = makeThing()` is compared by name, not inferred type.\n- \"Breaking\" is **structural and conservative**: any removed/changed export is\n  flagged. A widened-but-compatible type change still shows as `changed` — treat it\n  as a prompt to look, not a verdict.\n- Re-exports are tracked by name; it doesn't follow them into other modules.\n","readmeFilename":"README.md","_rev":"1-03982f05a68967e19c43d3e029317744"}