Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

kcat

$ kcat Community Med Risk
Magnus Edenhill · Database & Data · BSD-2-Clause · macos / linux / windows

kcat (formerly kafkacat) is a lightweight C/librdkafka CLI for inspecting Kafka brokers, consuming messages, and producing test events without Java overhead. Supports -L -J for JSON cluster metadata, -C -e -c <n> -J for bounded message reads, and SASL/TLS configs.

FCRS-1.0 Score
82 /100
Good
Medium Confidence
Zero-Friction Install
brew install kcat
CLI vs MCP Decision CLI Only

kcat -L -J and kcat -C -e -c 10 -J inspect Kafka topics and offsets in milliseconds without spinning up a JVM.

Agent-Readiness Checklist

✓ JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
— NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 21 / 25

-J JSON envelope output, -L metadata inspection, -e exit-at-EOF, and -c <n> count bounds fit automated pipelines well.

  • Supports -J, -L, -e, and -c bounded reads
Trust & Safety 20 / 25

Does not perform topic deletion or cluster admin mutations; consumer mode requires -e/-c to avoid infinite tailing.

  • Read/produce client only; no admin DDL commands
Setup & Portability 13 / 15

Fast native C binary via Homebrew and Linux distros, though Windows usually uses Docker/WSL.

  • Lightweight native binary via brew install kcat and apt/apk
Utility & Efficiency 13 / 15

Replaces slow JVM kafka-console-consumer scripts with instant librdkafka inspection.

  • Zero-JVM Kafka metadata and payload sampling
Maintenance & Lineage 8 / 10

Built on librdkafka by Magnus Edenhill (edenhill/kcat), widely trusted in Kafka operations.

  • Established edenhill/kcat project
Docs & Verifiability 7 / 10

Concise README examples and -h usage text.

  • README examples and -h help

Security, Auth & Guardrails

Auth Modes
No Auth Config File Env API Key
Credential Storage

Broker auth and TLS/SASL settings read from ~/.config/kcat.conf (KAFKACAT_CONFIG) or -X properties.

Side Effects
Read-Only Remote Write
Cost & Quotas

100% free and BSD-2-Clause open-source.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# kcat Agent Rules
- Always pass `-e` and `-c <count>` in consumer mode (`-C`) so `kcat` exits instead of tailing forever.
- Always pass `-J` on `-L` metadata and `-C` reads for clean JSON parsing.
- Use `-F ~/.config/kcat.conf` for SASL secrets instead of inline `-X sasl.password=...`.

Agent-Ready Command Recipes

Safe Read-Only Queries

Dump Kafka broker and topic metadata as JSON
kcat -b localhost:9092 -L -J

Lists brokers, topics, and partition leaders in structured JSON and exits immediately.

Sample the last 10 messages from a topic safely
kcat -b localhost:9092 -t events -C -o -10 -c 10 -e -J

Reads at most 10 messages (-c 10), exits at end of partition (-e), and wraps payloads in JSON (-J).

Controlled Writes & Previews

Produce one test event from stdin
printf '{"event":"ping"}
' | kcat -b localhost:9092 -t events -P

Publishes a single bounded line to a Kafka topic and exits.

Strengths for Agents

  • + -J outputs structured JSON envelopes with topic, partition, offset, key, and payload.
  • + -e -c <n> guarantees consumer calls terminate cleanly.
  • + Zero JVM startup delay compared to official Apache Kafka shell scripts.

Caveats & Pitfalls

  • ! Running -C without -e or -c blocks indefinitely waiting for new messages.
  • ! Protobuf or Avro Schema Registry decoding requires extra flags (-s value=avro -r ...).

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI