跳到正文
Skillpedia
连接器(MCP)48k · #5186

mcp-dependency-drift-audit

它能做什么

这个工具会检查 `.mcp.json` 等配置文件,确保其中引用的软件包(npm/npx)不会在你审核之后悄悄发生变化。它只读取文件而不执行,有助于保持一致性和安全性。

适用场景

  • ✓在批准 AI 配置文件之前。
  • ✓当你需要在代码更新中加入安全检查时。
  • ✓在对 AI 配置进行安全审查期间。

技能链接

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/mcp-dependency-drift-audit/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/mcp-dependency-drift-audit/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“检查这个项目中的 AI 配置,确保我审核之后依赖项不会再发生变化。”

每周 5 个新技能,1 分钟读完。

工作原理

该工具会读取 AI 配置文件并分析其中的软件包引用。它会识别这些引用在未来是否可能指向不同的版本,整个过程不会运行任何 AI 服务器代码。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

MCP Dependency Drift Audit

Overview

Audit Model Context Protocol configuration files for npm/npx package references that can resolve to different code after the configuration was reviewed. The workflow is deliberately static: it reads config text, classifies version selectors, and recommends reproducibility fixes without starting discovered MCP servers.

Dependency mutability is a review-boundary signal, not proof that a package is malicious, vulnerable, or compromised.

When to Use This Skill

  • Before approving .mcp.json, Cursor, VS Code, GitHub Copilot, Claude, or Windsurf MCP configuration.
  • When adding an MCP configuration gate to pull requests or CI.
  • During an AI-agent security review where npm/npx-backed MCP servers are configured.
  • When checking whether a previously reviewed MCP config can silently resolve to newer package code.

How It Works

Step 1: Locate and read MCP configs without executing them

Inspect known project paths such as .mcp.json, .github/mcp.json, .cursor/mcp.json, .vscode/mcp.json, and .windsurf/mcp.json, plus any MCP config explicitly supplied by the user.

Read them as text/JSON only. Never run a discovered command or args value as part of this audit. Stay inside the requested workspace by default; only include user-level/global MCP configuration if the user explicitly asks for machine-wide scope.

Step 2: Use MCP Drift Check when already available

If mcp-drift-check is already installed, use the workspace-scoped mode from the intended repo root:

mcp-drift-check scan-workspace --markdown

For CI evidence:

mcp-drift-check scan-workspace --sarif mcp-drift.sarif --markdown

If the scanner is not installed, explain that the following command fetches the open-source scanner from GitHub and get user approval before running it:

uvx --from git+https://github.com/tomelias10/mcp-drift-check mcp-drift-check scan-workspace --markdown

If the user declines network access or installation, continue with the manual rules below.

Step 3: Apply the manual static rules

For npm/npx-style package selectors:

Selector Classification Reason
package@1.2.3 SAFE Exact package version is reproducible.
bare package or @scope/package HIGH A later resolution can select different package code.
package@latest HIGH The selector is explicitly mutable.
package@^1.2.0, ~1.2.0, >=1.2.0, wildcard MEDIUM Resolution can change within the allowed range.
local path, script, binary, unknown executable REVIEW npm version-drift rules do not establish update behavior.

Treat -y / --yes as context only. It suppresses interactive confirmation but is not a vulnerability by itself.

Step 4: Recommend remediation without inventing versions

For mutable npm/npx references, recommend pinning to an exact version that the team has actually reviewed and then updating that pin deliberately.

Do not guess the version to pin. If registry lookup is needed, explain that it requires network access and ask before querying it.

Pinning improves reproducibility. It does not establish package provenance, vulnerability status, authorization safety, prompt-injection resistance, or runtime isolation.

Step 5: Produce a bounded report

Return:

Config MCP server Package/reference Classification Why Recommended next step

Then state:

  • No MCP servers were executed during the audit.
  • Mutable dependency references are review/reproducibility signals, not breach claims.
  • A clean dependency-drift result is not a complete MCP security assessment.

Examples

Example 1: Audit before approval

User: Audit this repo's MCP config before we approve it. Do not run any MCP servers.

Expected shape:

.mcp.json | browser | @example/browser-mcp@latest | HIGH
Reason: @latest can resolve to different package code later.
Next step: pin the exact version your team reviews and update it deliberately.

No MCP servers were executed.

Example 2: Add a CI gate

For GitHub Actions:

- uses: actions/checkout@v4
- uses: tomelias10/mcp-drift-check@v0

MCP Drift Check can also emit SARIF 2.1.0 for GitHub Code Scanning. The action defaults to workspace-only discovery; machine-wide user-level scanning remains an explicit scan-all choice.

Best Practices

…

常见问题

什么是依赖“漂移”(drift)?

指对某个软件包的引用(比如版本号)随时间发生变化,指向的代码与最初审核和批准的代码不一样。

这个工具会运行任何 AI 代码吗?

不会,它只读取配置文件并分析软件包引用,不会运行任何 AI 服务器。

“固定版本”(pinning)是什么意思?

指为软件包指定一个确切的版本号,而不是使用“latest”这类泛指或版本范围。这样可以确保每次都使用同一个软件包版本。

详情

作者的原始描述

Statically audit MCP configs for mutable npm/npx package references before approval or CI, without executing discovered MCP servers.

repo: sickn33/agentic-awesome-skills

热度

GitHub 星标
48k
排名
#5186
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能