Skip to content
reaatech

@reaatech/mcp-contract-cli

npm v0.1.1

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.

@reaatech/mcp-contract-cli

npm version License: MIT CI

Status: Pre-1.0

CLI tool and public API for MCP contract conformance testing. Test MCP servers against protocol, registry, routing, security, and performance validators.

Installation

terminal
npm install -g @reaatech/mcp-contract-cli
# or
pnpm add @reaatech/mcp-contract-cli

Feature Overview

  • Five test suites: protocol, registry, routing, security, performance
  • Multiple output formats: console, JSON, Markdown, HTML
  • Programmatic API for CI/CD integration
  • Registry YAML validation with invariant checks
  • Customizable severity thresholds and retry policies

Quick Start

CLI

terminal
mcp-contract-kit test http://localhost:8080
mcp-contract-kit test http://localhost:8080 --suite protocol --format json --output report.json
mcp-contract-kit validate-yaml ./agents/my-agent.yaml --strict

Programmatic API

typescript
import { runTests, validateRegistry, generateReport } from "@reaatech/mcp-contract-cli";
 
const report = await runTests({ endpoint: "http://localhost:8080" });
const html = await generateReport(report, "html");

API Reference

Runner Functions

  • runTests(options: RunOptions): Promise<TestReport>
  • validateRegistry(options): Promise<TestReport>
  • validateProtocol(options: RunOptions): Promise<TestReport>
  • validateRouting(options: RunOptions): Promise<TestReport>
  • generateReport(report, format): Promise<string>

CLI

  • main(argv?) — CLI entry point
  • parseArgs(args) — argument parser
  • printHelp() — help text

Re-exports

The CLI package re-exports from all sibling packages for convenience.

License

MIT