Bug
list_topics, list_users, health_check, and other tools that operate on KafkaTopic/KafkaUser resources return a 404:
Error listing topics: Failure executing: GET at:
https://<cluster>/apis/kafka.strimzi.io/v1/namespaces/kafka/kafkatopics.
Message: Not Found.
Root cause
The Strimzi API library (io.strimzi:api:0.49.1) annotates KafkaTopic and KafkaUser with @Version("v1"). The Fabric8 client derives the API path from this annotation, so it calls kafka.strimzi.io/v1.
However, clusters running Strimzi operator 0.40.0 and earlier only register kafka.strimzi.io/v1beta2 — v1 was not yet available in that operator release:
$ kubectl api-resources | grep kafkatopic
kafkatopics kt kafka.strimzi.io/v1beta2 true KafkaTopic
Tools that operate on Kafka cluster CRDs (which were already v1) work fine — so list_kafkas, get_kafka_status, etc. all succeed. Only resources still on v1beta2 are affected.
Proposed fix
Detect the available served versions for KafkaTopic at startup using the K8s API discovery endpoint, and configure StrimziResourceRepository to use the correct version:
// In StrimziMcpServer.java
private static String detectKafkaStrimziApiVersion(KubernetesClient client) {
try {
var resources = client.getApiResources("kafka.strimzi.io/v1");
if (resources != null && resources.getResources() != null &&
resources.getResources().stream().anyMatch(r -> "kafkatopics".equals(r.getName()))) {
return "v1";
}
} catch (Exception ignored) {}
return "v1beta2";
}
Pass the detected version into the tool factories so StrimziResourceRepository uses an explicit-version call (e.g. via ResourceDefinitionContext) when v1 is unavailable. Alternatively, accept the API version as an environment variable/config flag to let operators override it.
Environment
- Strimzi operator: 0.40.0
- Strimzi API lib in pom.xml: 0.49.1
- Kubernetes: AWS EKS (us-east-1)
- Affected tools:
list_topics, list_users, health_check, and any tool using KafkaTopic/KafkaUser
Bug
list_topics,list_users,health_check, and other tools that operate onKafkaTopic/KafkaUserresources return a 404:Root cause
The Strimzi API library (
io.strimzi:api:0.49.1) annotatesKafkaTopicandKafkaUserwith@Version("v1"). The Fabric8 client derives the API path from this annotation, so it callskafka.strimzi.io/v1.However, clusters running Strimzi operator 0.40.0 and earlier only register
kafka.strimzi.io/v1beta2—v1was not yet available in that operator release:Tools that operate on
Kafkacluster CRDs (which were alreadyv1) work fine — solist_kafkas,get_kafka_status, etc. all succeed. Only resources still onv1beta2are affected.Proposed fix
Detect the available served versions for
KafkaTopicat startup using the K8s API discovery endpoint, and configureStrimziResourceRepositoryto use the correct version:Pass the detected version into the tool factories so
StrimziResourceRepositoryuses an explicit-version call (e.g. viaResourceDefinitionContext) whenv1is unavailable. Alternatively, accept the API version as an environment variable/config flag to let operators override it.Environment
list_topics,list_users,health_check, and any tool usingKafkaTopic/KafkaUser