Documentation
¶
Overview ¶
Package mcpsnapshot owns canonical MCP tool manifests and approval snapshots.
Index ¶
- func Build(alias string, target mcpexplore.Server, server *protocol.Implementation, ...) (Snapshot, []Warning, error)
- func CanonicalJSON(value any) ([]byte, error)
- func Fingerprint(value any) (string, error)
- func Path(alias string) (string, error)
- func Save(snapshot Snapshot) error
- type DiffChange
- type Snapshot
- type Warning
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Build ¶
func Build(alias string, target mcpexplore.Server, server *protocol.Implementation, tools []*protocol.Tool, capturedAt time.Time) (Snapshot, []Warning, error)
Build captures a stable tool manifest without retaining any credential values.
func CanonicalJSON ¶
CanonicalJSON encodes a JSON value with lexical object-key order and no HTML escaping.
func Fingerprint ¶
Fingerprint returns the documented sha256:<hex> identity for canonical data.
Types ¶
type DiffChange ¶
type DiffChange struct {
Kind string `json:"kind"`
Tool string `json:"tool,omitempty"`
Paths []string `json:"paths,omitempty"`
Message string `json:"message"`
}
DiffChange is one user-visible approval drift class.
func Diff ¶
func Diff(approved, current Snapshot) ([]DiffChange, error)
Diff compares a current snapshot candidate with its approved predecessor.
type Snapshot ¶
type Snapshot struct {
Version int `json:"version"`
Alias string `json:"alias"`
CapturedAt time.Time `json:"captured_at"`
TargetFingerprint string `json:"target_fingerprint"`
ManifestFingerprint string `json:"manifest_fingerprint"`
Server json.RawMessage `json:"server"`
Tools []json.RawMessage `json:"tools"`
}
Snapshot is the versioned approved description of one named server.
type Warning ¶
type Warning struct {
Code string `json:"code"`
Path string `json:"path"`
Message string `json:"message"`
}
Warning identifies advisory, unmodified untrusted server metadata.
func LintImplementation ¶
func LintImplementation(server *protocol.Implementation, base string) []Warning
LintImplementation examines self-reported server identity without changing it.