lockfile-guardian

lockfile-guardian

Audits your package-lock.json for supply-chain attacks before install. Cross-checks every resolved entry against the live npm registry to detect integrity mismatches, new install scripts, and other malicious signals.

Category
Visit Server

README

lockfile-guardian πŸ”’

npm license MCP

Audit your package-lock.json for supply-chain attacks BEFORE you run npm install.

npx -y lockfile-guardian-mcp   # MCP server, ready for Claude / Cursor / any agent

Your lockfile is the artifact npm install actually executes β€” the fully resolved dependency tree, with integrity hashes and install-script flags. lockfile-guardian cross-checks every resolved entry against the live npm registry and tells you what is about to run on your machine.

It completes the guardian trio β€” each one audits a different layer:

  • import-guardian β€” catches hallucinated imports in AI-generated code (a name the model invented).
  • npm-guardian β€” audits a chosen package for CVEs and malicious behaviour.
  • license-guardian β€” audits the licenses of your dependencies (AGPL/BUSL traps) before you ship.
  • lockfile-guardian (this) β€” audits the resolved tree in your package-lock.json.

What it catches

πŸ”΄ Integrity mismatch the lockfile's sha512 doesn't match what npm serves for that exact version β€” the resolved tarball was swapped under you (lockfile poisoning). BLOCK.
πŸ”΄ Not on registry the lockfile points at a package/version that doesn't exist or was unpublished. BLOCK.
🟠 New install script a newly-introduced dependency that runs preinstall/install/postinstall β€” a first-seen dep with an install script is the Axios / plain-crypto-js attack signal. REVIEW.
🟠 Hidden gyp build native build via binding.gyp / node-gyp, which executes code on install and dodges plain postinstall monitoring. REVIEW.
🟠 Fresh + executing a version published in the last 30 days that runs an install script β€” disproportionately used in supply-chain attacks. REVIEW.

Verdicts: 🟒 CLEAN Β· 🟠 REVIEW Β· πŸ”΄ BLOCK.

PR-diff mode (the differentiator)

Pass the previous lockfile too and lockfile-guardian audits only what the change introduces. A first-seen dependency that runs an install script is the single highest-signal supply-chain tell β€” this surfaces it in one call, exactly where a code-review or CI gate needs it.

It runs read-only: it parses the lockfile and reads npm registry metadata. It never installs or executes anything.

Use it as an MCP server (free)

Any MCP-compatible agent (Claude Desktop, Claude Code, Cursor, …) can call it.

{
  "mcpServers": {
    "lockfile-guardian": { "command": "npx", "args": ["-y", "lockfile-guardian-mcp"] }
  }
}

Tools:

  • audit_lockfile β€” give it a package-lock.json (and optionally the previous one); get a CLEAN / REVIEW / BLOCK verdict per package.
  • check_install_scripts β€” for an explicit list of packages, report which run install / native-build scripts (live registry manifest).
  • verify_integrity β€” verify one pinned package: integrity match, install scripts, version age.

Free HTTP API

POST /audit    { "lockfile": "{…package-lock.json…}", "previous_lockfile": "{…}" }
POST /scripts  { "names": ["sharp@0.33.0","esbuild","node-sass"] }
GET  /verify?name=lodash&version=4.17.21&integrity=sha512-...
POST /mcp                                              # MCP-over-HTTP

Hosted at https://lockfile-guardian.vercel.app Β· try /verify?name=esbuild&version=0.21.5 (runs a postinstall) vs /verify?name=lodash&version=4.17.21 (clean).

Pay-per-call (x402)

The /pro/* routes are gated by x402. Your agent pays $0.02 USDC per call automatically β€” no sign-up, no API key. Settles on-chain to the operator wallet (Base). The server holds no private key.

POST /pro/audit   { "lockfile": "...", "previous_lockfile": "..." }   # 402 β†’ pay β†’ result

How the moat works

A coding agent reading the lockfile alone cannot know:

  • whether the recorded sha512 still matches what npm serves for that version (an integrity mismatch is invisible without the live registry),
  • whether a pinned version actually declares install/native-build scripts in its published manifest (the lockfile's hasInstallScript can be absent or stale),
  • how old that exact version is.

lockfile-guardian fetches the live per-version manifest and integrity from the registry and applies a curated set of 2026 supply-chain rules. That's data + rules the model can't fabricate.


MIT Β· Part of the guardian trio. Issues and PRs welcome.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured