Testing & QA

API Contract Tester

Verify API contracts between frontend and backend. Detect schema mismatches, missing fields, and type incompatibilities before they reach production.

Get the CLI Tool

Test API contracts locally as an MCP server, or try it online below.

npx @clinetools/contract-test
Requires Node.js 18+
  • Compares expected schema (TypeScript/OpenAPI) against actual API responses
  • Detects missing fields, extra fields, type mismatches, and null violations
  • Validates nested objects, arrays, enums, and optional fields
  • Generates detailed mismatch reports with fix suggestions
  • Preference conversation on first run — strictness, ignored fields

How to Use It

Three ways to test API contracts — pick the one that fits your workflow.

1

Try Online

Paste an expected schema and actual response below — no install needed.

2

Use via CLI

Run as a local MCP server. On first run it asks about your contract strictness.

npx @clinetools/contract-test
3

Add to Cline / Claude Code

Add to your MCP settings so your agent validates contracts automatically.

"contract-test": { "command": "npx", "args": ["@clinetools/contract-test"] }

MCP Client Configuration

{
  "mcpServers": {
    "contract-test": {
      "command": "npx",
      "args": ["@clinetools/contract-test"]
    }
  }
}
Live Demo

Try It Online

Compare your expected schema against an actual API response.

Contract Comparison

Paste the expected schema and actual response to find mismatches

Try a demo:

Paste schema and response, then click Check Contract to find mismatches.

Results

Why Contract Testing Matters

Frontend-backend mismatches cause invisible bugs that only surface in production.

Silent Failures

When the backend changes a field from string to number, TypeScript won't catch it at runtime. Your frontend renders "undefined" or crashes on .toLowerCase(). Contract tests catch the mismatch before deploy.

API Evolution

APIs evolve: fields get renamed, types change, new fields appear. Without contract tests, you discover breaking changes when users report bugs. Automated contracts catch them in CI.

Team Alignment

Frontend and backend teams agree on a schema. Contract tests verify both sides honor the agreement. No more "but the API docs say..." arguments during production incidents.

CI/CD Safety Net

Run contract tests in your deployment pipeline. If the backend deploys a breaking change, the pipeline catches it before the frontend deploys against the broken API.

Verify Your API Contracts Automatically

Add the Contract Tester to your agent's toolkit and catch schema drift before it breaks your app.

View Plans