ai

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthenticateResult

type AuthenticateResult struct {
	Success   bool   `json:"success"`
	Message   string `json:"message"`
	Workspace string `json:"workspace,omitempty"`
	Tenant    string `json:"tenant,omitempty"`
	Error     string `json:"error,omitempty"`
}

AuthenticateResult contains the result of an authentication operation.

type Config

type Config struct {
	ConsoleURL  string `yaml:"console_url"`
	PlatformURL string `yaml:"platform_url"`
	Verbose     bool   `yaml:"verbose"`
}

Config holds the MCP server configuration.

func LoadConfig

func LoadConfig() (*Config, error)

LoadConfig loads configuration from environment variables with defaults.

func LoadConfigFromFile

func LoadConfigFromFile(path string) (*Config, error)

LoadConfigFromFile loads configuration from a YAML file. If the file doesn't exist, returns default configuration without error.

func LoadConfigWithFile

func LoadConfigWithFile(path string) (*Config, error)

LoadConfigWithFile loads configuration from a file, then overlays environment variables. Environment variables take precedence over file values.

func NewConfig

func NewConfig() *Config

NewConfig returns a Config with default values.

type GetPackagesWithLifecycleArgs

type GetPackagesWithLifecycleArgs struct {
	IsEOL            *bool  `json:"is_eol,omitempty" mcp:"Filter by end-of-life status."`
	IsDeprecated     *bool  `json:"is_deprecated,omitempty" mcp:"Filter by deprecation status."`
	HasLifecycleRisk *bool  `json:"has_lifecycle_risk,omitempty" mcp:"Returns packages that are deprecated, EOL, or have upcoming EOL date."`
	DaysUntilEOLMax  *int   `json:"days_until_eol_max,omitempty" mcp:"Maximum days until EOL."`
	DaysUntilEOLMin  *int   `json:"days_until_eol_min,omitempty" mcp:"Minimum days until EOL."`
	Ecosystem        string `json:"ecosystem,omitempty" mcp:"Filter by package ecosystem (npm, pypi, golang, maven, cargo)."`
	SoftwareID       *int   `json:"software_id,omitempty" mcp:"Filter to packages used by this specific software ID."`
	Sort             string `json:"sort,omitempty" mcp:"Sort order (default: impact_desc)."`
	Page             int    `json:"page,omitempty" mcp:"Page number. 0-based (0 = first page). Omit this parameter to get first page. Default: 0."`
	Size             int    `json:"size,omitempty" mcp:"Number of results per page (default 100)."`
}

GetPackagesWithLifecycleArgs defines the input for get_packages_with_lifecycle tool.

type GetSoftwareDetailsArgs

type GetSoftwareDetailsArgs struct {
	SoftwareID int `json:"software_id" mcp:"The ID of the software to retrieve details for."`
}

GetSoftwareDetailsArgs defines the input for get_software_details tool.

type GetSoftwareIDsByRepoArgs

type GetSoftwareIDsByRepoArgs struct {
	RepoPath string `` /* 138-byte string literal not displayed */
}

GetSoftwareIDsByRepoArgs defines the input for get_software_ids_by_repo tool.

type GetSoftwareListArgs

type GetSoftwareListArgs struct {
	Search string `json:"search" mcp:"Search term to filter software by name."`
	Page   int    `json:"page,omitempty" mcp:"Page number. 0-based (0 = first page). Omit this parameter to get first page. Default: 0."`
	Size   int    `json:"size,omitempty" mcp:"Number of results per page (default 20)."`
}

GetSoftwareListArgs defines the input for get_software_list tool.

type GetSoftwareVulnerabilitiesArgs

type GetSoftwareVulnerabilitiesArgs struct {
	SoftwareID int `json:"software_id" mcp:"The ID of the software to retrieve vulnerabilities for."`
	Page       int `` /* 161-byte string literal not displayed */
	Size       int `json:"size,omitempty" mcp:"Number of results per page (default 1000)."`
}

GetSoftwareVulnerabilitiesArgs defines the input for get_software_vulnerabilities tool.

type GetSoftwareVulnerabilityByIDArgs

type GetSoftwareVulnerabilityByIDArgs struct {
	SoftwareID int `json:"software_id" mcp:"The ID of the software."`
	VulnID     int `json:"vuln_id" mcp:"The ID of the vulnerability."`
}

