What is Kafka MCP Server?
Kafka MCP Server is a Model Context Protocol (MCP) server that integrates with Apache Kafka, allowing users to interact with a Kafka cluster using natural language through large language models (LLMs).
How to use Kafka MCP Server?
To use the Kafka MCP Server, you need to have access to a Kafka cluster. You can run the server locally using Docker or Golang by following the provided instructions in the documentation.
Key features of Kafka MCP Server?
- Integration with Apache Kafka for natural language processing.
- Ability to list topics, create topics, consume and produce messages.
- Tools for managing consumer groups and offsets.
Use cases of Kafka MCP Server?
- Simplifying interactions with Kafka for users unfamiliar with command-line interfaces.
- Enabling natural language queries to manage Kafka topics and messages.
- Facilitating educational purposes for learning about Kafka and its functionalities.
FAQ from Kafka MCP Server?
- What are the prerequisites to run Kafka MCP Server?
You need either Docker or Golang installed to run the server locally.
- Can I use Kafka MCP Server without a Kafka cluster?
No, you need access to a Kafka cluster to utilize the functionalities of the MCP server.
- What tools are available with Kafka MCP Server?
The server provides tools to list topics, create topics, consume and produce messages, and manage consumer groups.
Kafka MCP Server
The Kafka MCP Server is a Model Context Protocol (MCP) server that provides integration with Apache Kafka to enable interaction with a Kafka cluster using natural language (LLMs).
Prerequisites
You will either need Docker or Golang to run the MCP server locally.
Getting Started
You need to have access to a Kafka cluster. Following the quickstart doc:
docker pull apache/kafka:4.0.0
docker run -p 9092:9092 apache/kafka:4.0.0
Kafka is available on localhost:9092
now.
Usage with Claude Desktop
Docker:
{
"mcpServers": {
"kafka": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"KAFKA_MCP_BOOTSTRAP_SERVERS",
"ghcr.io/cefboud/kafka-mcp-server"
],
"env": {
"KAFKA_MCP_BOOTSTRAP_SERVERS": "localhost:9092"
}
}
}
}
Building locally
cd <workdir>
git clone https://github.com/CefBoud/kafka-mcp-server.git
cd kafka-mcp-server
go build -o kafka-mcp-server cmd/kafka-mcp-server/main.go
{
"mcpServers": {
"kafka": {
"command": "<workdir>/kafka-mcp-server/kafka-mcp-server",
"args": [
"stdio"
],
"env": {
"KAFKA_MCP_BOOTSTRAP_SERVERS": "localhost:9092"
}
}
}
}
Available MCP Tools
- List topics
- Create topic
- Consuming messages.
- Produce messages.
- List consumer groups and inspect lag.
- Reset consumer group offsets.
- Get topic's earliest and latest offsets (GetOffsetShell)
- Kafka Connect ??
- Schema Registry ??
Credits
- github.com/github/github-mcp-server
- github.com/mark3labs/mcp-go
- github.com/IBM/sarama