kruize
MCP Server for Kruize
claude mcp add --transport stdio kruize-kruize-mcp-server java -jar target/kruize-mcp-server-1.0-SNAPSHOT-runner.jar \ --env KRUIZE_URL="URL of Kruize instance (e.g., http://< Kruize-host >/)"
How to use
The Kruize MCP Server provides a set of Model Context Protocol (MCP) endpoints to interact with Kruize recommendations and experiments. It exposes tools such as listAllRecommendations to retrieve all recommendations, getCostOptimizedRecommendations to obtain cost-optimized options for all experiments, listAllExperiments to enumerate experiments, and getIdleWorkloads to fetch idle workloads (with optional cost data). To use these tools, start the MCP server and connect the Inspector client to the MCP endpoint at the /mcp/ path. The Inspector can query these tools to discover, compare, and act on Kruize recommendations within your deployment. Ensure your Kruize instance is reachable from the MCP server and that any required Kruize URL is provided via KRUIZE_URL when running the server in environments where the Kruize host is not on localhost.
How to install
Prerequisites:
- Java (JDK 11+) and Maven (or the Maven wrapper in the repository)
- Git
- Access to a Kruize deployment (for live clustering or local test Kruize instance)
Step-by-step installation:
-
Clone the repository git clone https://github.com/kruize/kruize-mcp-server.git cd kruize-mcp-server
-
Build the MCP server ./mvnw clean install
-
Run the MCP server (from project root)
If Kruize URL is required, set it via environment or as a parameter depending on your deployment
KRUIZE_URL=http://your-kruize-url java -jar target/kruize-mcp-server-1.0-SNAPSHOT-runner.jar
Alternatively, run via a container image if you build one:
docker build -t kruize-mcp-server:latest .
docker run -e KRUIZE_URL=http://your-kruize-url kruize-mcp-server:latest
-
Connect the MCP Inspector npx @modelcontextprotocol/inspector http://localhost:8080/mcp/
Notes:
- The server may run on port 8082 or another port depending on configuration. Ensure the port is exposed/forwarded as needed for your environment.
- In OpenShift or Minikube, you typically deploy the built JAR in a pod or container and expose the service with the appropriate routes or NodePorts.
Additional notes
Tips and common issues:
- Ensure your Kruize URL is reachable from the MCP server; set KRUIZE_URL to the Kruize endpoint when starting the server.
- If running in Minikube, you may need to port-forward the MCP service (commonly port 8082) to access the Inspector locally.
- The MCP tools rely on Kruize being accessible to fetch live recommendations and experiments; verify network policies and service DNS in your cluster.
- When deploying on OpenShift, you may need to adapt the environment (routes, namespaces) to match your cluster configuration and ensure the MCP server can reach Kruize.
- If you modify the Kruize URL, update the KRUIZE_URL variable accordingly and restart the MCP server to apply changes.