Kafka MCP Server

by MCP-Mirror

321 downloads Not rated yet Apache-2.0 license
GitHub

About

A Message Context Protocol (MCP) server that integrates with Apache Kafka, providing publish and consume functionalities for LLM and agentic applications. It allows AI models to interact with Kafka topics through a standardized interface.

Details

License
Apache-2.0 license

Explore

- Publish messages to a configured Kafka topic
- Consume messages from a configured Kafka topic
- Supports configurable Kafka bootstrap servers, topic name, and consumer group
- Customizable tool descriptions via environment variables
- Runs over stdio or SSE transports

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Kafka MCP Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

- Python 3.8+
- Apache Kafka instance
- Python dependencies (see Installation section)

KAFKA_BOOTSTRAP_SERVERS=localhost:9092
TOPIC_NAME=your-topic-name
IS_TOPIC_READ_FROM_BEGINNING=False
DEFAULT_GROUP_ID_FOR_CONSUMER=kafka-mcp-group

You can run the server using the provided main.py script:

python main.py --transport stdio

Available transport options:
- stdio: Standard input/output (default)
- sse: Server-Sent Events

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "kafka mcp server": {
            "pavanjava_kafka_mcp_server": {
                "command": "python",
                "args": [
                    "-m",
                    "venv",
                    "venv"
                ]
            }
        }
    }
}

McpServers

{
    "pavanjava_kafka_mcp_server": {
        "command": "python",
        "args": [
            "-m",
            "venv",
            "venv"
        ]
    }
}

A Message Context Protocol (MCP) server that integrates with Apache Kafka to provide publish and consume functionalities for LLM and Agentic applications.

Overview

This project implements a server that allows AI models to interact with Kafka topics through a standardized interface. It supports:

- Publishing messages to Kafka topics
- Consuming messages from Kafka topics

Prerequisites

- Python 3.8+
- Apache Kafka instance
- Python dependencies (see Installation section)

Installation

1. Clone the repository:

   git clone <repository-url>
cd <repository-directory>

2. Create a virtual environment and activate it:

   python -m venv venv
source venv/bin/activate # On Windows, use: venv\Scripts\activate

3. Install the required dependencies:

   pip install -r requirements.txt

If no requirements.txt exists, install the following packages:

   pip install aiokafka python-dotenv pydantic-settings mcp-server

Configuration

Create a .env file in the project root with the following variables:

```

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.