Sponsored by Deepsite.site

Npmguard

Created By
AyoubTadlaouia month ago
Pre-install risk gate for npm packages. Stops AI coding agents from running malicious or typosquatted packages before lifecycle scripts run.
Overview

What it does

A native pre-install risk gate for npm packages, with an MCP tool for AI coding agents.

Pulls npm registry + OSV.dev (incl. MAL-* malware namespace) + GitHub repo signals in parallel, computes a composite risk score, and returns an ok / warn / block verdict before lifecycle scripts can execute.

Single static Rust binary, distributed via GitHub Releases — not via npm — so the gate itself cannot be compromised by the npm supply chain it's protecting against.

Live verdict against the npm registry

npmguard install lodahs (a real typosquat of lodash, flagged in OSV's malware namespace):

npmguard lodahs@0.0.1-security → score 115 / 200 (block) 10 pts SoleMaintainer single maintainer: adam_baldwin 25 pts Typosquat name 'lodahs' is 1 edit away from popular package 'lodash' 80 pts KnownCve 1 CONFIRMED MALICIOUS by OSV for this version: MAL-2025-25502 blocked: refusing to install lodahs (score 115 ≥ block threshold 70)

MCP integration

Add to your MCP host (Claude Code shown, also works with Cursor / Windsurf):

{
  "mcpServers": {
    "npmguard": {
      "command": "/usr/local/bin/npmguard-mcp"
    }
  }
}

Exposes one tool: install_package(name, version?) → returns { level, score, signals, recommendation }. When an AI coding agent calls it, the
recommendation is fed back as a tool response — so even if the user said "just install whatever," the model has structured signal to stop and ask.

8 risk signals

- LifecycleScripts (30 pts) — package defines preinstall/install/postinstall
- PackageAge (25/10 pts) — version published < 7 / 30 days ago
- MaintainerChurn (20 pts) — dormant package resurrection
- SoleMaintainer (10 pts) — single-point-of-compromise
- RepoHealth (15/10 pts) — archived / no commits in 6 months
- Typosquat (25 pts) — one Damerau-Levenshtein edit from a popular name
- KnownCve (80/50/20/10/5 pts) — OSV.dev advisory, with MAL-* malware-namespace escalation
- Deprecated (10 pts) — npm registry marks the version deprecated

Honest about scope (v0.1.2)

- ✅ Pre-install risk scoring + MCP verdict gate
- ❌ Not yet a real npm install wrapper (v0.2)
- ❌ Not yet sandboxing lifecycle scripts (v0.2)
- ❌ Not yet verifying npm provenance (v0.3)
- ❌ Doesn't replace npm audit, Snyk, Socket, Dependabot — it's an additional layer

Full roadmap: ROADMAP.md

Install

Prebuilt binaries for macOS (x86_64 + arm64), Linux (x86_64 + arm64), Windows (x86_64) — every release ships SHA256SUMS.txt:

github.com/AyoubTadlaoui/npmguard/releases/latest

Source

MIT licensed: github.com/AyoubTadlaoui/npmguard

Server Config

{
  "mcpServers": {
    "npmguard": {
      "command": "/usr/local/bin/npmguard-mcp"
    }
  }
}
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Tavily Mcp
CursorThe AI Code Editor
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
ChatWiseThe second fastest AI chatbot™
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Amap Maps高德地图官方 MCP Server
Serper MCP ServerA Serper MCP Server
WindsurfThe new purpose-built IDE to harness magic
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
DeepChatYour AI Partner on Desktop
Playwright McpPlaywright MCP server
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
RedisA Model Context Protocol server that provides access to Redis databases. This server enables LLMs to interact with Redis key-value stores through a set of standardized tools.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。