Universal Test Framework
概览
作者提供的说明(英文原文)
Polyglot MCP test generation with 8-section contract enforcement across Python, TS, Java, Go, C++.
PopNx MCP 的三大支柱
这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。
- 用户评价i暂无评价评价功能将在后续阶段与账户功能一起开放
- 我们的基础检查i2 项中通过 1 项依据公开信息检查;尚未扫描代码
- 使用情况i非常新↓ 18/周 · ★ 0
它能帮你做什么
我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。
- 连接方式: 在你的电脑上运行
- 传输方式: stdio
- 分类: 开发者工具
安装
选择你使用的 AI 应用,然后复制设置。
安装之前
- 基础检查:2 项中通过 1 项
- 在你的电脑上运行,拥有你的用户账户的权限(文件、网络、应用)。
- 注册中心没有列出需要填写的密钥。
你需要
- PyPI已安装 Python 的 uv(用于 uvx 命令)
你用的是哪个应用?
在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。
打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json
{
"mcpServers": {
"universal-test-framework": {
"command": "uvx",
"args": [
"universal-test-framework",
"--transport",
"stdio"
]
}
}
}在终端中运行这条命令
claude mcp add universal-test-framework -- uvx universal-test-framework --transport stdio或者自己复制设置
粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json
{
"mcpServers": {
"universal-test-framework": {
"command": "uvx",
"args": [
"universal-test-framework",
"--transport",
"stdio"
]
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
或者自己复制设置
粘贴到项目中的 .vscode/mcp.json
{
"servers": {
"universal-test-framework": {
"type": "stdio",
"command": "uvx",
"args": [
"universal-test-framework",
"--transport",
"stdio"
]
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。
你的选择通过 Cookie 保存在这台设备上,无需账户。
这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。
它能做什么
它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。
基础检查i
我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月10日
- ✓ 通过
作者与仓库一致
注册名称已通过 GitHub 账户 phoenice-labs 验证,该账户拥有此仓库
- ! 注意
仍在维护
代码最后更新于7个月前,已超过 6 个月
- … 尚未检查
有许可证
我们还没有从 GitHub 读取这个仓库
- – 不适用
端点有响应
它在你的电脑上运行,没有互联网端点
- – 不适用
使用 OAuth 登录
在你的电脑上运行,改用本地设置
- … 尚未检查
工具描述中没有隐藏指令
它在你的电脑上运行;我们只能读取互联网端点的工具列表
与“开发者工具”中的其他服务器比较i
- 星标数多于此分类中其他 5723 个服务器的 0%
- 发布到注册中心的时间比此分类中其他 5723 个服务器的 9% 更新
- 基础检查结果等于或优于此分类中其他 5723 个服务器的 13%
与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。
常见问题
Universal Test Framework 安全吗?
它在 2 项适用的基础检查中通过了 1 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。
它需要哪些密钥或代码?
注册中心没有列出必需的密钥,不过有些服务器会在首次使用时要求你登录。
它在我的电脑上运行还是在云端?
它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。
它还在维护吗?
GitHub 仓库最后更新于7个月前,最新版本(1.0.2)于7个月前进入注册中心。
哪些应用可以使用它?
支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Python (uv)。
有什么可以替代它?
同一分类中有:REA, Netdata, Front-End Checklist
替代选择
同一分类中其他作者的服务器,按星标数排序。
如何看卡片:↓ 每周下载量i★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i
Netdata
Real-time infrastructure monitoring with metrics, logs, alerts, and ML-based anomaly detection.
Front-End Checklist
Review frontend code and live pages against 386 quality-gated web development rules.
作者的 README
打开 README
按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。
Universal Test Framework (UTF)
Contract-driven test enforcement and reporting for LLM-generated code — via MCP, VS Code, Copilot CLI, Claude, Cursor, or Python SDK.
UTF is an MCP server and contract enforcement engine. It does not replace your AI coding assistant — it gives every test your AI writes a mandatory quality gate, a structured audit trail, and a comprehensive compliance report.
Why UTF? (Not Another Test Generator)
AI tools — GitHub Copilot, Claude, Cursor, Gemini — generate tests fast. The problem: fast ≠ trustworthy.
| Without UTF | With UTF |
|---|---|
| Tests exist but nobody knows *why* | Every test is linked to a requirement |
| "Covers everything" — nobody can prove it | Traceability matrix maps REQ → test |
| CI passes; real behavior untested | Gap analysis flags what is NOT covered |
LLM wrote a test that asserts True | Meaningfulness check rejects trivial assertions |
| No history of what was tested | Persistent registry survives session restarts |
| Report shows pass/fail counts only | 8-section per-test detail cards in HTML report |
UTF vs Markdown Instructions / Prompt Files
You may already use markdown files (AGENTS.md, copilot-instructions.md, .cursorrules) to guide your AI. UTF is complementary — not competing:
| Markdown instructions | UTF |
|---|---|
| Describe *how* to write tests | Enforce a contract on *every* test produced |
| Rely on LLM to follow instructions | Block tests that fail the contract at generation time |
| No verification after generation | Score each test 0–1 against 8 measurable criteria |
| No persistent state between sessions | SQLite registry persists all tests and results |
| No compliance report | HTML report with per-test 8-section detail cards |
Use markdown instructions to *shape* how your AI thinks. Use UTF to *verify* and *report on* what it produced.
Key Features
- 13 MCP tools — generate, validate, register, analyze, trace, execute, mutate, report, and query tests
- 6 languages — Python, TypeScript, JavaScript, Java, Go, C++
- 7 test types — unit, integration, API, E2E, contract, performance, security
- 8-section contract — every test must pass all 8 sections or it is blocked (minimum score: 0.85)
- 3-segment test IDs —
TC-{PRJ}-{MODULE}-{NNN}and classicTC-{MODULE}-{NNN}both accepted - Five install modes —
uvx(zero-clone), local clone, Docker, GitHub MCP Registry, pip SDK - VS Code @utf — chat participant with slash commands
- CI/CD ready — GitHub Actions, GitLab CI, pre-commit hooks
- Per-project overrides — YAML rules in
.utf/rules/override global defaults
Quick Start
Setup Method Comparison
| # | Method | How Started | Registry Location | @utf Slash Cmds | Best For |
|---|---|---|---|---|---|
| 1 | uvx (zero-install) | mcp.json + uvx | /.utf/utf.db | ❌ use natural language | Any developer with uv |
| 2 | Local Clone | install-vscode-mcp.ps1 | /.utf/utf.db | ✅ with extension | Contributing / customizing UTF |
| 3 | Docker / HTTP | docker compose up | Named volume or bind mount | ❌ use natural language | Team / remote / CI |
| 4 | GitHub MCP Registry | Auto via client | /.utf/utf.db | ❌ use natural language | Discoverable via MCP marketplace |
| 5 | pip + SDK | Python import | Caller controls cwd | N/A | CI scripts / programmatic |
All methods (1, 2, 4) using stdio transport write the registry to `${workspaceFolder}/.utf/utf.db` — isolated per project and persistent across sessions.
Method 1 — uvx (Zero-Install, Recommended)
Requires uv. No cloning, no venv.
Add to %APPDATA%\Code\User\mcp.json (Windows) or ~/.config/Code/User/mcp.json (macOS/Linux):
{
"servers": { "utf": { "type": "stdio", "command": "uvx", "args": ["--from", "universal-test-framework", "utf-server", "--transport", "stdio"], "cwd": "${workspaceFolder}", "env": { "UTF_PROJECT_DIR": "${workspaceFolder}" } } } }
Registry:
.utf/utf.dbinside${workspaceFolder}— isolated per project, persistent across sessions.
Reload VS Code after editing
mcp.json.
Method 2 — Local Clone (VS Code + Copilot)
git clone https://github.com/phoenice-labs/Universal-Test-Framework
cd Universal-Test-Framework
Register MCP server, install @utf extension, copy global prompts
.\scripts\install-vscode-mcp.ps1
Optionally scaffold a specific project
.\scripts\install-vscode-mcp.ps1 -InitProject -ProjectDir C:\my-project
Reload VS Code → open Copilot Chat → ask naturally: generate e2e tests for my backend.
The install script writes this entry to mcp.json:
{
"utf": { "type": "stdio", "command": " ", "args": ["-m", "mcp_server.server", "--transport", "stdio"], "cwd": "${workspaceFolder}", "env": { "PYTHONPATH": " " } } }
Registry:
${workspaceFolder}/.utf/utf.db— isolated per project.
`@utf` slash commands are available after the VSIX extension is installed.
Method 3 — Docker (Team / Remote)
# Start the UTF server
cd Universal-Test-Framework docker compose -f docker/docker-compose.yml up -d
MCP server available at http://localhost:8765/sse
Connect from VS Code by adding to mcp.json:
{
"servers": { "utf-remote": { "type": "sse", "url": "http://localhost:8765/sse" } } }
Registry: persisted in a named Docker volume (
utf_registry → /app/.utf/utf.db).
For per-project isolation with Docker, use a bind-mount in
docker-compose.yml:
`yaml
volumes:
- /path/to/your/project/.utf:/app/.utf
`
Because Docker uses HTTP/SSE transport (no
${workspaceFolder}templating), passproject_dir
explicitly in tool calls, or set
UTF_PROJECT_DIRin the container environment.
Per-project Docker workflow:
# docker-compose.override.yml
services: utf-server: volumes:
- ./my-project/.utf:/app/.utf environment: UTF_PROJECT_DIR: /app
Method 4 — GitHub MCP Registry
Once published, UTF is discoverable via the MCP marketplace. Clients that support server.json install it automatically. The generated mcp.json entry is equivalent to Method 1 (uvx).
Registry isolation: The MCP registry schema does not support a
cwdfield at the registry level.
UTF resolves project isolation via (in priority order):
1.
project_dirargument passed to each tool call
2.
UTF_PROJECT_DIRenvironment variable
3.
Path.cwd()fallback (server's working directory)
For correct isolation, ensure the MCP client writes
"cwd": "${workspaceFolder}"and
"UTF_PROJECT_DIR": "${workspaceFolder}"in the generated entry (UTF'smcp-gallery.jsondoes this).
Method 5 — pip + Python SDK
pip install universal-test-framework
from mcp_server.tools.generate_tests import generate_tests
from pathlib import Path
result = generate_tests( test_type="unit", source_code=open("src/auth.py").read(), project_dir=str(Path.cwd()), # ← pass explicitly for correct registry isolation ) print(result["suite_code"])
Registry:
/.utf/utf.dbwhenproject_diris passed; falls back toPath.cwd().
MCP Tools Reference
| Tool | Description |
|---|---|
generate_tests | Generate a complete test suite satisfying the 8-section contract |
validate_test_contract | Validate any test (generated or hand-written) against the contract |
analyze_coverage | Identify coverage gaps in an existing test suite |
build_traceability_matrix | Build a requirements → tests traceability matrix |
suggest_test_types | Recommend test types with rationale from source code |
detect_language_framework | Auto-detect programming language and test framework |
import_test_results | Import JUnit XML from any test run into the UTF registry |
query_registry | Query the persistent per-project test registry |
run_tests | Execute test files and return structured CI results |
run_mutation_tests | Run mutation testing and return mutation score |
feedback_status | Get gap analysis, coverage health, and trend report |
generate_report | Generate HTML / JUnit / JSON contract compliance report |
health | Server health check: version, uptime, tool count |
The 8-Section Test Contract
Every test generated by UTF must satisfy all 8 sections. Tests that fail any hard section are blocked — returned in blocked_tests, never silently included.
| # | Section | What It Must Contain | Weight |
|---|---|---|---|
| 1 | test_id | Unique ID: TC-{TYPE}-{NNN} (e.g. TC-US-042) | 10% |
| 2 | why_generated | Rationale tied to a requirement (≥50 chars) | 10% |
| 3 | requirement_mapping | At least one US-, AC-, REQ-, JIRA-, BUG-, or NFR- reference | 15% |
| 4 | how_it_exercises | GIVEN / WHEN / THEN with inputs, mocks, assertions (≥100 chars) | 20% |
| 5 | coverage_contribution | Coverage type + module + estimated % | 15% |
| 6 | expected_outcome | Precise return values, status codes, state changes (≥50 chars) | 15% |
| 7 | gaps_missing | Honest list of what this test does NOT cover (≥40 chars) | 10% |
| 8 | meaningfulness_check | Self-assessment: meaningful / redundant / hallucinated (≥50 chars) | 5% |
Minimum passing score: 0.85. Tests below this threshold are blocked regardless of individual section presence. "none" in gaps or vague rationale like "to test the function" are rejected.
Supported Matrix
| Language | Frameworks | Test Types |
|---|---|---|
| Python | pytest | unit, integration, api, e2e, security, performance |
| TypeScript | Jest, Vitest, Playwright | unit, integration, e2e, api |
| JavaScript | Jest, Vitest | unit, integration |
| Java | JUnit 5 + AssertJ, Maven | unit, integration, api |
| Go | go-test + testify | unit, integration, api |
| C++ | Google Test | unit |
The UTF 3-Phase E2E Workflow
This is the canonical flow for using UTF with any AI CLI (Copilot, Claude, Cursor) or VS Code. Follow the phases in order — skipping Phase 1 registration means the report has no Per-Test Contract Detail cards.
┌─────────────────────────────────────────────────────────────────────────┐
│ PHASE 1 — CONTRACT GENERATION (LLM writes, UTF validates + registers) │ │ │ │ ① generate_tests (scaffold) │ │ ② LLM writes real test methods — each with its own TC-ID and │ │ 8-section comment block (WHY / REQ / HOW / COV / OUT / GAP / MEAN)│ │ ③ validate_test_contract — score must be ≥ 0.85 per test │ │ ④ register_contracts — parse test file, upsert status=generated rows │ │ ⑤ generate_report — verify Per-Test Contract Detail cards appear │ │ │ │ PHASE 2 — EXECUTION (pytest/jest/maven runs, results captured) │ │ │ │ ⑥ pytest --junit-xml=utf-tests/reports/results.xml │ │ ⑦ import_test_results — upsert executed/failed rows