k8s-traps
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@k8s-trapsaudit these Kubernetes manifests and explain any traps you find"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
k8s-traps
Kubernetes manifest traps that pass the linters and still break production, packaged as a CLI and an MCP server so AI agents can check YAML before it ships.
Generic scanners (Kubescape, kube-linter, Trivy, Checkov) are good at baseline hygiene: resource limits, privileged containers, image tags. Use them. This project covers a different gap: configuration that is valid, lints clean, and fails silently. Each trap here comes from a real incident on a small production K3s cluster.
ID | Trap | Default severity |
T01 | Service-link env vars ( | high |
T02 | ServiceMonitor selects nothing (pod labels instead of Service labels, or an unnamed port) | high |
T03 | Namespace has workloads but no NetworkPolicy | medium |
T04 | ConfigMap/Secret mounted with | low |
T05 | Two hostnames route to the same backend (a dead route serves another app with 200) | medium |
T06 | Replicas only prefer to spread across nodes | medium |
T07 | Secret value written in plain text (the value is never echoed back) | high |
Full explanations, including the incident behind each trap: docs/traps.md.
Scope and limits
Offline and read-only. It parses the YAML you give it and never contacts a cluster.
Judged from the input only. For example, T03 cannot see a NetworkPolicy that lives in another repo. Feed it a whole
helm templaterender when you can.Heuristics. T01's same-name rule and T07's name patterns can raise false positives. Each finding says what it is based on.
Related MCP server: k8s-aiops
CLI
pip install k8s-traps
helm template my-chart | k8s-traps # stdin
k8s-traps manifests/ --fail-on medium # files or directories; exit 1 at/above severity
k8s-traps deploy.yaml --json --trap T01 --trap T02
k8s-traps --listMCP server
The stdio server exposes three read-only tools:
audit_manifests(manifests: list[str], traps?: list[str])list_traps()explain_trap(trap_id)
Claude Code:
claude mcp add k8s-traps -- k8s-traps-mcpGeneric MCP client config:
{ "mcpServers": { "k8s-traps": { "command": "k8s-traps-mcp" } } }Without installing first (this is what the MCP Registry entry runs):
{ "mcpServers": { "k8s-traps": { "command": "uvx", "args": ["k8s-traps", "--mcp"] } } }Development
python -m venv .venv && .venv/bin/pip install -e '.[test]'
.venv/bin/pytest
.venv/bin/python scripts/gen_docs.py # after editing the catalog in traps.pyEvery trap has at least one test that must flag it and one that must stay clean. New traps are welcome; please describe the real failure each one comes from.
한국어 요약
린터는 통과하는데 운영에서 조용히 깨지는 쿠버네티스 매니페스트 함정을 잡는 CLI와 MCP 서버입니다. AI 에이전트가 YAML을 배포하기 전에 이 서버에 물어볼 수 있습니다.
함정 7개는 모두 실제 K3s 클러스터에서 겪은 장애에서 나왔습니다. 목록은 위 표에 있습니다.
리소스 한도나 권한 같은 기본 점검은 Kubescape나 kube-linter 몫입니다. 이 도구는 그 도구들과 같이 쓰도록 만들었습니다.
입력으로 받은 YAML만 오프라인으로 봅니다. 클러스터에는 접속하지 않습니다.
비밀값을 찾아도 그 값은 출력에 절대 싣지 않습니다.
License
MIT
Available Tools
3 toolsaudit_manifestsARead-onlyIdempotent
Check Kubernetes YAML for known production traps.
manifests: one or more YAML strings (multi-document --- is fine; helm template output works).
traps: optional subset of trap ids such as ["T01", "T02"]; default runs all.
Returns findings sorted by severity. Secret values are never echoed back.
| Name | Required | Description | Default |
|---|---|---|---|
| traps | No | ||
| manifests | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint, idempotentHint, and destructiveHint, so the safety profile is covered. The description adds valuable behavioral details: results are sorted by severity, and secret values are never echoed back. These go beyond the annotations and reassure the agent about output handling and security.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is compact and well-organized: a one-line purpose, followed by parameter explanations, then output behavior. Every sentence adds useful information, and the most important scoping detail (trap subset selection) is clearly presented. There is no filler or repetition of schema fields.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a two-parameter read-only tool, the description covers input format, optional filtering, default behavior, output ordering, and a security guarantee. Without an output schema, slightly more detail about the shape of findings could help, but the sibling tools list_traps and explain_trap fill the surrounding context, and nothing essential is missing for correct invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description carries full responsibility for parameter meaning. It clearly explains that manifests is one or more YAML strings and explicitly supports multi-document and helm template formats. It also clarifies that traps is an optional subset of trap IDs, with an example and the default-all behavior. Both parameters are meaningfully enriched.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb and resource: 'Check Kubernetes YAML for known production traps.' This clearly distinguishes the tool from siblings list_traps and explain_trap, which list and explain traps rather than auditing manifests. The function's scope, checking production-relevant pitfalls, is immediately understandable.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives practical usage context: manifests can be multi-document YAML and helm template output works, and traps can be restricted to a subset or left to run all. It does not explicitly state when to prefer this tool over list_traps or explain_trap, but the verb and resource make the intended use clear enough without requiring exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
explain_trapARead-onlyIdempotent
Explain one trap: what goes wrong, the incident it came from, and how to fix it.
| Name | Required | Description | Default |
|---|---|---|---|
| trap_id | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint, idempotentHint, and destructiveHint, so the safety profile is covered. The description adds the expected content areas (problem, incident, fix) but does not disclose failure modes, invalid ID behavior, or any data-source caveats; the description is consistent with the annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is one concise sentence with no filler. It front-loads the action and immediately lists the three key content components, making it easy for an agent to scan and act on.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple, read-only, single-parameter tool, the description covers the essential outcome well. It lacks an explicit mention of how to obtain a valid trap_id or what happens for unknown IDs, but these are minor gaps given the simple scope and helpful sibling names.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema provides only a bare 'trap_id' string with 0% description coverage, so the description carries the burden of explaining the parameter. It implies that trap_id selects one trap but does not specify where valid IDs come from, what format they take, or any relationship to list_traps.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Explain') and a precise resource ('one trap'), and it specifies the content delivered: what goes wrong, the originating incident, and the fix. This clearly distinguishes it from siblings like list_traps, which enumerates traps, and audit_manifests, which concerns manifests.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The phrase 'one trap' makes clear this is a single-item lookup rather than a listing or audit operation, which provides usable context against the sibling tools. However, it does not explicitly state when to prefer this over list_traps or audit_manifests, so the guidance is implied rather than fully articulated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_trapsARead-onlyIdempotent
List every trap this server checks, with id, title and default severity.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so no side-effect warnings are needed. The description adds scoping ('every trap this server checks') and output-field details, which is useful context beyond the annotations; there is no contradiction.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single front-loaded sentence with no filler. The verb, resource scope, and key output fields are all stated immediately and efficiently.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a zero-parameter, read-only list tool with an output schema, the description is complete: it states exactly what is returned and the annotations cover the safety profile. No prerequisites, caveats, or hidden behaviors are missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has zero parameters, so the baseline is 4. The description therefore does not need to explain parameter meaning and instead clarifies what payload fields the caller can expect in the result.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('List') with a clear resource ('every trap this server checks') and the returned fields (id, title, default severity). This distinguishes it from siblings like explain_trap, which would focus on a single trap, and audit_manifests, which targets manifests rather than traps.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The intended use case is clear: call this when you need to enumerate all traps the server checks. It does not explicitly name alternatives or say when not to use it, but the scope is obvious and no exclusions are needed for a parameterless list.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
3 tool updates
v0.1.0- First observed
audit_manifests - First observed
explain_trap - First observed
list_traps
TDQS
Scored across 3 tools
Each tool serves a clearly distinct purpose: list_traps enumerates available checks, audit_manifests executes the checks, and explain_trap provides detailed breakdowns. There is no overlap or ambiguity between them.
All tool names follow a consistent verb_noun pattern (list_traps, audit_manifests, explain_trap). The naming is predictable and immediately conveys the action and target.
With only 3 tools, the server is tightly scoped but each tool is essential: discovery, execution, and explanation. This is an appropriate minimal set for a specialized trap-checking utility.
The domain is well-covered: users can enumerate available traps, run the audit, and understand any trap's rationale and fix. No obvious gaps remain for the server's stated purpose.
Maintenance
Related MCP Connectors
Fail-closed policy guardrails for AI agents running kubectl, terraform, helm, and argocd.
Trust signals for AI agents: an open agent-readiness standard and developer tool guide. Read-only.
Run the GOVENANT trust audit on your own AI agents — read-only, aggregate-only. Detects…
Find your AI agent's likely failure mode, get runtime settings, and clarify ambiguous prompts.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables AI agents to inspect and operate a Kubernetes cluster safely, with read-only mode and namespace allowlist for mutations.102MIT
- AlicenseAqualityAmaintenanceGoverned Kubernetes operations for AI agents with 15 MCP tools, audit logging, policy engine, and safety features.55MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to safely observe and troubleshoot Kubernetes workloads, with limited recovery actions like pod deletion and Helm rollbacks, while preventing dangerous modifications.Apache 2.0
- AlicenseNot gradedqualityCmaintenanceLets AI agents inspect Kubernetes clusters in plain English, exposing read-only tools for pods, deployments, services, events, and logs, with mock and real backend support.MIT