# PkgDiet: I built a local MCP Server to stop Cursor from hallucinating and installing deprecated npm packages

**URL:** <https://forum.cursor.com/t/pkgdiet-i-built-a-local-mcp-server-to-stop-cursor-from-hallucinating-and-installing-deprecated-npm-packages/172553>\
**Category:** Built for Cursor\
**Tags:** mcp, javascript\
**Created:** [September 21, 2026, 8:24pm UTC](https://forum.cursor.com/t/pkgdiet-i-built-a-local-mcp-server-to-stop-cursor-from-hallucinating-and-installing-deprecated-npm-packages/172553 "2026-09-21T20:24:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![om-tajne](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/om-tajne/32/121701_2.png) [@om-tajne](https://forum.cursor.com/u/om-tajne)\
**Post date:** [September 21, 2026, 8:24pm UTC](https://forum.cursor.com/t/pkgdiet-i-built-a-local-mcp-server-to-stop-cursor-from-hallucinating-and-installing-deprecated-npm-packages/172553/1 "2026-09-21T20:24:32Z")

</div>

Hey everyone,

I got tired of Composer/Agents constantly hallucinating bad packages or trying to install deprecated dependencies like `request` or `moment` into my projects, so I built a local guardrail called PkgDiet.

It evaluates every package against a health score, bundle size, and CI cost before Cursor is allowed to install it. If the agent tries to use a deprecated package, PkgDiet blocks it and feeds the agent a modern alternative (e.g., swapping `request` for `undici`).

Since it’s local and runs entirely over stdio via npx, it takes 5 seconds to add to Cursor. Just go to Cursor Settings → Features → MCP and add a new stdio server:

Name: pkgdiet  
Command: npx -y [pkgdiet@2.0.0](mailto:pkgdiet@2.0.0) mcp

It’s completely open source. Would love to hear what you guys think!  
Repo: [GitHub - om-tajne/pkgdiet: Put your node\_modules on a diet — find unused, bloated, and unhealthy npm packages. · GitHub](https://github.com/om-tajne/pkgdiet)
