Get the FREE Ultimate OpenClaw Setup Guide →

kafka

MCP server from CefBoud/kafka-mcp-server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio cefboud-kafka-mcp-server docker run -i --rm -e KAFKA_MCP_BOOTSTRAP_SERVERS ghcr.io/cefboud/kafka-mcp-server \
  --env KAFKA_MCP_BOOTSTRAP_SERVERS="localhost:9092"

How to use

The Kafka MCP Server provides a Model Context Protocol interface wired to an Apache Kafka cluster. It exposes MCP tools to interact with Kafka topics, produce and consume messages, inspect topics and brokers, and manage consumer groups, all accessible via natural language prompts processed through the MCP workflow. You can run the server in a container (Docker) or build it locally with Go, then connect using your MCP client (e.g., Claude Desktop) to issue commands like listing topics, creating topics, producing or consuming messages, and querying offsets or broker details. The server also includes the MultiplexTool feature to batch multiple tool calls into a single request, enabling complex workflows where later steps depend on earlier results. When launching via Docker, set the KAFKA_MCP_BOOTSTRAP_SERVERS environment variable to your Kafka bootstrap server (for example localhost:9092). The available MCP tools include: List topics, Create topic, Consuming messages, Produce messages, Describe the clusters, List consumer groups and their lag, Get topic offsets, and a few advanced options such as enabling multiplexing. You can enable multiplexing by passing the appropriate flags to the container (e.g., --enable-multiplex and --multiplex-model gemini) and providing the GEMINI_API_KEY if required by your chosen model.

How to install

Prerequisites:

  • Docker installed, or Golang toolchain if building locally.
  • Access to a Kafka cluster (or use a local Kafka instance as described in the quickstart).

Installation (Docker):

  1. Pull the Kafka MCP Server image and run it, wiring the bootstrap servers via environment variable:
docker pull ghcr.io/cefboud/kafka-mcp-server
docker run -i --rm -e KAFKA_MCP_BOOTSTRAP_SERVERS=localhost:9092 ghcr.io/cefboud/kafka-mcp-server
  1. The server will connect to the Kafka cluster at the specified bootstrap servers. Ensure your Kafka is reachable at the provided address (e.g., localhost:9092).

Installation (Build from source):

  1. Clone the repository:
git clone https://github.com/CefBoud/kafka-mcp-server.git
cd kafka-mcp-server
  1. Build the binary (Go):
go build -o kafka-mcp-server cmd/kafka-mcp-server/main.go
  1. Run the server, providing the bootstrap servers via environment variable:
export KAFKA_MCP_BOOTSTRAP_SERVERS=localhost:9092
./kafka-mcp-server

Prerequisites recap:

  • Docker or Go (for building).
  • A reachable Kafka cluster (bootstrap servers).

Examples of usage in client configuration are shown in the examples in the README.

Additional notes

Notes and tips:

  • The MCP server uses KAFKA_MCP_BOOTSTRAP_SERVERS to connect to Kafka. You can pass this as an environment variable or via your MCP client configuration.
  • Available options include enabling logging of commands and responses, read-only mode, and multiplexing features. These can be set as command-line flags or environment variables following the MCP_KAFKA_ prefix convention.
  • Common issues: ensure network connectivity to Kafka, correct bootstrap server address, and that the Kafka cluster allows the client to connect from your host (firewalls, ACLs, or container networking issues can block access).
  • If you enable multiplexing, you will be able to batch tool calls and define dynamic dependencies using PROMPT_ARGUMENT placeholders (supported model: Gemini). Ensure GEMINI_API_KEY is provided in env if using the Gemini model.
  • When running via Docker, you can override the image, tag, and environment variables as needed to fit your deployment environment.

Related MCP Servers

Sponsor this space

Reach thousands of developers