jkakh/Kopilot-MCP-test
If you are the rightful owner of Kopilot-MCP-test and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
Kopilot MCP is a remake of a previous project, designed to create an AI Kubernetes agent using the Model Context Protocol (MCP).
Kopilot MCP
A MCP remake š§ of my previous project.
Key Features
- Create an AI Kubernetes agent using MCP.
- Interact with Kubernetes resources using natural language.
- Customize LLM provider to perform "kubectl-like" commands.
- Learn how to use MCP to standardize tool calling.
Tech Stack
Getting Started
Prerequisites
- Python 3.12+
- uv
- A API key from LLM provider (e.g. OpenRouter)
- A Kubernetes cluster. (e.g. kind)
Setup
- Clone this repository.
- Configure
config/dev/example.toml
and rename it toconfig/dev/config.toml
. - Install dependencies.
uv sync
Run
- Run the MCP client. It will automatically start the MCP server.
uv run mcp_client.py
- Then you would see a prompt in the terminal:
Query (Type `exit`, `quit`, `q` to quit):
- Interact with natural language to operate Kubernetes resources. For example:
Query (Type `exit`, `quit`, `q` to quit): Get po in kube-system ns
- You would get the response similar like:
Here are the pods in the `kube-system` namespace:
- coredns-7db6d8ff4d-lz4s8
- coredns-7db6d8ff4d-qbgvc
- etcd-test-control-plane
- kindnet-cnjm6
- kube-apiserver-test-control-plane
- kube-controller-manager-test-control-plane
- kube-proxy-v647r
- kube-scheduler-test-control-plane
- sealed-secrets-controller-67767c668-dz4bj
Project Structure
kopilot-mcp
āāā README.md # Project documentation
āāā config # Configuration
ā āāā config.py
ā āāā dev
ā āāā example.toml
āāā mcp_client.py # MCP client
āāā mcp_server.py # MCP server
āāā mcp_server_factory.py # MCP server factory
āāā pyproject.toml # Python project meta
āāā scheme # scheme (Kubernetes GVR ā” GVK)
ā āāā __init__.py
ā āāā scheme.py
āāā utils # Utilities
ā āāā __init__.py
ā āāā clients.py
ā āāā helpers.py
ā āāā models.py
āāā uv.lock # uv lock file
Workflow
Contributing
- Fork the repository.
- Create your feature branch.
- Submit a pull request.
License
MIT License - See LICENSE file for details.