# universal-test-framework [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/phoenice-labs/Universal-Test-Framework  
**GitHub Stars:** 0  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/universal-test-framework

## Description
Polyglot MCP test generation with 8-section contract enforcement across Python, TS, Java, Go, C++.

## Tools
Capabilities this server exposes over MCP:

- **generate_tests** — Generate a complete test suite satisfying the 8-section test contract.

The framework automatically:
- Detects language and framework from source code
- Generates tests for happy path, failure paths, and boundary cases
- Validates every test against the 8-section contract before returning
- Builds a traceability matrix linking tests to requirements
- Identifies coverage gaps and makes recommendations
- **validate_test_contract** — Validate a test or test suite against the 8-section contract.

Use this to check any existing test — generated or hand-written — for compliance.
The contract requires all 8 sections: Test ID, Why Generated, Requirement Mapping,
How it Exercises, Coverage Contribution, Expected Outcome, Gaps, Meaningfulness Check.
- **analyze_coverage** — Analyze the coverage of a test suite and identify gaps.
- **build_traceability_matrix** — Build a requirements-to-tests traceability matrix.
- **suggest_test_types** — Analyze code/requirements and suggest which test types to apply.
- **detect_language_framework** — Detect programming language and test framework from source code.
- **health** — Health check for the Universal Test Framework MCP server.

Returns server status, version, and uptime. Suitable for use as a
Docker HEALTHCHECK command, Kubernetes liveness/readiness probe, or
basic availability verification.
- **query_registry** — Query the UTF persistent test registry.
- **run_tests** — Execute test files and return structured results with CI annotations.

Execution is always optional — controlled by UTF config. Never blocks generation.
- **run_mutation_tests** — Run mutation testing on a source+test file pair and return coverage metrics.

Supports mutmut (Python), Stryker (JS/TS), PIT (Java), and gremlins (Go).
The adapter is auto-detected based on language and tool availability.
- **feedback_status** — Get UTF feedback loop status: gap analysis, coverage health, trend, and delta requirements.
- **import_test_results** — Import JUnit XML execution results into the UTF registry.

Use this when you have already run tests with pytest / Maven / Go and want
to register the results so that generate_report shows real pass/fail rates.
- **generate_report** — Generate the 8-section contract compliance report (Tool #12).

Reads test records and execution results from the registry, builds the
contract report in the requested formats, and returns report paths + summary.
- **register_contracts** — Parse test files and register per-method 8-section contract records.

This is the UTF registration bridge — it reads LLM-written test files,
extracts the per-method 8-section comment blocks, and upserts
status=generated rows into the UTF registry.  Without this step,
generate_report has no Per-Test Contract Detail cards.

IMPORTANT — Phase 1, Step ③ of the UTF 3-phase workflow:
  ① generate_tests (scaffold)
  ② Write real test methods with per-method TC-{PRJ}-{MODULE}-{NNN} blocks
  ③ register_contracts  ← this tool
  ④ generate_report (verify contract detail cards)
  ⑤ pytest --junit-xml=...
  ⑥ import_test_results
  ⑦ generate_report (now shows both contract cards AND execution results)

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "universal-test-framework": {
    "command": "uvx",
    "args": ["--from","universal-test-framework","utf-server"]
  }
}
```

## Documentation

## What universal-test-framework does

The universal-test-framework MCP server applies a contract-based workflow to test generation and review. It supports Python, TypeScript, JavaScript, Java, Go, and C++, along with unit, integration, API, end-to-end, contract, performance, and security test categories.

Generated tests are evaluated against eight sections and must reach a minimum score of 0.85 to pass the contract gate. The server can also inspect hand-written tests, identify missing coverage, recommend suitable test types, and connect requirements to test cases through a traceability matrix.

The project is intended to complement coding assistants rather than replace them. It provides the enforcement and reporting layer after an assistant proposes or writes tests.

## How it works

MCP clients call tools with source code, test files, project information, or result files. Language and framework detection can guide later operations, while generation returns a complete suite designed to satisfy the contract. Validation checks an individual test, and coverage analysis reports areas that existing tests do not address.

Test metadata and execution results are stored in a per-project SQLite registry at `.utf/utf.db` for standard local configurations. The registry supports later queries and feedback reports, including coverage health, gap analysis, and trends. JUnit XML from external test runs can also be imported into the registry.

The server can execute test files and return structured CI results, run mutation testing with a mutation score, and produce HTML, JUnit, or JSON compliance reports. Test identifiers may use either the three-part `TC-{PRJ}-{MODULE}-{NNN}` form or the shorter `TC-{MODULE}-{NNN}` form.

## Setup and configuration

The universal-test-framework MCP server can be installed with `uvx`, from a local clone, through Docker, from the GitHub MCP Registry, or as a Python package. The `uvx` approach starts `utf-server` over stdio without cloning the repository. A local installation includes a VS Code setup script and can install the `@utf` extension.

Docker exposes the server at `http://localhost:8765/sse`. In that mode, project isolation requires an explicit `project_dir` tool argument, a `UTF_PROJECT_DIR` container setting, or a bind mount for the `.utf` directory. Local stdio configurations can use `${workspaceFolder}` as both the working directory and `UTF_PROJECT_DIR` value.

The Python package can be installed with pip and called through its SDK modules. Passing `project_dir` explicitly keeps registry data associated with the intended project; otherwise, the current working directory is used.

## Tools and capabilities

Available MCP operations include:

- Generate complete suites and validate generated or hand-written tests.
- Detect a language and framework, then suggest test types with rationale.
- Analyze coverage gaps and build requirements-to-tests traceability matrices.
- Import JUnit XML, query the persistent registry, and retrieve feedback status.
- Run tests, execute mutation tests, and return structured results or mutation scores.
- Produce HTML, JUnit, and JSON contract-compliance reports.
- Check server version, uptime, and tool count with the health operation.

## Limitations and notes

The contract gate blocks tests below the stated 0.85 minimum score. The registry is project-scoped only when the working directory, `project_dir`, or `UTF_PROJECT_DIR` is configured correctly. Docker does not provide workspace-folder templating, so remote setups need explicit project configuration.

_Full upstream README: https://allmcps.com/mcp/universal-test-framework/readme_

