@reaatech/mcp-contract-cli
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-cliFeature 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 --strictProgrammatic 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 pointparseArgs(args)— argument parserprintHelp()— help text
Re-exports
The CLI package re-exports from all sibling packages for convenience.
Related Packages
@reaatech/mcp-contract-core— Core domain types, JSON-RPC 2.0 schemas, and utilities@reaatech/mcp-contract-client— MCP client SDK for connecting to MCP servers@reaatech/mcp-contract-validators— Conformance validators@reaatech/mcp-contract-reporters— Report formatters@reaatech/mcp-contract-observability— Structured logging, metrics, and tracing
License
MIT
