MCP Rigor logo MCP Rigor

MCP Rigor as an MCP server

Expose MCP Rigor itself over the Model Context Protocol so AI agents — Claude Code, Cursor, or any MCP client — can write, validate, and run natural-language acceptance tests for the MCP server they are building. The agent gets a deterministic feedback loop: it writes a .mcpr file, runs it, reads structured pass/fail results, fixes the server, and repeats. No AI interprets the test wording at runtime.

Start it

From your project directory:

mcprigor serve

Or with an explicit root:

mcprigor serve path/to/project

The server speaks MCP over stdio. Typical client configuration:

{
  "mcpServers": {
    "mcprigor": {
      "command": "npx",
      "args": ["mcprigor", "serve", "/absolute/path/to/project"]
    }
  }
}

Tools

ToolPurpose
list_suitesList test files under the root (.mcpr, YAML, JSON).
read_suiteRead one test file.
write_suiteCreate or overwrite one .mcpr file (omit text for a starter template).
validate_suiteCompile without running; returns test names or a diagnostic with line/column and a fix hint.
run_testsRun 1–20 suites, optionally with filter to run matching test names only; returns per-test status, duration, and failure messages. Failing runs set isError.
get_contract_driftCompare a contract lock file against the live server a suite declares. Read-only: classifies added/removed/changed surfaces as breaking or non-breaking, and never updates the lock.
run_parityRun a suite's declared parity targets and compare transports.
get_historyRead recorded run history, filterable by suite or test name.

Results are returned both as JSON text and as structuredContent, and test runs append to .mcprigor/workspace-history.jsonl — the same history the QA workspace shows as trends.

The agent loop

  1. write_suite — the agent drafts acceptance tests in natural language.
  2. validate_suite — deterministic wording check; diagnostics carry exact line and column.
  3. run_tests — starts the server declared by each suite's Server: line, runs the tests, returns structured results.
  4. The agent fixes its MCP server (or the test) and repeats.
  5. get_history — spot regressions across iterations.

Trust model

run_tests and run_parity start whatever command each suite's Server: line declares, with the workspace root as working directory — exactly like running mcprigor test yourself. This is the same trust model as npm test: point the root at a project you trust, because test suites in that project can execute code.

Additional guards:

Limits

The MCP server exposes the create/validate/run loop. Renaming files, deleting files, snapshot acceptance, contract updates (get_contract_drift is read-only), and evidence comparison remain CLI (or workspace) operations by design — an agent should not silently rewrite baselines that exist to catch its own regressions.