# mcp-kafka

> MCP Server

mcp-kafka bridges AI assistants and Kafka, enabling interaction with Kafka clusters through the Model Context Protocol. It allows AI to manage topics, produce messages, and consume data directly from Kafka.

## Overview

- **Category:** Communication
- **Language:** Go
- **Stars:** 81
- **Forks:** 0
- **Owner:** kanapuli
- **GitHub:** https://github.com/kanapuli/mcp-kafka
- **Created:** 2025-03-15T14:58:46+00:00
- **Updated:** 2025-03-24T10:01:01+00:00
- **Source:** https://model-context-protocol.com/servers/ai-kafka-model-context-protocol-server

## Setup

## Setup

### Prerequisites
- Go 1.24 or higher
- A running Kafka cluster (default connection: localhost:9092)

### Building from Source
1. Clone the repository:
   ```bash
   git clone https://github.com/kanapuli/mcp-kafka.git
   cd mcp-kafka
   ```

2. Build the application:
   ```bash
   make build
   ```

3. Optionally, build for a specific platform:
   ```bash
   make build GOOS=darwin GOARCH=arm64
   ```

### Installing as a Claude Desktop Tool
1. Build the application as mentioned above.

2. Place the executable in a location included in your system PATH or in a dedicated tools directory.

3. Please follow this [Claude Desktop Tool Installation Guide](https://modelcontextprotocol.io/quickstart/user) to install the tool.

The JSON to be added to the claude_desktop_config.json file is as follows, Use the right username and password for SASL login. Leave them empty for PLAINTEXT authentication.

```json
{
  "mcpServers": {
    "kafka": {
	    "command": "/Your-mcp-kafka-executable-path/mcp-kafka-darwin-arm64",
      "args": [
          "--bootstrap-servers=localhost:9092",
          "--consumer-group-id=mcp-kafka-consumer-group",
          "--username=",
          "--password="
        ],
      "env": {}
    }
  }
}
```

## Tools

## Available Tools

1. Create Topic (Create a new Kafka topic with configurable partitions and replication factor)
2. List Topics (Get a list of all available Kafka topics in the cluster)
3. Delete Topic (Remove an existing Kafka topic)
4. Describe Topic (Get detailed information about a specific topic, including partition details)
5. Produce Message (Send messages to a Kafka topic with support for message keys and headers)
6. Consume Messages (Read messages from a Kafka topic with configurable timeout)
