A development platform and control plane for the Model Context Protocol (MCP)
kmcp
is a comprehensive toolkit for building, deploying, and managing Model Context Protocol (MCP) servers. It provides a command-line interface (CLI) for local development and a Kubernetes controller for production deployments, enabling a seamless transition from development to production.
kmcp
is composed of three primary components that work together to provide a complete MCP server-management solution:
-
The
kmcp
CLI: The CLI is your primary tool for local development. It allows you to scaffold new MCP projects, manage tools, build container images, and run your MCP server locally for testing and development. -
The Kubernetes Controller: The
kmcp
controller runs in your Kubernetes cluster and manages the lifecycle of your MCP server deployments. It uses a Custom Resource Definition (CRD) to define MCP servers as native Kubernetes objects, allowing you to manage them with familiarkubectl
commands. -
The Transport Adapter: In a Kubernetes environment,
kmcp
deploys your MCP server behind a dedicated Transport Adapter.kmcp
acts as a control plane for this adapter, configuring it to provide features such as external traffic routing for your MCP server with support for multiple transport protocols without requiring any changes to your code.
The kmcp
CLI provides a set of commands to manage the entire lifecycle of your MCP server:
kmcp init
: Scaffolds a new MCP server project. Supported frameworks include FastMCP for Python and the official MCP Go SDK for Go.kmcp add-tool
: Adds a new tool to your project, automatically handling boilerplate and registration.kmcp run
: Runs the MCP server in a local development environment.kmcp build
: Builds a Docker image for your MCP server.kmcp install
: Installs thekmcp
controller and CRDs on a Kubernetes cluster.kmcp deploy
: Deploys your MCP server to a Kubernetes cluster, placing it behind a pre-configured Transport Adapter.kmcp secrets
: Manages secrets for your MCP server deployment in Kubernetes.
The following diagram illustrates the kmcp
workflow, from local development to a production deployment in Kubernetes:
graph TD
subgraph Local Development
A[Developer] -- kmcp init --> B(MCP Project);
B -- kmcp add-tool --> B;
B -- kmcp run --> C{Local MCP Server};
A -- Edits Code --> B;
end
subgraph Production Deployment
B -- kmcp build --> D[Docker Image];
D -- kmcp deploy --> E(Kubernetes Cluster);
end
subgraph Kubernetes Cluster
F[kmcp Controller] -- Manages --> G(MCP Server CRD);
G -- Deploys --> H[Transport Adapter];
H -- Proxies Traffic --> I[MCP Server Pod];
end
A -- Interacts with --> C;
E -- Contains --> F;
E -- Contains --> G;
E -- Contains --> H;
E -- Contains --> I;
The kmcp documentation is available at kagent.dev/docs/kmcp.
We welcome contributions! Please see our Contributing Guide for details.
Thanks to all contributors!
Copyright 2025.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.