Help us shape the future of Go! Take the 2026 Go Developer Survey

mcpconf

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package mcpconf reads the results of the official Model Context Protocol conformance suite (github.com/modelcontextprotocol/conformance) and renders them as the project's committed compliance report.

It deliberately does not score anything. The suite is the authority on whether this server conforms; its verdict is per-check pass or fail, gated by a baseline of expected failures and communicated through its own exit code. This package's whole job is to turn that verdict into something a human can read and a workflow can commit, so the evidence is legible without re-running the suite.

It replaced a scorer written in this repository that graded the server's wire objects against vendored schemas and reported 100/100. That number was self-marked. Reintroducing a percentage here — even one derived from the official checks — would recreate exactly the problem the change removed, so counts and statuses are all that is reported.

The package is platform-agnostic (no build tag): it reads JSON files and emits text, so it is unit-testable without a Windows host.

Index

Constants

View Source
const (
	StatusSuccess = "SUCCESS"
	StatusFailure = "FAILURE"
	StatusWarning = "WARNING"
	StatusSkipped = "SKIPPED"
	StatusInfo    = "INFO"
)

Check statuses emitted by the suite, from its ConformanceCheck type.

Variables

View Source
var ErrUnrecognizedResults = errors.New("unrecognized conformance results format")

ErrUnrecognizedResults reports a results file whose shape the suite no longer matches. It is an error rather than an empty result on purpose: zero checks would render as a clean run.

Functions

This section is empty.

Types

type Badge

type Badge struct {
	SchemaVersion int    `json:"schemaVersion"`
	Label         string `json:"label"`
	Message       string `json:"message"`
	Color         string `json:"color"`
}

Badge is a shields.io endpoint payload (schemaVersion 1), committed to the repository so the README can render the latest CI result without a third-party service holding the state.

type Check

type Check struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Status      string `json:"status"`
	// ErrorMessage is present on a failure and is the single most useful field
	// in the file, so it is carried into the report verbatim.
	ErrorMessage string `json:"errorMessage,omitempty"`
	// Source records which spec revision or extension introduced the scenario.
	Source *Source `json:"source,omitempty"`
}

Check is one conformance check as the suite writes it to checks.json.

The fields mirror the suite's own type; unknown fields are ignored so a suite upgrade that adds one cannot break parsing. Only what the report needs is modelled.

The camelCase tags are the suite's wire format, not this project's convention. Renaming them to snake_case would simply stop the file parsing.

func LoadChecks

func LoadChecks(path string) ([]Check, error)

LoadChecks reads a checks.json written by the suite.

The suite writes a bare JSON array. An object wrapping a "checks" array is accepted too, so a future change to the output shape degrades to a clear error rather than a silent empty result.

type Pass

type Pass struct {
	// Name distinguishes the passes — "product" for the manifest this server
	// ships, "fixtures" for the run that adds the suite's named fixtures.
	Name string `json:"name"`
	// Description says, in one line, what this pass proves.
	Description string `json:"description"`
	// SpecVersion is the protocol revision the suite was run at.
	SpecVersion string `json:"spec_version"`
	// HarnessVersion is the exact npm version of the suite. Pinned, because the
	// verdict is only reproducible against a known harness.
	HarnessVersion string `json:"harness_version"`
	// Baseline names the expected-failures file the run was gated against.
	Baseline string  `json:"baseline,omitempty"`
	Checks   []Check `json:"checks"`
}

Pass is one invocation of the suite: a set of checks plus the provenance that makes them evidence rather than an assertion.

func (*Pass) Failures

func (p *Pass) Failures() []Check

Failures returns the failed checks, sorted by id for a stable report.

func (*Pass) Tally

func (p *Pass) Tally() Tally

Tally counts the checks in a pass.

type Report

type Report struct {
	// ServerVersion and Commit tie the result to a specific build.
	ServerVersion string `json:"server_version,omitempty"`
	Commit        string `json:"commit,omitempty"`
	// GeneratedAt is supplied by the caller rather than read from the clock, so
	// the workflow controls it and the report is reproducible.
	GeneratedAt string `json:"generated_at,omitempty"`
	// RunURL links back to the workflow run that produced the checks.
	RunURL string  `json:"run_url,omitempty"`
	Passes []*Pass `json:"passes"`
}

Report is the committed record: every pass, with the provenance of the run.

func (*Report) BadgeFor

func (r *Report) BadgeFor(passName string) Badge

BadgeFor summarises one pass for the README badge.

The figure is the suite's own tally — the share of checks that ran and passed — not a grade this project awards itself. That distinction is why the markdown report still carries no score: a percentage there would invite reading it as an overall verdict, whereas a badge is understood to be a summary and links to the report that qualifies it.

Skipped and informational checks are excluded from the denominator. A scenario the revision does not apply to should not count for or against us, which is the same reason the suite reports it as skipped rather than failed.

Note the denominator still includes checks that are failing *by design* and listed in the baseline — for the product pass, the scenarios needing the suite's fixtures. Excluding those would let the badge read 100% while the baseline grew, which is exactly the kind of self-flattery this whole change removed.

func (*Report) Markdown

func (r *Report) Markdown() string

Markdown renders the committed report.

type Source

type Source struct {
	IntroducedIn string `json:"introducedIn,omitempty"`
	RemovedIn    string `json:"removedIn,omitempty"`
	ExtensionID  string `json:"extensionId,omitempty"`
}

Source is a scenario's applicability window, as the suite records it.

type Tally

type Tally struct {
	Success int `json:"success"`
	Failure int `json:"failure"`
	Warning int `json:"warning"`
	Skipped int `json:"skipped"`
	Info    int `json:"info"`
	Total   int `json:"total"`
}

Tally counts a pass's checks by status.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL