Documentation
¶
Overview ¶
Package badge renders the "mcpcheck" status badge a project can put in its README to show that its MCP server passed mcp-tester.
The SVG is self-contained, so the badge works from a plain repository file without any badge service. The JSON variant follows the shields.io endpoint schema for projects that prefer img.shields.io/endpoint.
Index ¶
Constants ¶
const ( Green = "#4c1" Yellow = "#dfb317" Red = "#e05d44" )
Colours as shields.io uses them.
const Label = "mcpcheck"
Label is the left-hand text of every badge.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Endpoint ¶
type Endpoint struct {
SchemaVersion int `json:"schemaVersion"`
Label string `json:"label"`
Message string `json:"message"`
Color string `json:"color"`
IsError bool `json:"isError,omitempty"`
Revision string `json:"revision,omitempty"`
Latest string `json:"latestRevision,omitempty"`
Score int `json:"score"`
Errors int `json:"errors"`
Tester string `json:"tester"`
Checked string `json:"checked"`
}
Endpoint is the shields.io endpoint schema (https://shields.io/badges/endpoint-badge), extended by fields shields.io ignores but a reader of the file can check.
type Result ¶
type Result struct {
// Revision is the protocol revision the server negotiated.
Revision string
// Latest is the newest revision mcp-tester checks against.
Latest string
Score int
// Errors counts protocol errors: MUST violations that break clients.
Errors int
// HideScore leaves the score off the badge, for projects that do not
// want to show a number that rests on mcp-tester's own judgement.
HideScore bool
Tester string
Checked time.Time
}
Result is what an inspection contributes to the badge.
func (Result) Color ¶
Color is red for protocol errors — they outweigh any score — yellow for a low score or an outdated revision, green otherwise.