mcp

package
v1.12.21 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMaliciousPackageScanningPackageNotFound = errors.New("no known malicious package scanning report found")
	ErrPackageVersionInsightNotFound           = errors.New("no known package version insight found")
	ErrInvalidParameters                       = errors.New("invalid parameters")
)

Functions

func NewDefaultDriver

func NewDefaultDriver(insightsClient insightsv2grpc.InsightServiceClient,
	malysisClient malysisv1grpc.MalwareAnalysisServiceClient,
	gh *adapters.GithubClient,
) (*defaultDriver, error)

NewDefaultDriver creates a new default driver with the given clients Always follow dependency inversion principle when extending the driver

Types

type Driver

type Driver interface {
	// Return all available versions for a package
	GetPackageAvailableVersions(ctx context.Context, p *packagev1.Package) ([]*packagev1.PackageVersion, error)

	// Return the latest version for a package
	GetPackageLatestVersion(ctx context.Context, p *packagev1.Package) (*packagev1.PackageVersion, error)

	// Return a malware analysis report for a package version
	GetPackageVersionMalwareReport(ctx context.Context, pv *packagev1.PackageVersion) (*malysisv1pb.Report, error)

	// Return vulnerabilities for a package version
	GetPackageVersionVulnerabilities(ctx context.Context, pv *packagev1.PackageVersion) ([]*vulnerabilityv1.Vulnerability, error)

	// Return popularity insights for a package version
	GetPackageVersionPopularity(ctx context.Context, pv *packagev1.PackageVersion) ([]*packagev1.ProjectInsight, error)

	// Return license information for a package version
	GetPackageVersionLicenseInfo(ctx context.Context, pv *packagev1.PackageVersion) (*packagev1.LicenseMetaList, error)
}

Driver is the contract for all the services available in this system. Tools use driver to actually perform operations. The purpose of using a Driver instead of using services directly in tools is to allow for caching and other stateful operations while keeping tools stateless

type DriverConfig

type DriverConfig struct{}

func DefaultDriverConfig

func DefaultDriverConfig() DriverConfig

type McpTool

type McpTool interface {
	// Function that should be implemented by the tools to register itself
	// with the MCP server.
	Register(server *server.MCPServer) error
}

Contract for implementing an MCP tool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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