npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@reaatech/mcp-contract-reporters

v0.1.0

Published

Report formatters for MCP contract validation (console, JSON, markdown, HTML)

Downloads

146

Readme

@reaatech/mcp-contract-reporters

npm version npm downloads License: MIT TypeScript

Status: Pre-1.0 — API surface may change before the 1.0 release. Pin your dependency to a minor version for stability.

Report formatters for MCP contract validation — console, JSON, Markdown, and HTML output. Consumes TestReport objects produced by @reaatech/mcp-contract-core and renders them in human- or machine-friendly formats.

Installation

npm install @reaatech/mcp-contract-reporters

The package ships dual CJS/ESM builds with TypeScript declarations included.

Feature Overview

| Format | Function | Use Case | |------------|---------------------------|-------------------------------------| | Console | printConsoleReport | Local CLI / terminal output | | JSON | formatJsonReport | CI/CD pipelines, programmatic use | | Markdown | formatMarkdownReport | GitHub issue comments, README docs | | HTML | generateHtmlReport | Browser dashboard, email reports | | Dispatcher | formatReport | Route to any format by string enum |

All reporters receive a TestReport and return a formatted string (HTML and Markdown reporters also return strings).

Quick Start

import { runTests, TestSuite } from '@reaatech/mcp-contract-core';
import {
  formatReport,
  printConsoleReport,
  formatJsonReport,
  formatMarkdownReport,
  generateHtmlReport,
} from '@reaatech/mcp-contract-reporters';

// Produce a report by running conformance tests
const report = await runTests({
  endpoint: 'http://localhost:8080',
  suites: [TestSuite.PROTOCOL, TestSuite.ROUTING],
  timeout: 30000,
});

// Print a colored console report
printConsoleReport(report);

// Get a machine-readable JSON string
const json = formatJsonReport(report);
await fs.writeFile('report.json', json);

// Get GitHub-flavored Markdown
const md = formatMarkdownReport(report);
await fs.writeFile('report.md', md);

// Generate an interactive HTML dashboard
const html = await generateHtmlReport(report);
await fs.writeFile('report.html', html);

// Or use the dispatcher with a format string
const output = await formatReport(report, 'markdown');

Report Formats

Console

formatConsoleReport(report) and printConsoleReport(report) render a colored terminal report using ANSI escape codes.

  • Green / red / yellow severity indicators
  • Emoji icons per result (🔴 🟡 🟢)
  • Summary block with pass/fail counts
  • Remediation hints printed inline for failing tests
  • printConsoleReport writes directly to process.stdout, formatConsoleReport returns the string

JSON

formatJsonReport(report) produces a pretty-printed JSON string (JSON.stringify with 2-space indent). The output is the raw TestReport object — ideal for downstream tooling, CI parsing, or archival.

Markdown

formatMarkdownReport(report) generates a GitHub-flavored Markdown document:

  • Summary table (endpoint, timestamp, duration, status, counts)
  • Results table with validator name, pass/fail badge, severity, and message
  • Dedicated Failures section with per-failure remediation blocks
  • Footer with link back to the repository

HTML

generateHtmlReport(report) returns a self-contained HTML document with embedded CSS and JavaScript:

  • Summary cards (total, passed, critical, warnings, info)
  • Expandable test rows — click any test to reveal its message and remediation
  • Colour-coded severity badges
  • Print-friendly styles
  • No external dependencies; single async function returning Promise<string>

API Reference

formatReport(report, format)

Dispatch formatter by enum string. Returns Promise<string> (all formats are resolved synchronously except html, but the API is unified under async).

function formatReport(report: TestReport, format: ReportFormat): Promise<string>

formatConsoleReport(report) / printConsoleReport(report)

Colored console output. formatConsoleReport returns the string; printConsoleReport writes it to stdout and returns void.

function formatConsoleReport(report: TestReport): string
function printConsoleReport(report: TestReport): void

formatJsonReport(report)

Pretty-printed JSON — the raw TestReport object serialized with 2-space indentation.

function formatJsonReport(report: TestReport): string

formatMarkdownReport(report)

GitHub-flavored Markdown with summary tables, result tables, and detailed failure breakdowns.

function formatMarkdownReport(report: TestReport): string

generateHtmlReport(report)

Self-contained interactive HTML dashboard. Returns a Promise<string> with the full document.

function generateHtmlReport(report: TestReport): Promise<string>

ReportFormat

String literal union type for use with formatReport.

type ReportFormat = 'console' | 'json' | 'markdown' | 'html'

TestReport (imported from @reaatech/mcp-contract-core)

The input type shared by all reporters:

interface TestReport {
  id: string
  endpoint: string
  startedAt: string
  completedAt: string
  durationMs: number
  timestamp: string
  results: TestResult[]
  summary: { total: number; passed: number; failed: number; warnings: number; critical: number }
  failures: { critical: number; warning: number; info: number }
  passed: boolean
  error?: string
  version: string
}

interface TestResult {
  validator: string
  category: TestCategory
  passed: boolean
  severity: Severity
  message: string
  remediation?: string
  details?: Record<string, unknown>
  durationMs: number
  timestamp: string
}

Related Packages

| Package | Description | |----------------------------------------------------------------|----------------------------------| | @reaatech/mcp-contract-core | Domain types, enums, interfaces | | @reaatech/mcp-contract-validators | Test validator implementations | | @reaatech/mcp-contract-skills | Skill definitions & contracts | | @reaatech/mcp-contract-cli | CLI entry point |

License

MIT © Rick Somers