Kafka
🐍 🏠 ☁️ - MCP server for Apache Kafka that allows LLM agents to inspect topics, consumer groups, and safely ma
What is Kafka?
Kafka is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to 🐍 🏠 ☁️ - mcp server for apache kafka that allows llm agents to inspect topics, consumer groups, and safely ma
🐍 🏠 ☁️ - MCP server for Apache Kafka that allows LLM agents to inspect topics, consumer groups, and safely ma
This server falls under the Monitoring & Observability category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- MCP protocol support
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx kafkaConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Kafka
kafka-mcp is a Python-based MCP server that lets LLM agents inspect and manage Apache Kafka clusters through natural language. It exposes a comprehensive set of tools covering cluster metadata, topic lifecycle (create, delete, describe, repartition), dynamic config management, consumer group monitoring and offset control, and message produce/consume — all accessible from Claude Desktop or any stdio MCP client. Operations teams use it to diagnose consumer lag, rewind offsets after a bad deployment, or query topic configs without switching to the Kafka CLI.
Prerequisites
- Python 3.10 or higher
- uv package manager (recommended) or pip
- A running Apache Kafka cluster accessible from your machine (local Docker, Confluent Cloud, MSK, etc.)
- The KAFKA_BOOTSTRAP_SERVERS environment variable set to your broker addresses
- An MCP-compatible client such as Claude Desktop
Clone the repository
Clone the kafka-mcp repository from GitHub.
git clone https://github.com/wklee610/kafka-mcp.git
cd kafka-mcpInstall dependencies
Install the project dependencies using uv.
uv syncSet the bootstrap servers environment variable
Export the required environment variable pointing to your Kafka broker(s). Multiple brokers are comma-separated. The optional KAFKA_CLIENT_ID defaults to 'kafka-mcp'.
export KAFKA_BOOTSTRAP_SERVERS=localhost:9092
# Multiple brokers:
export KAFKA_BOOTSTRAP_SERVERS=broker1:9092,broker2:9092Run the server to verify connectivity
Start the MCP server directly to confirm it can connect to your Kafka cluster before adding it to a client.
uv run kafka-mcpConfigure your MCP client
Add the server to your MCP client's config file. Replace the directory path with the absolute path where you cloned the repo. The env block passes the required bootstrap servers to the server process.
{
"mcpServers": {
"kafka": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/kafka-mcp",
"run",
"kafka-mcp"
],
"env": {
"KAFKA_BOOTSTRAP_SERVERS": "localhost:9092"
}
}
}
}Restart your MCP client
Restart Claude Desktop or your MCP client after saving the configuration. The Kafka tools will be listed in the available tools.
Kafka Examples
Client configuration (Claude Desktop)
Full claude_desktop_config.json entry for kafka-mcp. Adjust KAFKA_BOOTSTRAP_SERVERS to point at your cluster.
{
"mcpServers": {
"kafka": {
"command": "uv",
"args": [
"--directory",
"/Users/yourname/kafka-mcp",
"run",
"kafka-mcp"
],
"env": {
"KAFKA_BOOTSTRAP_SERVERS": "localhost:9092",
"KAFKA_CLIENT_ID": "kafka-mcp"
}
}
}
}Prompts to try
These prompts exercise the key Kafka management tools exposed by the server.
- "List all topics in the Kafka cluster and show their partition counts"
- "Describe the consumer group 'order-processor' and show the current lag for each partition"
- "Create a new topic called 'payments-v2' with 6 partitions and a replication factor of 3"
- "Consume the last 10 messages from the 'user-events' topic"
- "Reset the consumer group 'analytics-consumer' offset for topic 'clickstream' to the earliest position"Troubleshooting Kafka
Connection refused when the server starts
Verify that KAFKA_BOOTSTRAP_SERVERS is set correctly and the brokers are reachable from your machine. Use 'nc -zv localhost 9092' to test TCP connectivity. If running Kafka in Docker, use 'host.docker.internal:9092' instead of 'localhost'.
Consumer group offset reset fails or is rejected
The consumer group must have no active consumers (all instances stopped) before an offset reset is allowed. Confirm with describe_consumer_group that the group state is 'Empty' before attempting reset_consumer_group_offset.
SASL/TLS-secured clusters fail to connect
The current version does not yet support SASL authentication (it is listed as TODO in the project). For secured clusters, consider a local plaintext proxy or contributing SASL support. Check the GitHub issues for progress.
Frequently Asked Questions about Kafka
What is Kafka?
Kafka is a Model Context Protocol (MCP) server that 🐍 🏠 ☁️ - mcp server for apache kafka that allows llm agents to inspect topics, consumer groups, and safely ma It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Kafka?
Follow the installation instructions on the Kafka GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Kafka?
Kafka works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Kafka free to use?
Yes, Kafka is open source and available under the Apache 2.0 license. You can use it freely in both personal and commercial projects.
Kafka Alternatives — Similar Monitoring & Observability Servers
Looking for alternatives to Kafka? Here are other popular monitoring & observability servers you can use with Claude, Cursor, and VS Code.
Netdata
★ 78.9kReal-time infrastructure monitoring with metrics, logs, alerts, and ML-based anomaly detection.
Kubeshark
★ 11.9keBPF-powered network observability for Kubernetes. Indexes L4/L7 traffic with full K8s context, decrypts TLS without keys. Queryable by AI agents via MCP and humans via dashboard.
Mission Control
★ 4.9kSelf-hosted AI agent orchestration platform: dispatch tasks, run multi-agent workflows, monitor spend, and govern operations from one mission control dashboard.
Grafana
★ 3.0kThis MCP server enables natural-language querying of Grafana logs by automatically detecting log sources and service labels. It provides read-only access to log data with intelligent caching for efficient repeat queries.
Sentrux
★ 2.4kReal-time architectural sensor that helps AI agents close the feedback loop, enabling recursive self-improvement of code quality. Pure Rust.
OpenInference
★ 986OpenTelemetry Instrumentation for AI Observability
Browse More Monitoring & Observability MCP Servers
Explore all monitoring & observability servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Kafka in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Kafka?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.