@knip/mcp
能做什么:在项目里跑 Knip 体检,找出未被引用的文件、依赖与导出,并读其文档解释规则,输出一份可清理清单,并标注可安全删除的项。
什么时候接:清理依赖、删死代码之前,先拿到一份准确清单,避免误删被动态引用的模块,也省去逐个 import 反查。
注意:需在项目根目录运行,会读源码并解析项目配置;动态导入与运行时注入可能误报,删除前务必人工确认,别整体清空依赖。
可用工具
knip-runRun Knip and return configuration hints and issues. Returns: - totalIssues: Total number of issues found (0 = clean) - configurationHints: Ordered suggestions to improve configuration (address these first) - counters: Per-issue-type totalsknip-docsFetch a Knip doc by topic id, or by any docs path. Consult it to resolve a finding, hint, or error instead of guessing. Available topics (use these IDs): - configuration: Understand configuration basics, defaults, and file locations - conf
安装
npx -y @knip/mcp@0.0.36
配置到 Claude / Cursor
{
"mcpServers": {
"knip-mcp": {
"command": "npx",
"args": [
"-y",
"@knip/mcp@0.0.36"
]
}
}
}来源
- 来源:webpro-nl/knip
- 许可:ISC
- npm 周下载:2,564
- 更新日期:2026-10-29
同分类其他 MCP
资料来自官方仓库与 MCP 接口探测,以官方最新文档为准;安装第三方 MCP server 前请自行评估安全风险。