These packages give you a CLI tool and programmatic API for testing Model Context Protocol (MCP) servers against the MCP specification. You'd adopt them to validate that an MCP server correctly implements protocol conformance, registry YAML schemas, routing contracts, security posture, and performance baselines before deploying it. The packages are designed as composable layers—core types, a client SDK, validators, reporters, and observability—that you can use individually or together through the CLI, with all validators sharing the same typed test report format.
CLI tool and programmatic API for running conformance tests against MCP servers, covering protocol, registry, routing, security, and performance validators. Exports `runTests`, `validateRegistry`, and `generateReport` functions, plus a `mcp-contract-kit` CLI binary.
A factory function (`createMCPClient`) and class (`MCPHttpClient`) for connecting to Model Context Protocol servers over HTTP, providing tool discovery, tool invocation, JSON-RPC 2.0 request/response, SSE streaming, and automatic retry with configurable backoff.
A pino-based structured logger, in-memory metrics collector, and W3C trace context propagator for MCP contract validation. Exports a logger singleton with automatic PII redaction, a `metrics` object with counters and duration histograms, and `startSpan`/`endSpan`/`withSpan` helpers for creating and propagating trace contexts via W3C traceparent headers.
A set of reporter functions that consume `TestReport` objects from `@reaatech/mcp-contract-core` and render them as colored console output, JSON, GitHub-flavored Markdown, or a self-contained HTML dashboard.
A set of conformance validators for MCP servers that checks protocol compliance (JSON-RPC 2.0), registry configuration, routing contracts, security posture, and performance baselines. Exports validator functions that take a client context and return pass/fail results with diagnostic messages.