A Model Context Protocol (MCP) server for Kyverno that provides tools for managing and interacting with Kyverno policies and resources in Kubernetes clusters
The server provides 5 tools with basic naming conventions and descriptions. However, significant quality gaps exist across parameters, schemas, and error handling. Tool names follow verb_noun patterns (list_contexts, switch_context, apply_policies, show_violations) which is good. However, parameter descriptions are sparse or missing detail about constraints, formats, and expected values. Input schemas are present but lack comprehensive type definitions and validation constraints. The apply_policies and show_violations tools have particularly weak parameter documentation. No output schemas are visible in the provided source, preventing assessment of response structure. Error handling is not evident from the code samples. The help tool is oddly positioned as a tool rather than documentation or a prompt. Overall, this reads as a minimally viable tool set without production-grade documentation or error guidance patterns.
Scan the cluster resources for policy violations with provided policies or default policy sets. Use "all" to scan all namespaces. If no namespace is provided i.e. "", the policies will be applied to the default namespace.
Get Kyverno documentation for installation and troubleshooting
List all available Kubernetes contexts
This tool is used when Kyverno is installed in the cluster. It returns all non-passing Kyverno PolicyReport results for a workload.
Switch to a different Kubernetes context. If no context is provided, the default context will be used.
apply_policies tool has vague parameter descriptions lacking format constraints. 'policySets' description does not clarify what 'all' means or how multiple policies should be specified. 'gitBranch' description omits format constraints (branch name pattern, default=main behavior). Parameters lack enum constraints despite finite valid values (pod-security, rbac-best-practices, kubernetes-best-practices, all).
show_violations tool has weak parameter descriptions. 'namespace' param accepts string with default='default' and special value 'all', but the description does not clearly state this is a required/optional toggle pattern. 'namespace_exclude' uses a comma-separated string format that is undocumented, LLM may misunderstand how to format this value.
No output schemas are visible in source code. The provided sample only shows main.go and partial apply_policies.go. Without documented response structures, LLMs cannot predict what fields are returned, breaking tool chaining and composition patterns. This violates the pattern:tool requirement to document output.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | F | 16 | <=2025-11-25 | v2 |
| 2026-03-09 | F | 37 | - | v1 |
Error handling guidance is absent from all tools. No descriptions indicate what errors are possible, how to recover, or whether operations are retryable. For example, switch_context (a WRITE operation) should document failure modes and whether it leaves state consistent on error.
The 'help' tool is mispositioned as an action tool rather than a documentation/prompt resource. It accepts a 'topic' parameter (required) but the description provides no enum of valid topics. LLM must guess whether topics are 'installation', 'troubleshooting', 'kyverno-environment', or something else. This should either become a prompt/resource or have explicit topic enumeration.
switch_context is a WRITE operation but has no confirmation step, dry-run option, or explicit warning in the description. The description states 'will use' without clarifying that this modifies kubeconfig state and affects subsequent operations. This violates pattern:confirmation-request for destructive tools.
Parameter descriptions lack concrete examples and constraints. 'namespace' in show_violations is described as 'default: default, use "all" for all namespaces' but this inline format is poor UX. Proper descriptions should state format, valid values, and defaults separately. E.g., 'Kubernetes namespace name (string, default: default). Use special value "all" to query all namespaces.'