# mcptest-core

Core engine for the [`mcptest`](https://github.com/soapbucket/mcptest)
CLI. This crate owns the domain model (tests, steps, expectations) and
the matcher library that decides whether an MCP response satisfies an
expectation.

Everything except the upload reporter is transport-free, which lets us
load matchers and the test model from a Python or JavaScript host later
(see ADR-018) without dragging an async runtime through FFI.

## What lives here

| Module | Role |
| ------ | ---- |
| `matchers` | The six built-in matchers from PRD section 4.5 (`exact`, `schema`, `regex`, `contains`, `snapshot`, `llm-judge`) plus the `AssertionResult` type. |
| `protocol` | JSON-RPC MCP client with handshake, request/response correlation, and graceful shutdown. |
| `transport` | Transport contracts for stdio, HTTP, and SSE servers. |
| `runner` | Test execution loop, retries, timeouts, parallelism. |
| `cache` | Cache eligibility rules. |
| `coverage` | Per-tool and per-resource coverage report for `mcptest coverage`. |
| `report` | Canonical run output model and bundled pretty, JSON, and JUnit reporters. |
| `lint` | Tool-description quality lints used by `mcptest doctor --lint-descriptions`. |
| `redaction` | The single redaction policy every reporter, log line, and cassette runs through. |

## Stability

Pre-1.0. The matcher trait and `AssertionResult` shape are the most
externally visible surfaces; both are versioned with the YAML schema at
[mcptest.sh/schema/v1.json](https://mcptest.sh/schema/v1.json).

## See also

- [Top-level README](../../README.md)
- [Workspace layout audit](../../docs/architecture/workspace-layout.md)

Licensed under Apache-2.0. See [LICENSE](../../LICENSE) and [NOTICE](../../NOTICE).
