Labsco
lehtinentimo logo

kafka-mcp-server

from lehtinentimo

Expose Apache Kafka operations (topics, produce, consume, consumer groups) as MCP tools.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeAdvanced setup

Kafka MCP Server

A Model Context Protocol (MCP) server that exposes Apache Kafka operations as tools. Built with TypeScript, stdio transport, and the Confluent Kafka client.

Tools

Topics

ToolDescriptionInputs
list-topicsList all topicsnone
describe-topicGet topic details (partitions, replicas)topic
create-topicCreate a new topictopic, numPartitions (default 1), replicationFactor (default 1)
delete-topicDelete a topictopic

Produce / Consume

ToolDescriptionInputs
produceSend a message to a topictopic, value, key (optional)
consumeRead messages from a topictopic, maxMessages (default 10), timeout (default 5000ms)

The consume tool creates an ephemeral consumer that reads from the earliest offset without committing. It disconnects after reaching maxMessages or the timeout.

Cluster

ToolDescriptionInputs
get-cluster-infoGet broker informationnone
list-consumer-groupsList all consumer groupsnone
describe-consumer-groupGet consumer group detailsgroupId

Development

npm run build          # Compile TypeScript
npm start              # Run the server
npm run lint           # Run ESLint
npm run lint:fix       # Run ESLint with auto-fix
npm run format         # Format code with Prettier
npm run format:check   # Check formatting