1
0
mirror of https://github.com/k8sgpt-ai/k8sgpt.git synced 2025-05-12 10:04:22 +00:00
k8sgpt/pkg/server/client_example/README.md
Alex Jones 2cc5f3e9cc feat: added http sse support
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
2025-04-25 16:37:07 +01:00

1.4 KiB

K8sGPT MCP Client Example

This directory contains an example of how to use the K8sGPT MCP client in a real-world scenario.

Prerequisites

  • Go 1.16 or later
  • Access to a Kubernetes cluster
  • kubectl configured to access your cluster

Building the Example

To build the example, run:

go build -o mcp-client-example

Running the Example

To run the example, use the following command:

./mcp-client-example --kubeconfig=/path/to/kubeconfig --namespace=default

Command-line Flags

  • --kubeconfig: Path to the kubeconfig file (optional, defaults to the standard location)
  • --namespace: Kubernetes namespace to analyze (optional)

Example Output

When you run the example, you should see output similar to the following:

Starting MCP client...

The client will continue running until you press Ctrl+C to stop it.

Integration with Mission Control

To integrate this example with Mission Control, you need to:

  1. Start the MCP client using the example
  2. Configure Mission Control to connect to the MCP client
  3. Use Mission Control to analyze your Kubernetes cluster

Troubleshooting

If you encounter any issues, check the following:

  1. Ensure that your Kubernetes cluster is accessible
  2. Verify that your kubeconfig file is valid
  3. Check that the namespace you specified exists

License

This code is licensed under the Apache License 2.0.