k8s-docs-mcp
Provides tools for querying official Kubernetes documentation and canonical YAML manifests: BM25 full-text search over kubernetes.io docs with source URLs, retrieval of verified unaltered manifests for any resource Kind (Deployment, NetworkPolicy, ValidatingAdmissionPolicy, etc.), deterministic API version/deprecation/removal checks, resource listing, and synchronization of docs and examples from the upstream kubernetes/website repository.
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-docs-mcp Get the canonical YAML for a NetworkPolicy and check its API version"
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-docs-mcp ☸️
Official Kubernetes Documentation & Canonical YAML Manifest Assistant for Autonomous AI Agents via the Model Context Protocol (MCP).
k8s-docs-mcp connects your AI coding assistant (Cursor, Claude Desktop, Antigravity, VS Code) directly to the upstream source of truth: github.com/kubernetes/website.
💡 The Problem: LLM "Version Blindness" & Hallucinations
General-purpose Large Language Models regularly fail when generating Kubernetes configurations because their training sets mix documentation across outdated releases:
❌ Deprecated APIs: Emitting
apiVersion: extensions/v1beta1forIngressinstead ofnetworking.k8s.io/v1.❌ Removed Features: Suggesting
PodSecurityPolicy(removed in K8s 1.25) instead of modernPodSecurityStandardsor in-tree CELValidatingAdmissionPolicy.❌ Formatting Corruption: Mangling YAML indentation, missing mandatory spec fields, or hallucinating non-existent controller flags.
k8s-docs-mcp solves this deterministically:
Canonical YAML Manifest Extraction: Extracts exact, verified YAML manifests directly from upstream Kubernetes documentation and examples in < 20 ms, completely bypassing generative LLM mutation.
Current Upstream Documentation: Delivers authoritative explanations with exact links to
https://kubernetes.io/docs/....Continuous Upstream Synchronization: Pulls weekly updates directly from
kubernetes/website(content/en/docsandcontent/en/examples) using sparse git checkouts to stay aligned with current Kubernetes releases.
Related MCP server: Kube MCP
🏛️ The Cloud Native Agent Trifecta
k8s-docs-mcp works as an independent standalone tool or as the authoritative documentation engine paired with syllabus guides and architectural tutors:
flowchart TD
IDE["AI Coding Assistant / Agent\n(Claude Desktop, Cursor, Antigravity)"]
IDE -->|"MCP 1: Syllabus & Learning Paths"| S["study-cybercirujas\n(Official CKA/CKS/CNPE Exam Objectives)"]
IDE -->|"MCP 2: Canonical Docs & Syntax"| K["k8s-docs-mcp\n(Authoritative kubernetes.io Docs & Verified YAMLs)"]
IDE -->|"MCP 3: In-Depth Architecture"| R["rag-tutor\n(Engineering Books & GraphRAG Platform Patterns)"]
style K fill:#326CE5,stroke:#fff,stroke-width:2px,color:#fff🛠️ Available MCP Tools
Tool Name | Parameters | Description |
|
| Performs high-speed BM25 search over official Kubernetes documentation via SQLite FTS5. Returns authoritative excerpts and official |
|
| Retrieves verified, unaltered Kubernetes YAML manifests directly from official examples for any resource Kind ( |
|
| Deterministically verifies API version validity, deprecation status, and removal history using the official Kubernetes OpenAPI registry. |
| None | Lists all Kubernetes API resource Kinds currently indexed with canonical YAML manifests. |
| None | Fetches or updates documentation and examples from |
🚀 Quickstart & MCP Configuration
1. Claude Desktop
Add k8s-docs-mcp to your claude_desktop_config.json:
{
"mcpServers": {
"k8s-docs": {
"command": "uvx",
"args": ["k8s-docs-mcp"]
}
}
}Or for a local development clone:
{
"mcpServers": {
"k8s-docs": {
"command": "uv",
"args": [
"--directory",
"/path/to/k8s-docs-mcp",
"run",
"k8s-docs-mcp"
]
}
}
}2. Cursor IDE
In your project root, add to .cursor/mcp.json:
{
"mcpServers": {
"k8s-docs": {
"command": "uvx",
"args": ["k8s-docs-mcp"]
}
}
}3. Local Development & Testing
# Clone the repository
git clone https://github.com/villadalmine/k8s-docs-mcp.git
cd k8s-docs-mcp
# Install dependencies using uv
uv sync
# Run test suite
uv run pytest tests/
# Execute interactive tool verification
uv run python -c "
from k8s_docs_mcp.server import search_k8s_docs, get_canonical_manifest
print(search_k8s_docs('validating admission policy'))
print('---')
print(get_canonical_manifest('NetworkPolicy'))
"🔄 Automated Upstream Synchronization
k8s-docs-mcp uses a lightweight sparse checkout mechanism:
# Pulls only Markdown documentation and YAML examples (~25 MB instead of a 2 GB full clone)
uv run python -c "from k8s_docs_mcp.server import sync_upstream_docs; print(sync_upstream_docs())"The repository includes a scheduled GitHub Action (.github/workflows/sync-upstream.yml) that runs weekly to verify and update indexed Kubernetes documentation against the latest kubernetes/website main branch.
📜 Intellectual Property & Fair Use
All documentation and manifest examples retrieved from
kubernetes/websiteare licensed by the Kubernetes Authors under Apache License 2.0 and Creative Commons Attribution 4.0 International (CC-BY-4.0).k8s-docs-mcpattributes all excerpts directly to their canonical origin on kubernetes.io.This project software is open-source under the Apache License 2.0. See LICENSE for details.
Available Tools
5 toolscheck_api_versionB
Verifies Kubernetes API version compatibility, deprecations, and removals deterministically via OpenAPI registry.
Args:
kind: The Kubernetes resource Kind (e.g. 'Ingress', 'PodSecurityPolicy', 'CronJob', 'ValidatingAdmissionPolicy').
api_version: Optional apiVersion to test (e.g. 'extensions/v1beta1', 'networking.k8s.io/v1').
Returns:
Authoritative validation report with current stable apiVersion, deprecation notices, and migration advice.
Inputs: kind (required), api_version. Returns: result
get_canonical_manifestA
Retrieves verified, unaltered Kubernetes YAML manifests directly from official kubernetes.io examples.
Bypasses LLM generative alterations to prevent indentation errors, invalid fields, or deprecated apiVersions.
Args:
kind: The Kubernetes resource kind (e.g. 'NetworkPolicy', 'Deployment', 'ValidatingAdmissionPolicy', 'ValidatingWebhookConfiguration').
Returns:
Exact canonical YAML manifests with source file provenance.
Inputs: kind (required). Returns: result
list_supported_resourcesA
Lists all Kubernetes API resource Kinds currently indexed with canonical YAML manifests.
Inputs: no named parameters. Returns: result
search_k8s_docsA
Searches official Kubernetes documentation (kubernetes.io) for concepts, policies, and architectures.
Args:
query: Search keywords or question (e.g., 'network policies ingress rules', 'validating admission webhook cel').
limit: Maximum number of documentation sections to return (default: 3).
Returns:
Authoritative documentation sections with official kubernetes.io URLs.
Inputs: query (required), limit. Returns: result
sync_upstream_docsB
Fetches or updates the latest official documentation and examples from github.com/kubernetes/website.
Preprocesses Hugo shortcodes (resolving {{< codenew >}} into inline YAML) and rebuilds the SQLite FTS5 database.
Inputs: no named parameters. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a clearly distinct role: listing indexed kinds, searching official docs, retrieving canonical manifests, checking API version compatibility, and syncing upstream docs. Overlap is minimal, so an agent can reliably select the right tool.
All tool names use consistent snake_case with a verb-first pattern: list_supported_resources, search_k8s_docs, get_canonical_manifest, check_api_version, sync_upstream_docs. The style is predictable and readable throughout.
Five tools is well-scoped for a Kubernetes documentation and manifest helper. Each tool covers a distinct operation, and none feels redundant or unnecessary.
The surface covers discovery, documentation search, canonical manifest retrieval, API version validation, and upstream syncing. Minor gaps remain, such as validating arbitrary user-supplied YAML or browsing doc sections by category, but core workflows are supported.
Maintenance
Related MCP Connectors
Versioned documentation registry and semantic search for AI tools and coding assistants.
Give your AI assistant access to real Helm chart data. No more hallucinated values.yaml files.
Provide your AI coding tools with token-efficient access to up-to-date technical documentation for…
Query your team's drift, vulnerability, and upgrade data from any AI assistant. OAuth 2.1, 51 tools.
Related MCP Servers
AlicenseAqualityDmaintenanceA version-aware Kubernetes documentation assistant that connects LLMs to trusted, real-time Kubernetes docs to reduce hallucinations and ensure accurate, version-specific responses.250 npm4MIT- AlicenseAqualityDmaintenanceEnables AI assistants to interact with and manage Kubernetes clusters, supporting operations on pods, deployments, services, configmaps, secrets, namespaces, metrics, and events with built-in safety features for destructive actions.97 npm1MIT
- AlicenseAqualityDmaintenanceProvides AI assistants with tools to access Kubernetes enhancement proposals (KEPs), contributor guidelines, and official documentation via the Model Context Protocol.7Apache 2.0
- AlicenseAqualityBmaintenanceEnables AI assistants to search API documentation, retrieve endpoint details, get SDK snippets, and check changelogs from an OpenAPI spec.7506 npm3MIT