
BumpGuard
io.github.appcreationsca由 GitHub 账号 appcreationsca 发布v0.2.1更新于 Oct 24, 2026
Reports which of your code's API usages break when you upgrade a dependency (Python, .NET, Java).
概览
本地 MCP 服务器,用静态分析检查升级 Python、.NET 或 Java 依赖时,你的代码中哪些 API 用法会失效。
- 可以做什么
- 检查升级影响:将包的已安装版本或指定来源版本与目标版本对比,只报告你代码中真正受影响的用法,并给出行号和修复提示;也可只列出两个版本之间的破坏性变更,不扫描代码。校验代码:检查代码片段中的导入和 API 调用是否确实存在于已安装的包中,并确认某个包是否已安装、给出最接近的真实名称。查看 API:列出某个包(已安装版本或下载的版本)真实的公开符号与签名,并列出当前可用的语言生态。
- 适用场景
- 适合在升级依赖之前使用,想知道自己代码中哪些行会受影响,而不必通读冗长的变更日志。也适合发现 AI 生成的代码调用了当前安装版本中并不存在的函数或包。
- 运行要求
- 以 PyPI 包(bumpguard-mcp)形式通过 stdio 在本地运行,需要 Python 3.10 或更高版本;应安装到与项目相同的环境中,以便看到已安装的包。.NET 分析需要 PATH 中有 .NET SDK(dotnet);Java 分析不需要 JDK 或 Maven。下载目标 wheel、NuGet 包或 Maven jar 需要网络访问。
安装
在 SourceWeft 中
- 打开 控制台中的 BumpGuard,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
[BumpGuard logo]BumpGuard
Guard your dependency bumps. BumpGuard is a Model Context Protocol (MCP) server that tells your AI coding agent exactly which lines of your code break when you upgrade a dependency — and verifies AI‑written code against the API that is actually installed, so it stops calling functions that don't exist.
It does this by static analysis only. BumpGuard never imports or executes third‑party code; it reads a package's real public API straight from its source.
Docs tell your agent what should exist. BumpGuard tells it what actually exists here.
Why this exists
The #1 frustration developers report with AI coding tools is code that's "almost right, but not quite." A huge slice of that is API drift and hallucination:
- The model writes
pydantic.BaseSettingsoropenai.ChatCompletion.create(...)— perfectly valid two versions ago, gone in the version you have installed. - You bump
pandasfrom 1.5 to 2.2 and discover the breakage one stack trace at a time. - A changelog lists 1,800 breaking changes; you only care about the three your code actually touches.
BumpGuard closes that gap with ground truth from your environment instead of the model's memory.
What it does
A real example — upgrading pydantic 1 → 2 in code that uses BaseSettings:
Out of 2,015 breaking API changes, BumpGuard surfaced the one that affects this code — with the line number and a fix hint.
Tools
Every answer is grounded in evidence (installed version, source location). Because analysis is static, "no findings" means "nothing proven to break," not a guarantee — BumpGuard is explicit about that in its output.
Install
Requires Python 3.10+. The server speaks MCP over stdio.
Install BumpGuard into the same environment as the project you're working on, so it sees the packages you actually have installed.
Configure your MCP client
Claude Desktop / Claude Code (claude_desktop_config.json):
Cursor / Windsurf / VS Code (Copilot) — point your MCP config at the bumpguard-mcp command (or python -m bumpguard.server). Any MCP‑compatible client works.
Then ask your agent things like:
- "Before upgrading pandas to 2.2, check whether my data pipeline breaks."
- "Verify this snippet actually uses the installed OpenAI SDK."
- "List the real methods on
httpx.Client."
How it works
- Extract a package's public API surface by parsing its source with Python's
ast— for the installed version, and for the target version (downloaded as a wheel and unpacked, never installed or executed). - Diff the two surfaces into removed / signature‑changed / added symbols, and classify each as breaking, potentially breaking, or info.
- Scan your code (also via
ast) for usages — resolving import aliases, re‑exports, instance‑method calls, and the keyword/positional arguments each call passes. - Match usages against changes and report a precise, per‑line verdict.
Safety: BumpGuard never imports third‑party code, so there are no import side effects, no hangs from heavy packages, and no arbitrary code execution. Wheel downloads are sandboxed to a temp dir, time‑bounded, and guarded against path traversal / zip bombs.
Multi‑language by design
BumpGuard is built around a pluggable provider interface. The diff engine, breaking‑change classifier, analyzer, reporting, and MCP tools are all language‑neutral; only the surface extraction and usage scanning are ecosystem‑specific.
- ✅ Python (PyPI) — available now.
- ✅ .NET (NuGet) — available now. Reads public API from assembly metadata via reflection-only loading (no code executed); needs the .NET SDK (
dotnet) on PATH. A small helper is built once on first use. - ✅ Java (Maven) — available now. Reads public API directly from compiled
.jarbytecode (constant pool, access flags, descriptors) in pure Python — no JDK or Maven required and no third‑party code is executed. - 🔜 JS/TS (npm) — parse
.d.tsdeclarations.
Adding an ecosystem means implementing one Provider — see docs/ADD_A_PROVIDER.md.
.NET specifics (v1)
- Pass
language: "dotnet". Example: "Before upgrading Azure.AI.OpenAI to 2.1.0, check whether my client code breaks (from_version 1.0.0-beta.17)." - Supported:
check_upgrade,diff_versions,list_symbols,check_import. - Prefer passing
from_version— the "installed" baseline is taken from the NuGet global cache, which isn't your project's pinned version. - Reliable signal: type / method / property removals and additions (e.g. the
OpenAIClient→AzureOpenAIClientrename is caught as a breaking removal with a suggestion). Parameter-level diffs run only for unambiguous single-overload members; overloaded members are tracked by presence (a documented v1 limit). - Fully-qualified references are reported confidently; short names resolved via
usingare reported as lower-confidence "potentially breaking" to avoid false hard-breaks from namespace collisions. verify_snippetis not supported for .NET in v1 (accurate C# hallucination detection needs semantic binding).
Java specifics (v1)
- Pass
language: "java"and identify packages by their Maven coordinategroup:artifact(e.g.com.google.code.gson:gson). Example: "Before upgrading com.google.code.gson:gson to 2.10.1, check whether my code breaks (from_version 2.8.9)." - Supported:
check_upgrade,diff_versions,list_symbols,check_import. - The public API surface is read directly from
.jarbytecode (the jar is a zip of.classfiles; BumpGuard parses the class‑file structure withstruct— reading metadata, never running it). The target jar is fetched from Maven Central (sandboxed, size‑capped, time‑bounded). No JDK/Maven needed. - Prefer passing
from_version— the "installed" baseline is read from your local~/.m2cache, which may not match your project's pinned version. - Reliable signal: type / method / field / constructor removals and additions, and arity changes. Fully-qualified references hard-break; short names resolved via
importare reported as lower-confidence "potentially breaking" to avoid false hard-breaks from namespace collisions. - Documented v1 limits: generics are erased in bytecode descriptors (so generic type-argument changes aren't seen); return-type-only changes and varargs removal are tracked conservatively; overloaded members are tracked by presence (per-overload removal isn't detected); multi-release jars use the highest version overlay. The source usage scanner is a robust heuristic, not a full parser — it can pick up a name's own declaration or
importline as a reference, but these resolve to unqualified names that are capped at "potentially breaking" and can never produce a false hard-break.verify_snippetis not supported for Java in v1 (accurate hallucination detection needs semantic binding).
Known limitations (v1, Python)
BumpGuard is honest about static analysis. It may miss (false negatives) or, rarely, over‑flag (false positives):
- Dynamically generated APIs (
__getattr__modules, plugin registries,boto3‑style clients). BumpGuard detects__getattr__modules and suppresses confident "missing symbol" findings under them. - Members created at runtime that aren't visible in source.
- Compiled (C/Rust) extension internals — the Python‑level surface is still read.
- Deep instance‑flow tracking is limited to direct
x = Class(...)patterns. - Star re‑exports (
from .x import *) are not expanded.
Treat findings as high‑signal guidance, and absence of findings as "not proven unsafe," not a guarantee.
Development
The test suite (42 tests) runs offline using fixture packages — no network required.
Releasing
Releases are automated via GitHub Actions. To cut a release:
- Bump the version in
pyproject.tomlandsrc/bumpguard/__init__.py. - Move the
CHANGELOG.md"Unreleased" notes under a new version heading. - Commit, then tag and push:
The Release workflow runs the tests, builds the wheel + sdist, and publishes to PyPI via Trusted Publishing (OIDC — no stored tokens). The CI workflow runs the test matrix (Linux + Windows, Python 3.10/3.13) on every push and PR.
License
MIT — see LICENSE.
来源:README.md,提交 6209137
工具
0版本历史
1- v0.2.1最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分