GetSoftwareVulnerabilityByIDArgs defines the input for get_software_vulnerability_by_id tool.

type GetVulnerabilitiesArgs

type GetVulnerabilitiesArgs struct {
	Search      string `json:"search,omitempty" mcp:"Search glob for affected/vulnerable package name."`
	KusariScore string `json:"kusari_score,omitempty" mcp:"Minimum Kusari score to filter on (0-10)."`
	Page        int    `json:"page,omitempty" mcp:"Page number. 0-based (0 = first page). Omit this parameter to get first page. Default: 0."`
	Size        int    `json:"size,omitempty" mcp:"Number of results per page (default 20)."`
}

GetVulnerabilitiesArgs defines the input for get_vulnerabilities tool.

type GetVulnerabilityByIDArgs

type GetVulnerabilityByIDArgs struct {
	ExternalID string `json:"external_id" mcp:"The external vulnerability identifier (CVE, GHSA, GO-, etc.)."`
}

GetVulnerabilityByIDArgs defines the input for get_vulnerability_by_id tool.

type ScanLocalChangesArgs

type ScanLocalChangesArgs struct {
	RepoPath     string `json:"repo_path,omitempty" mcp:"Path to the git repository to scan. Defaults to current directory."`
	BaseRef      string `json:"base_ref,omitempty" mcp:"Base git reference for diff. Defaults to HEAD."`
	OutputFormat string `json:"output_format,omitempty" mcp:"Output format: markdown or sarif. Defaults to sarif."`
}

ScanLocalChangesArgs defines the input for scan_local_changes tool.

type ScanRequest

type ScanRequest struct {
	// ID is the unique request identifier.
	ID string
	// Type is the scan type (diff or full).
	Type ScanType
	// RepoPath is the repository path to scan.
	RepoPath string
	// BaseRef is the base git reference for diff scans.
	BaseRef string
	// OutputFormat is the output format (markdown or sarif).
	OutputFormat string
	// ResultChan is the channel for returning results.
	ResultChan chan ScanResult
}

ScanRequest represents a queued scan request.

type ScanResult

type ScanResult struct {
	// Success indicates whether the scan completed successfully.
	Success bool
	// ConsoleURL is the URL to view results in Kusari console.
	ConsoleURL string
	// Results contains the formatted scan results.
	Results string
	// Error contains the error message if scan failed.
	Error string
	// QueuePosition is the position in queue (0 if processing).
	QueuePosition int
}

ScanResult represents the result of a scan operation.

type ScanToolResult

type ScanToolResult struct {
	Success    bool
	ConsoleURL string
	Results    string
	Error      string
}

ScanToolResult contains the result of a scan operation.

type ScanType

type ScanType string

ScanType represents the type of security scan.

const (
	// ScanTypeDiff scans only uncommitted changes.
	ScanTypeDiff ScanType = "diff"
	// ScanTypeFull performs a comprehensive repository scan.
	ScanTypeFull ScanType = "full"
)

type SearchPackagesArgs

type SearchPackagesArgs struct {
	Name    string `json:"name" mcp:"Package name to search for."`
	Version string `json:"version,omitempty" mcp:"Optional version to filter by."`
}

SearchPackagesArgs defines the input for search_packages tool.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is the MCP server that exposes Kusari Inspector tools.

func NewServer

func NewServer(cfg *Config) (*Server, error)

NewServer creates a new MCP server with the given configuration.

func (*Server) GetRegisteredTools

func (s *Server) GetRegisteredTools() []ToolDefinition

GetRegisteredTools returns all registered tool definitions.

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

Run starts the MCP server using stdio transport.

type SoftwareIDDetail

type SoftwareIDDetail struct {
	SoftwareID   int    `json:"software_id"`
	SoftwareName string `json:"software_name"`
	Version      string `json:"software_version"`
	Forge        string `json:"forge"`
	Org          string `json:"org"`
	Repo         string `json:"repo"`
	SubrepoPath  string `json:"subrepo_path"`
	Type         string `json:"type"`
}

SoftwareIDDetail represents a single software entry from the API response

type ToolDefinition

type ToolDefinition struct {
	Name        string
	Description string
	InputSchema map[string]interface{}
}

ToolDefinition describes an MCP tool.

Jump to

Keyboard shortcuts

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