Documentation
¶
Index ¶
- Constants
- func GetApplicabilityGroupsHandler(store *ResourceStore) mcp.ToolHandler
- func GetAssessmentRequirementsHandler(store *ResourceStore) mcp.ToolHandler
- func GetTestPolicyHandler(s *Server) mcp.ToolHandler
- func GetValidatePolicyHandler(s *Server) mcp.ToolHandler
- type ResourceStore
- type Server
- type ServerOptions
Constants ¶
const ( // URI schemes URIScheme = "complypack" // Resource types ResourceTypeCatalog = "catalog" ResourceTypeMapping = "mapping" ResourceTypeSchema = "schema" ResourceTypeEvaluator = "evaluator" // MIME types MIMETypeYAML = "application/yaml" MIMETypeJSON = "application/json" MIMETypeJSONSchema = "application/schema+json" MIMETypeCUE = "application/cue" )
Variables ¶
This section is empty.
Functions ¶
func GetApplicabilityGroupsHandler ¶ added in v0.0.6
func GetApplicabilityGroupsHandler(store *ResourceStore) mcp.ToolHandler
GetApplicabilityGroupsHandler returns the handler (for testing).
func GetAssessmentRequirementsHandler ¶
func GetAssessmentRequirementsHandler(store *ResourceStore) mcp.ToolHandler
GetAssessmentRequirementsHandler returns the handler (for testing).
func GetTestPolicyHandler ¶
func GetTestPolicyHandler(s *Server) mcp.ToolHandler
GetTestPolicyHandler exposes handler for testing.
func GetValidatePolicyHandler ¶
func GetValidatePolicyHandler(s *Server) mcp.ToolHandler
GetValidatePolicyHandler exposes handler for testing.
Types ¶
type ResourceStore ¶
type ResourceStore struct {
// contains filtered or unexported fields
}
ResourceStore manages artifacts and schemas for MCP resource and tool handlers.
func NewResourceStore ¶
func NewResourceStore( artifacts map[string]any, resolved map[string]*requirement.ResolvedPolicy, schemas map[string][]byte, cueSchemas map[string]cue.Value, evaluators *evaluator.Registry, ) *ResourceStore
NewResourceStore creates a ResourceStore.
func (*ResourceStore) CUESchema ¶
func (rs *ResourceStore) CUESchema(platform string) (cue.Value, error)
CUESchema returns the compiled CUE schema for a platform. Returns an error if the platform has no CUE schema loaded.
func (*ResourceStore) ListResources ¶
ListResources returns all available catalog and schema resources.
func (*ResourceStore) ReadResource ¶
func (rs *ResourceStore) ReadResource(ctx context.Context, uri string) ([]*mcp.ResourceContents, error)
ReadResource returns the content for a specific resource URI.
type Server ¶
type Server struct {
ResourceStore *ResourceStore
// contains filtered or unexported fields
}
Server wraps the MCP SDK server with ComplyPack-specific state.
func NewServer ¶
func NewServer(ctx context.Context, opts *ServerOptions) (*Server, error)
NewServer creates a ComplyPack MCP server. It loads the config, reads catalogs from local paths, loads platform schemas, validates the platform, and creates the MCP server with resource handlers.
Fails fast if: - Config file cannot be loaded or parsed - Any catalog file cannot be read - Platform is not supported - Duplicate catalog names are detected
type ServerOptions ¶
type ServerOptions struct {
// ConfigPath is the path to complypack.yaml.
// Ignored when Config is set.
ConfigPath string
// Config provides configuration directly, bypassing file loading.
// When set, ConfigPath is ignored.
Config *config.ComplyPackConfig
// OCIStore is the directory for OCI artifact caching.
OCIStore string
// CacheDir is the directory for MCP server caching.
CacheDir string
// EvaluatorRegistry provides available policy evaluators.
// If nil, defaults to evaluator.DefaultRegistry().
EvaluatorRegistry *evaluator.Registry
}
ServerOptions configures ComplyPack MCP server initialization.