Checking Package Risk Before Claude Code or Cursor Installs It
An MCP server the agent can ask, or a hook that runs whether it asks or not.
Yes. Socket runs a remote MCP server that Claude Code or Cursor can call to check a package, and other vendors publish their own. The catch is that an MCP tool only helps when the agent decides to call it. To check every install, use a hook that runs before the command: npx proof-of-commitment hook (Commit, ours) installs one for Claude Code, Cursor and Windsurf that scores the package and blocks it if it is CRITICAL.
MCP server: the agent asks
With an MCP server the model gets a tool such as “check this package”. That is useful when you ask it to choose between two libraries. It does nothing when the agent goes straight to npm install without asking, which is what coding agents usually do.
Hook: the check runs anyway
A hook sits in front of the shell command. Claude Code calls it before running a tool, so the check happens whether or not the model thought of it:
npx proof-of-commitment hook --claude-code
npx proof-of-commitment hook --claude-code --global
npx proof-of-commitment hook --uninstall The hook covers npm, pip and cargo installs. Setup for each editor is on the Claude Code, Cursor and Windsurf pages.
Which to use
Both, if you can. Socket inspects the package code, which Commit does not. Commit’s hook makes sure some check runs on every install. The question to ask any tool here is simple: does it still run when the agent never calls it?
Commit is our tool, so weigh what this page says about it accordingly. The commands and behaviour here were run on November 4, 2026; registry data changes, so re-run them rather than trusting a number on this page.