Documentation
¶
Overview ¶
Package mcptype compares MCP typed contracts and generates typed client packages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CanonicalForm ¶
type CanonicalForm struct {
Canonical json.RawMessage `json:"canonical"`
Digest string `json:"digest"`
}
CanonicalForm is a document with annotations removed and unordered keywords sorted. Both fields are empty for metadata without a contract.
type Change ¶
Change is one way a published contract breaks an expectation. Name is the tool name or resource URI, if any.
func Changes ¶
func Changes(ctx context.Context, expected *mcpcontract.Metadata, published *mcpcontract.Metadata) ([]Change, error)
Changes lists what breaks expected if published is deployed. Empty means compatible.
type GenerateRequest ¶
type GenerateRequest struct {
Target string `json:"target"`
Identity mcpcontract.Identity `json:"identity"`
Requires map[string]mcpcontract.Identity `json:"requires,omitempty"`
Contracts map[string]*mcpcontract.Contract `json:"contracts,omitempty"`
Runtime map[string][]byte `json:"runtime,omitempty"`
// Protocol is inlined into TypeScript declarations unless ProtocolSpecifier imports them.
Protocol string `json:"protocol,omitempty"`
RuntimeSpecifier string `json:"runtime_specifier,omitempty"`
ProtocolSpecifier string `json:"protocol_specifier,omitempty"`
Own string `json:"own,omitempty"`
// Banner is the first-line comment on generated sources, excluding copied Runtime files.
Banner string `json:"banner,omitempty"`
GoModule string `json:"go_module,omitempty"`
}
GenerateRequest asks for one target's typed client package: node, browser, python or go. Runtime files are copied into the package verbatim. Empty optional strings use their defaults; GoModule is required for Go.
type Number ¶
type Number struct {
// contains filtered or unexported fields
}
Number keeps serde_json's three representations apart: 1 and 1.0 are different values.
func (Number) MarshalJSON ¶
MarshalJSON preserves the number representation used for schema comparison.