KMCP is a toolkit and CLI for scaffolding, testing, and deploying MCP servers in Kubernetes, providing boilerplates, local inspection, CRD lifecycle and secret management.
Hello and welcome — this lesson explains the Kubernetes Model Context Protocol (KMCP) and how it accelerates building, testing, and running MCP (Model Context Protocol) servers in cloud-native environments like Kubernetes.Before we dive into KMCP, it’s helpful to understand the underlying protocol: MCP. MCP is an open protocol from Anthropic that standardizes how large language model (LLM) applications connect to external data sources and tools. Without a standard like MCP, each LLM integration becomes a bespoke adapter, adding development and maintenance burden.
MCP acts as a universal adapter for LLMs. An MCP server exposes tools and data sources in a standard way so any LLM application that speaks MCP can discover and use them without bespoke integrations. See the MCP project for protocol details: https://github.com/anthropic/mcp
This standardization significantly speeds up, simplifies, and harmonizes integrations across tools and data sources.
Accelerates local development of MCP servers with templates and boilerplates.
Provides CLI tooling to scaffold, test, and deploy MCP servers.
Manages MCP server lifecycle and secret handling in Kubernetes using CRDs and best practices.
In short: KMCP helps you bootstrap MCP projects, develop tools quickly, test locally (with an inspector/UI), and deploy/manage them as Kubernetes-native resources.
Key KMCP capabilities:
Project scaffolding and framework-specific templates (FastMCP for Python, MCP Go).
Tool boilerplates to expose internal APIs or services to LLMs.
Local development experience: build, run, and use the MCP Inspector to exercise tools.
Kubernetes lifecycle management: deploy, update, delete, health checks, and secret management.
Support for multiple transports (stdio, HTTP) and authorization integration (e.g., Keycloak).
FastMCP Python Projectmy-mcp-server/├─ src/│ ├─ core/│ ├─ tools/│ └─ main.py├─ tests/├─ Dockerfile├─ kmcp.yaml├─ pyproject.toml├─ .env.example└─ README.md# Core MCP server logic and utilities# Your MCP tool implementations# Entry point that starts the MCP server# Built-in test suite for tools# Used to containerize for Kubernetes# KMCP config defining how server runs# Python dependencies and project settings# Sample environment variables# Project documentation
MCP Go project layout:
my-mcp-server/├─ main.go # Entry point for the MCP server├─ go.mod # Go module configuration├─ go.sum # Dependency integrity file├─ tools/ # Tool implementations│ ├─ all_tools.go # Registers all tools with the server│ ├─ echo.go # Example tool│ └─ tool.go # Template for creating new tools├─ Dockerfile # Container image definition├─ kmcp.yaml # KMCP project configuration└─ README.md # Project documentation
kmcp add-tool — Add a new tool boilerplate to the project.
kmcp run — Run the MCP server locally for testing.
kmcp deploy — Deploy the MCP server to Kubernetes.
Boilerplate code and example tools follow recommended patterns.
Containerization: Dockerfile included in scaffold.
Project configuration: kmcp.yaml includes environment variables, transport settings, and metadata.
# Common kmcp commandskmcp init # Initialize new MCP projectkmcp add-tool # Add new tool boilerplatekmcp run # Run locally for testingkmcp deploy # Deploy to Kubernetes
KMCP integrates with Kubernetes using Custom Resource Definitions (CRDs) to represent MCP server resources. It supports multiple transport types:
stdio transport (process-based)
HTTP transport (configure port, target port, path-based routing)
For HTTP transports you can configure HTTP path, service port, and authorization rules. KMCP supports authorization integrations, including an MCP authorization server and providers like Keycloak.
When deploying to Kubernetes, secure your secrets and authorization settings. KMCP manages secret injection, but you should review RBAC, network policies, and authorization providers (for example, Keycloak) to ensure least-privilege access to sensitive tools and data.