data
Apache Kafka CLI for Coding Agents
Use the Apache Kafka CLI for coding agents with headless JSON commands, schema discovery, credentials, and permission controls.
7 functions 6 read 1 write API token auth
Apache Kafka CLI for Coding Agents
Let coding agents discover schemas and execute integration functions through CLI commands or MCP.
Use this pattern when another coding agent needs exact commands and schema discovery. The Apache Kafka CLI uses the same integration registry as the TUI, Lua runtime, and MCP gateway, but returns predictable command output for automation.
Command Shape
# Apache Kafka CLI for Coding Agents
kosmokrator integrations:configure kafka --set api_token="$KAFKA_API_TOKEN" --enable --read allow --write ask --json
kosmo integrations:call kafka.kafka_list_topics '{"cluster_id":"example_cluster_id"}' --json Discovery Before Execution
Agents and scripts can inspect Apache Kafka docs and schemas before choosing a function.
kosmo integrations:docs kafka --json
kosmo integrations:docs kafka.kafka_list_topics --json
kosmo integrations:schema kafka.kafka_list_topics --json
kosmo integrations:search "Apache Kafka" --json
kosmo integrations:list --json Useful Apache Kafka CLI Functions
| Function | Type | Parameters | Description |
|---|---|---|---|
kafka.kafka_list_topics | Read | cluster_id | List Kafka topics in a cluster. Returns topic names, partition counts, replication factors, and status. |
kafka.kafka_get_topic | Read | topic_name, cluster_id | Get full details of a specific Kafka topic by name. Returns partition count, replication factor, and topic configuration. |
kafka.kafka_create_topic | Write | topic_name, partitions_count, replication_factor, configs, cluster_id | Create a new Kafka topic in a cluster. Specify the topic name, partition count, and optional replication factor and configs. |
kafka.kafka_list_clusters | Read | none | List Kafka clusters in your Confluent Cloud environment. Returns cluster IDs, names, types, and status. |
kafka.kafka_get_cluster | Read | cluster_id | Get details of a specific Kafka cluster. Returns broker count, controller info, and cluster configuration. |
kafka.kafka_list_producers | Read | topic_name, cluster_id | List producers for a specific Kafka topic. Returns producer IDs, client IDs, and connection details. |
kafka.kafka_get_current_user | Read | none | Get the currently authenticated Confluent Cloud user. Useful for verifying credentials and identifying the connected account. |
Automation Notes
- Use
--jsonfor machine-readable output. - Keep credentials out of argv by using environment variables or stored KosmoKrator configuration.
- Configure read/write policy before unattended runs; use
--forceonly for trusted automation. - Use the MCP gateway instead when the agent needs dynamic tool discovery inside a conversation.