Kafka

v1.0.0Monitoring & Observabilitystable

🐍 🏠 ☁️ - MCP server for Apache Kafka that allows LLM agents to inspect topics, consumer groups, and safely ma

kafkamcpmcp-serverapache-kafkaapache-kafka-consumer
Share:
51
Stars
0
Downloads
0
Weekly
0/5

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

Inspect Kafka topics, consumer groups, and manage them safely through MCP. Monitor and analyze message flows.
wklee610

Maintainer

LicenseApache 2.0
Languagego
Versionv1.0.0
UpdatedMay 18, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx kafka

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

Clone the repository

Clone the kafka-mcp repository from GitHub.

git clone https://github.com/wklee610/kafka-mcp.git
cd kafka-mcp
2

Install dependencies

Install the project dependencies using uv.

uv sync
3

Set 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:9092
4

Run 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-mcp
5

Configure 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"
      }
    }
  }
}
6

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.

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.

Quick Config Preview

{ "mcpServers": { "kafka": { "command": "npx", "args": ["-y", "kafka"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides