技能潮 SkillTide 提交收录
官方说明7 个来源MCP 服务8 天前
om-tajne/pkgdiet

om-tajne/pkgdiet

AST-based dependency analyzer: flags unused
在 GitHub 查看 ↗直链 · 无中转页
配置模板(请按你的客户端调整)
claude mcp add pkgdiet -- npx -y pkgdiet
这是根据仓库名生成的可粘贴骨架,命令行参数与包名请以该项目 README 为准。
★ 数取值
5 ★ · om-tajne/pkgdiet · 取自该仓库的 GitHub 页面 · (2026-10-16 20:00:20 核对)
来源明细
收录自 punkpeye/awesome-mcp-servers 榜单(我们从中收集的条目之一) · 条目类型:MCP 服务
收录与活跃
收录于 2026-10-09 · 最近见到 2026-10-16 · 共见到 32 次 · 被 7 个来源列出
评分构成
综合分 703 · 5 ★ · 7 个来源 · mcp
常见问题(答案都来自我们的记录)
怎么安装?
我们【没有】从该仓库取到安装命令(我们的 install 覆盖率只有约 4%)。请看它的 README 或 releases 页。
它适合谁 / 用来做什么?
我们把它归在这些标签下: MCP 服务。标签来自条目自身,不是我们强加的分类。
谁维护它、还在更新吗?
仓库 om-tajne/pkgdiet;我们收录于 2026-10-09;最近见到 2026-10-16。这里没有"官方认证"或"质量评级"——我们只记录来源与时间。
第三方质量标记

🥗 PkgDiet

以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →

> **Dependency policy for AI-assisted JavaScript and TypeScript development.**
> *Put your node_modules on a diet.*
**The Problem:** AI coding agents (Claude Code, Codex, Cursor, Windsurf, Cline) propose nonexistent, deprecated, vulnerable, or typosquatted packages. There is no built-in mechanism to stop them from running the install.
**The Solution:** PkgDiet intercepts every npm install / pnpm add / yarn add command your AI agent generates — using native agent hook APIs — and blocks unapproved installs *before* they execute.
---
🔒 Live Proof
Run this to see PkgDiet block real risky AI-generated dependencies in your terminal:
**Example output:**
For machine-readable CI proof:
---
🚀 One-Command Setup
This single command creates:
| File | Purpose |
|---|---|
| .pkgdietrc.json | Repository dependency policy |
| .github/workflows/pkgdiet.yml | GitHub Actions CI gate |
| .cursor/mcp.json | Cursor MCP server |
| .cursor/rules/pkgdiet.mdc | Cursor always-applied enforcement rule |
| .cursorrules | Cursor advisory rule (legacy) |
| .windsurfrules | Windsurf advisory rule |
| cline_mcp_settings.json | Cline MCP server |
| .github/mcp.json | GitHub Copilot MCP |
| CLAUDE.md | Claude Code advisory rule |
| .claude/settings.json | Claude Code PreToolUse hook registration |
| .claude/hooks/pkgdiet-install-guard.sh | Claude Code bash install guard |
| .codex/hooks.json | Codex PreToolUse hook registration |
| .codex/hooks/pkgdiet-install-guard.mjs | Codex Node.js install guard |
---
🛡️ Enforcement by Agent
PkgDiet uses each agent's **native hook API** to block installs — not just advisory rules:
| Agent | Enforcement Mechanism | What it blocks |
|---|---|---|
| **Claude Code** | PreToolUse bash hook (.claude/hooks/) | npm/pnpm/yarn install before execution |
| **Codex (OpenAI)** | PreToolUse Node.js hook (.codex/hooks/) | npm/pnpm/yarn install before execution |
| **Cursor** | MDC alwaysApply rule + MCP check_dependency | Prevents AI from writing install commands |
| **Windsurf** | .windsurfrules + MCP check_dependency | Prevents AI from writing install commands |
| **Cline** | MCP check_dependency | Blocks before install via tool call |
| **GitHub Copilot** | MCP check_dependency | Blocks before install via tool call |
| **CI (GitHub Actions)** | pkgdiet ci gate | Blocks PR merge if any new package fails policy |
> **How PreToolUse hooks work:** When Claude Code or Codex generates a Bash tool call containing npm install, the registered hook script runs first. If PkgDiet returns a non-zero exit code, the agent sees the denial reason and aborts the install — the command never runs.
---
🔄 The 3-Phase Policy Loop
PkgDiet uses a shared core engine (@pkgdiet/core) so all interfaces apply the same evaluation logic.
1. **Repository Policy:** A single .pkgdietrc.json file dictates what is allowed, warned, or blocked for your project.
2. **Agent Hook (Enforce):** Native PreToolUse hooks for Claude Code and Codex intercept install commands before execution. MCP check_dependency instructs other agents before they write the command.
来源
awesome · https://github.com/om-tajne/pkgdiet
按领域浏览
MCP 服务
Traction
5 ★
收录于
昨天

更多MCP 服务

查看MCP 服务全部 5,525 条 →

所属领域与标签

每个标签都能点进去看同类的全部条目。数字是当前库里的真实条数。

浏览全部领域 →

← 返回索引