Documentation
¶
Index ¶
- func IsSystemCommand(command string) bool
- func SaveManifest(m *Manifest, filePath string) error
- func SerializeManifest(m *Manifest) ([]byte, error)
- func Validate(manifest *Manifest) error
- type BundleInfo
- type CapabilitiesInfo
- type ComplianceInfo
- type ComplianceItem
- type Entrypoint
- type FindingsSummary
- type GeneratorConfig
- type LimitsInfo
- type Manifest
- type PackageInfo
- type PackageRef
- type PermissionsInfo
- type ResourceInfo
- type RuntimeType
- type SecurityMetadata
- type ToolInfo
- type TransportInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsSystemCommand ¶
IsSystemCommand checks if a command refers to a system binary (like node, python) rather than a binary inside the bundle directory.
func SaveManifest ¶
SaveManifest saves a manifest to a file
func SerializeManifest ¶
SerializeManifest serializes a manifest to JSON bytes
Types ¶
type BundleInfo ¶
type BundleInfo struct {
Digest string `json:"digest"` // SHA-256 digest
SizeBytes int64 `json:"size_bytes"` // bundle size
}
BundleInfo contains bundle metadata
type CapabilitiesInfo ¶ added in v0.2.0
type CapabilitiesInfo struct {
Tools []ToolInfo `json:"tools,omitempty"`
Resources []ResourceInfo `json:"resources,omitempty"`
Transport string `json:"transport,omitempty"`
AuthSignals []string `json:"auth_signals,omitempty"`
}
CapabilitiesInfo contains MCP server capabilities
type ComplianceInfo ¶ added in v0.2.0
type ComplianceInfo struct {
TotalControls int `json:"total_controls"`
PassedControls int `json:"passed_controls"`
FailedControls int `json:"failed_controls"`
FailedItems []ComplianceItem `json:"failed_items,omitempty"`
}
ComplianceInfo contains compliance assessment results
type ComplianceItem ¶ added in v0.2.0
type ComplianceItem struct {
ControlID string `json:"control_id"`
Severity string `json:"severity"`
Message string `json:"message"`
}
ComplianceItem represents a single compliance control result
type Entrypoint ¶
type Entrypoint struct {
OS string `json:"os"` // "linux", "darwin", "windows"
Arch string `json:"arch"` // "amd64", "arm64"
Command string `json:"command"` // path to executable or system binary name
Args []string `json:"args,omitempty"`
}
Entrypoint represents an executable entry point
func SelectEntrypoint ¶
func SelectEntrypoint(manifest *Manifest) (*Entrypoint, error)
SelectEntrypoint selects the appropriate entrypoint for the current OS/arch. For hub-format manifests with a single entrypoint, it returns that entrypoint regardless of OS/arch since the hub defines platform in the runtime section.
type FindingsSummary ¶ added in v0.2.0
type FindingsSummary struct {
Total int `json:"total"`
Critical int `json:"critical"`
High int `json:"high"`
Medium int `json:"medium"`
Low int `json:"low"`
}
FindingsSummary contains a summary of security findings
type GeneratorConfig ¶
type GeneratorConfig struct {
// TransportType is either "stdio" or "http" (default: "stdio")
TransportType string
// HTTPPort is required if TransportType is "http"
HTTPPort int
// Description is optional package description
Description string
// Repository is optional repository URL
Repository string
}
GeneratorConfig contains configuration for manifest generation
type LimitsInfo ¶
type LimitsInfo struct {
MaxCPU int `json:"max_cpu"` // millicores
MaxMemory string `json:"max_memory"` // e.g. "512M"
MaxPIDs int `json:"max_pids"`
MaxFDs int `json:"max_fds"`
Timeout string `json:"timeout"` // e.g. "5m"
}
LimitsInfo contains recommended resource limits
type Manifest ¶
type Manifest struct {
SchemaVersion string `json:"schema_version"`
Package PackageInfo `json:"package"`
Bundle BundleInfo `json:"bundle"`
Transport TransportInfo `json:"transport"`
Entrypoints []Entrypoint `json:"entrypoints"`
Permissions PermissionsInfo `json:"permissions_requested"`
Limits LimitsInfo `json:"limits_recommended"`
// HubFormat indicates the manifest was parsed from hub format (no bundle/transport fields)
HubFormat bool `json:"-"`
// SecurityMeta contains security metadata from hub manifests (nil for client-format manifests)
SecurityMeta *SecurityMetadata `json:"-"`
}
Manifest represents the complete MCP manifest structure
func GenerateManifest ¶
func GenerateManifest(sourceDir string, pkg *PackageRef, config *GeneratorConfig) (*Manifest, error)
GenerateManifest generates a manifest from a source directory It auto-detects the runtime, entrypoints, and applies safe defaults
func LoadManifest ¶
LoadManifest loads a manifest from a file
type PackageInfo ¶
type PackageInfo struct {
ID string `json:"id"` // "org/name"
Version string `json:"version"` // semantic version
GitSHA string `json:"git_sha"` // git commit SHA
}
PackageInfo contains package metadata
type PackageRef ¶
PackageRef contains the package reference for manifest generation
type PermissionsInfo ¶
type PermissionsInfo struct {
Network []string `json:"network,omitempty"` // allowlist of domains/IPs
Environment []string `json:"environment,omitempty"` // env var allowlist
Subprocess bool `json:"subprocess"` // allow subprocess creation
FileSystem []string `json:"filesystem,omitempty"` // filesystem paths allowlist
}
PermissionsInfo contains requested permissions
type ResourceInfo ¶ added in v0.2.0
ResourceInfo describes an MCP resource capability
type RuntimeType ¶
type RuntimeType string
RuntimeType represents the detected runtime type
const ( RuntimeNode RuntimeType = "node" RuntimePython RuntimeType = "python" RuntimeGo RuntimeType = "go" RuntimeBinary RuntimeType = "binary" )
type SecurityMetadata ¶ added in v0.2.0
type SecurityMetadata struct {
Score int
SecurityScore int
SupplyChainScore int
MaturityScore int
CertLevel int
Findings *FindingsSummary
Capabilities *CapabilitiesInfo
Compliance *ComplianceInfo
}
SecurityMetadata contains security information extracted from hub manifests
type ToolInfo ¶ added in v0.2.0
type ToolInfo struct {
Name string `json:"name"`
Description string `json:"description"`
RiskLevel string `json:"risk_level"`
}
ToolInfo describes an MCP tool capability
type TransportInfo ¶
type TransportInfo struct {
Type string `json:"type"` // "stdio" or "http"
Port int `json:"port,omitempty"`
}
TransportInfo describes the transport mechanism