1
Add it to Claude Code
claude mcp add -e "KAFKA_BOOTSTRAP_SERVERS=${KAFKA_BOOTSTRAP_SERVERS}" kafka-mcp -- "<uv PATH>" --directory "<kafka-mcp PATH>" run kafka-mcpRequired:
KAFKA_BOOTSTRAP_SERVERS+ 1 optionalEnvironment Variables
Set these before running Kafka MCP.
VariableDescriptionRequired
KAFKA_BOOTSTRAP_SERVERSComma-separated list of broker urlsYesKAFKA_CLIENT_IDClient ID for connectionNoAvailable Tools (16)
Once configured, Kafka MCP gives your AI agent access to:
describe_clusterGet cluster metadata including controller and brokers.describe_brokersList all brokers.list_topicsList all available topics.describe_topicGet detailed info for a topic including partitions and replicas.create_topicCreate a new topic with partitions and replication factor.delete_topicDelete a topic.create_partitionsIncrease partitions for a topic.describe_configsView dynamic configs for topic, broker, or group.alter_configsUpdate dynamic configs.list_consumer_groupsList all active consumer groups.describe_consumer_groupGet members and state of a group.get_consumer_group_offsetsGet committed offset, watermarks, and calculate total lag for a topic.reset_consumer_group_offsetSafely change consumer group offsets to earliest, latest, or a specific offset.rewind_consumer_group_offset_by_timestampRewind or advance consumer group offsets securely based on a timestamp.consume_messagesConsume messages from a topic.produce_messageSend a message to a topic.Try It Out
After setup, try these prompts with your AI agent:
→List all topics currently available in the Kafka cluster.
→Check the consumer group lag for the 'orders' topic and identify if any groups are falling behind.
→Reset the consumer group offset for 'payment-service' to the earliest position.
→Produce a test message to the 'notifications' topic with the content 'Hello Kafka'.
→Describe the configuration for the 'user-events' topic to check its retention settings.
Prerequisites & system requirements
- An MCP-compatible client (Claude Code, Cursor, Windsurf, Claude Desktop, or Codex)
- Docker installed and running
KAFKA_BOOTSTRAP_SERVERS— Comma-separated list of broker urls
Alternative installation methods
Docker
docker run -i --rm -e KAFKA_BOOTSTRAP_SERVERS=host.docker.internal:9092 kafka-mcpKeep this setup from going cold
Save the docs, env vars, and workflow around Kafka MCP in Conare so Claude Code, Codex, and Cursor remember it next time.