Mcp Benchmark Hygiene

io.github.sudo-ai-git由 GitHub 账号 sudo-ai-git 发布v1.0.1更新于 Oct 24, 2026

Detect pytest config-leakage that corrupts agent-benchmark grading. Deterministic, no-LLM.

已验证STDIO仅桌面开发者工具AI 与机器学习

概览

AI 生成的概览

一个本地运行的确定性 MCP 服务器,用于检查 pytest 工作区是否继承了宿主机的覆盖率或中止门禁,从而把通过的代码误判为失败。

可以做什么
检查工作区路径,沿 pytest 配置链(pyproject.toml、pytest.ini、tox.ini、setup.cfg)一直向上查找到文件系统根目录,得出实际生效的 addopts,并返回 CLEAN、CORRUPTED 或 UNKNOWN 结论,损坏时附带修正后的命令。执行轻量布尔检查,报告工作区是否损坏及原因。根据分析结果生成一行可执行的摘要。
适用场景
适用于运行或排查自动化智能体评测框架的场景:这些框架在嵌套于带有自身 pytest 配置的仓库下的目标工作区中调用 pytest,而你怀疑评分失败源于继承的覆盖率或中止门禁,而非代码本身。
运行要求
作为本地 stdio 进程运行,可用 uv 或 pipx 从项目 Git 仓库安装,或用 python3 直接从源码启动。服务器需要官方 mcp Python 包;检测核心本身无依赖。不需要网络访问、账户、密钥或环境变量。
安装前请注意
分析会读取给定工作区路径及其所有上级目录直到文件系统根目录的配置文件,因此会检查工作区之外的文件。它只读取配置,不修改文件也不运行测试;建议的修正命令需由你自行执行。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Mcp Benchmark Hygiene,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

mcp-benchmark-hygiene

mcp-name: io.github.sudo-ai-git/mcp-benchmark-hygiene

Deterministic detection of pytest config-leakage that silently corrupts agent-benchmark / function grading.

No LLM. No network. One question, answered reliably:

If I run python -m pytest <tests> inside this workspace, will it inherit a host coverage/abort gate that mis-scores passing code as failed?


The bug this catches

Automated agent-evaluation harnesses often run python -m pytest <hidden_tests> inside the target's workspace. If that workspace nests under a repo root carrying pytest addopts — e.g.:

toml
[tool.pytest.ini_options]addopts = "--cov=harness --cov-report=term-missing:skip-covered --cov-fail-under=80"

...pytest resolves that host pyproject.toml as its rootdir, inherits the addopts, and fails on the host's own coverage gate (harness collected at 0% → below threshold → non-zero exit). The harness then records functionally PASSING code as FAILED.

This is exactly the bug documented in sudo-ai-git/vulcanbench-findings: VulcanBench's declarative grader mis-scored every functional task as 0.0 for this reason; with -o addopts= neutralizing the leak, the same workspaces passed 10/10.

The fix it hands you

When a workspace is flagged CORRUPTED, the tool returns the corrected command:

bash
python -m pytest -o addopts= <tests>

-o addopts= strips inherited coverage/abort gates. (Or run the grader from outside the repo root.)

Tools

toolpurpose
inspect_workspace(path)full analysis: ini chain, effective addopts, CLEAN/CORRUPTED/UNKNOWN verdict + corrected command
check_addopts(path)thin boolean: corrupted + reasons
summarize(analysis)one-line actionable summary string

Deterministic core (no deps)

The analysis walks the workspace directory up to filesystem root, reading pyproject.toml / pytest.ini / tox.ini / setup.cfg in pytest's first-found order, and extracts addopts. Flags:

  • coverage gates — --cov, --cov-fail-under, --cov-report, --cov-config
  • abort/strict gates — --maxfail, -x, --strict, --strict-markers, --pdb, --ff

Only gates that change exit codes / abort grading are flagged. A harmless addopts is reported CLEAN with the exact string.

Install & run (MCP stdio)

One command (recommended) — installs from the repo, no PyPI token needed:

bash
uv tool install git+https://github.com/sudo-ai-git/mcp-benchmark-hygienemcp-benchmark-hygiene                        # run stdio servermcp-benchmark-hygiene --http --port 8137     # or Streamable HTTP

Or with pipx: pipx install git+https://github.com/sudo-ai-git/mcp-benchmark-hygiene

Direct from source (fallback):

json
{ "mcpServers": {    "benchmark-hygiene": { "command": "python3", "args": ["/abs/path/to/mcp_server.py"] }}}

Requires the official mcp python package (pip install mcp). The deterministic core (inspect_workspace / check_addopts / summarize) imports and runs with zero dependencies — the mcp package is only needed for the stdio server.

Streamable HTTP (remote/Smithery-publishable)

bash
python3 mcp_server.py --http --port 8137   # serves on http://<host>:8137/mcp/

Run with --http to serve over Streamable HTTP (a remote MCP endpoint) instead of stdio. This is the transport smithery mcp publish <url> expects for URL-based publishing — so once a Smithery service token exists, the server deploys as-is.

Example

inspect_workspace(path="/home/runner/vulcanbench/workspace/task-1")→ {    "ok": true,    "workspace": "/home/runner/vulcanbench/workspace/task-1",    "ini_chain": [{"file": "/home/runner/vulcanbench/pyproject.toml",                   "addopts": "--cov=harness ... --cov-fail-under=80"}],    "effective_addopts": "--cov=harness ... --cov-fail-under=80",    "will_corrupt_grading": true,    "verdict": "CORRUPTED",    "fixed_command": ["python3", "-m", "pytest", "-o", "addopts=", "<tests>"],    "reasons": ["coverage gate(s) present: ['--cov', '--cov-fail-under']"]}

Verification

  • python3 test_detector.py — 5/5 core detection checks (root gate, nested inheritance, clean, abort gate, pyproject-no-pytest)
  • python3 test_e2e.py — drives the real MCP stdio transport (initialize → tools/call) and asserts CORRUPTED / CLEAN thread through the wire

Part of a family

This is one of three deterministic, no-LLM agent-trust MCP servers by sudo-ai-git:

Sibling product: mcp-token-saver — token-cost proxy + analyzer for agent conversations (dedupes redundant tokens before they're billed; live-proven 74% cut). Discussion

Also in the family (a free CLI, not an MCP server): harness-audit — deterministic agent-eval / benchmark-grading hygiene audit that catches the same silent config-leakage mis-scoring class. Free lead-magnet; the same verification discipline, zero dependencies, auditable line-by-line.

License & provenance

MIT. Independently derived from the documented VulcanBench #79 finding; no endorsement by or affiliation with morganlinton/VulcanBench implied.

Hire a custom integration

Need this connected to your internal system (auth, logging, security-scan pass, hosted)? Open a custom-build request. MIT reference assets are free to use either way.

来源:README.md,提交 5931318

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.0.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分