Kafka MCP Server

Kafka MCP Server

kafka-mcp-server-joel-hanson•byjoel-hanson

An MCP server that lets MCP-compatible clients interact with a Kafka cluster to connect and manage topics through tool-based interfaces.

License: Not specified•Runtime: Awaiting documentation review•Category: databases storage

WHAT IT DOES

  • •Connects to Kafka using a properties file and manages the connection with pooling and cleanup.
  • •Lists, creates, and deletes Kafka topics.
  • •Creates topics with custom partitions and replication factor.
  • •Inspects topic details such as partitions, replicas, and ISR.

BEST FOR

  • •Managing Kafka topics from an MCP-compatible client such as Claude Desktop.
  • •Creating or removing topics with specified partition and replication settings.
  • •Inspecting the health details of a topic, including partitions and replicas.

ABOUT KAFKA-MCP-SERVER-JOEL-HANSON

Kafka MCP Server is cataloged as an MCP server attributed to joel-hanson. An MCP server that lets MCP-compatible clients interact with a Kafka cluster to connect and manage topics through tool-based interfaces. It is categorized under databases storage. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: Not specified. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for Kafka MCP Server are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

How does the server connect to Kafka?

It initializes a connection using a Kafka properties file containing connection details.

Does the server support producing or consuming messages?

Message production and consumption are listed as planned features, while the current supported operations focus on topic management.

上游原版 README

在 GitHub 查看同一版本原文

README.md · c6d2d4482672 · 采集于 2026-11-13 13:08:14 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

Kafka MCP Server

This project provides a Model Context Protocol (MCP) server that enables interaction with a Kafka cluster via standard tool-based interfaces. It exposes Kafka operations like producing messages, consuming, listing topics, and more — all accessible through Claude Desktop or any MCP-compatible client.

🛠 Features

  • List Kafka topics
  • Create and delete topics
  • Produce messages

🚀 Quick Start

1. Clone the repository

git clone https://github.com/joel-hanson/kafka-mcp-server.git
cd kafka-mcp-server

2. Setup Python environment (using conda)

conda create -n kafka-mcp python=3.10 -y
conda activate kafka-mcp
pip install -r requirements.txt

3. Start the MCP server (for local dev)

mcp dev

This starts the server and opens the MCP Inspector so you can test tool prompts and responses.


Usage

Running the Server

python server.py

Available Tools

  1. kafka_initialize_connection - Connect to Kafka using a properties file
  2. kafka_list_topics - List all topics in the cluster
  3. kafka_create_topic - Create a new topic
  4. kafka_delete_topic - Delete an existing topic
  5. kafka_get_topic_info - Get detailed information about a topic

Example Usage Flow

  1. First, connect to Kafka:

    Use kafka_initialize_connection with your properties file <path>
    OR
    Initialize connection with kafka using the properties file <path>
    
  2. List existing topics:

    Use kafka_list_topics to see all topics
    OR
    List all the topics
    
  3. Create a new topic:

    Use kafka_create_topic with name "my-topic", partitions 3, replication_factor 1
    OR
    Create me a topic with name "my-topic"
    
  4. Get topic details:

    Use kafka_get_topic_info for "my-topic"
    

Features

  • Configuration Management: Loads Kafka connection details from standard properties files
  • Topic Management: List, create, delete, and inspect topics
  • Error Handling: Comprehensive error handling with informative messages
  • Connection Management: Efficient connection pooling and cleanup
  • Extensible: Easy to add more Kafka operations

Supported Kafka Operations

Current

  • Topic listing
  • Topic creation with custom partitions and replication factor
  • Topic deletion
  • Topic inspection (partitions, replicas, ISR)

Planned Features

  • Message production
  • Message consumption
  • Consumer group management
  • Offset management
  • Cluster information
  • Performance metrics

Troubleshooting

Common Issues

  1. Connection Failed: Verify your bootstrap.servers in the properties file
  2. Authentication Error: Check your SASL/SSL configuration
  3. Topic Already Exists: Use kafka_get_topic_info to check existing topics
  4. Permission Denied: Ensure your Kafka user has the necessary permissions

Logging

The server logs to stdout. You can adjust the logging level by modifying the logging.basicConfig(level=logging.INFO) line in the code.

Security Notes

  • Store sensitive credentials securely
  • Use SSL/TLS for production environments
  • Implement proper authentication and authorization
  • Regularly rotate credentials

🧠 Using with Claude Desktop

To integrate your Kafka MCP server with Claude Desktop:

Install it into Claude:

mcp install <file_spec> -f <optional env file>

Note: If you are seeing dependency-related issues, please configure the claud_desktop_config.json with the absolute path to the python and provide the file to run.

MCP Client Configuration

Add this to your MCP client configuration (e.g., Claude Desktop):

{
  "mcpServers": {
    "kafka": {
      "command": "python",
      "args": ["/path/to/server.py"]
    }
  }
}
{
"mcpServers": {
      "Kafka MCP Server": {
         "command": "/opt/miniconda3/envs/kafka-mcp/bin/python",
         "args": [
         "/path/to/server.py"
         ]
      }
   }
}

Claude will now detect and interact with the tools you've defined via @mcp.prompt() in your Python server.

Configuration

Create a Kafka properties file (e.g., kafka.properties) with your Kafka connection details:

# Basic Kafka connection
bootstrap.servers=localhost:9092
client.id=kafka-mcp-client

# Security configuration (if needed)
# security.protocol=SASL_SSL
# sasl.mechanism=PLAIN
# sasl.username=your-username
# sasl.password=your-password

# SSL configuration (if needed)
# ssl.ca.location=/path/to/ca-cert
# ssl.certificate.location=/path/to/client-cert
# ssl.key.location=/path/to/client-key

📂 Project Structure

kafka_mcp_server/
├── server.py               # Main FastMCP server defining tools
├── kafka_utils.py
├── requirements.txt
├── README.md
└── ...

🧩 Tool Debugging Tips

  • Use mcp dev to inspect prompt behavior interactively
  • Add print() or logging.debug() in your tool functions
  • Use structured @prompt function signatures to ensure correct parsing

📦 Requirements

Add this to your requirements.txt:

kafka-python
mcp[cli]
pydantic
uv

Testing

Please run docker compose up to bring up kafka cluster with a single broker you can interact with using the bootstrap.server localhost:9092.


🔗 Resources

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for Kafka MCP Server from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/kafka-mcp-server-joel-hanson)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related databases storage MCP Servers

Alternative and complementary servers in the same category

View all in databases storage →
AIStor MCP server
mcp-server-aistor•minio

This is a Model Context Protocol (MCP) server for interacting with AIStor object stores.

Repository stats unavailable
Databases & Storage
InfluxDB v2 MCP Server
influxdb-mcp-server•idoru

A Model Context Protocol (MCP) server that exposes access to an InfluxDB v2 instance using the InfluxDB OSS API v2.

Repository stats unavailable
Databases & Storage