Detect typosquatting in npm package search results
Identification of potential typosquatting packages in search results, flagged by the possibleTyposquatOf field, helping users avoid malicious or low-quality dependencies.
How it works
The agent searches for npm packages using the search_packages tool with a specific query. It examines the results for the possibleTyposquatOf field, which indicates if a package name is a typo of a popular package. The agent flags results with very-low popularity, zero dependents, or stale maintenance tiers that match this pattern. This helps in distinguishing legitimate packages from potential typosquats that might appear in naive text searches.
Prompt
Paste this into an agent that has the servers below connected. Adjust the names and dates to your own.
Search for npm packages related to 'react'. Use the search_packages tool and check for any results that have the possibleTyposquatOf field set. Report any potential typosquatting packages found, including their name and the package they mimic.MCP servers it needs
Source
The vendor page this playbook is drawn from, and the passage that supports it.
possibleTyposquatOf is set when an obscure result's name is one typo away from a top-5,000 package (e.g. "raect" vs "react"); surface that explicitly rather than silently dropping the result.MCP Tools Reference