Mcp Kafka

io.github.dockndevaiPublished by GitHub account dockndevaiv0.3.3Updated Oct 28, 2026

Apache Kafka monitoring & management for AI agents (with consumer lag) — governed.

VerifiedSTDIODesktop onlyDatabasesSecurity & Monitoring

Overview

AI-generated overview

Local MCP server for Apache Kafka that lets an assistant inspect clusters, topics, offsets and consumer lag, with optional governed write and admin actions.

What you can do
  • Inspect the cluster: brokers, controller, cluster id, and topic names filtered by allowlist
  • Examine topics: partitions, replicas, in-sync replicas, non-default configs, and earliest/latest offsets per partition
  • Review consumer groups: list groups and protocol types, describe state, and compute per-partition and total lag
  • Manage topics in read-write mode: create topics, add partitions, alter topic configs, reset group offsets
  • Delete topics or consumer groups in admin mode, gated behind an explicit delete flag
When to use it
Useful when an assistant needs to answer operational questions about a Kafka cluster, such as which consumer groups are lagging or how a topic is partitioned, or to make scoped topic changes from a chat client. Start in read-only mode for monitoring only.
Requirements
Runs locally over stdio via npx from the npm package, so Node.js is needed. Requires KAFKA_BROKERS (comma-separated host:port list) and optionally KAFKA_MODE (read-only, read-write or admin; defaults to read-only). Network access to the brokers; plaintext, TLS and SASL PLAIN/SCRAM authentication are supported.
Before you install
Read-write and admin modes can create topics, add partitions, alter configs, reset consumer group offsets, and delete topics or groups; deletions also need the delete flag. Keep read-only unless changes are intended, and use the topic allowlist, protected topics, dry-run and audit log. Broker credentials and TLS/SASL settings are supplied through environment variables.

Installation

In SourceWeft

  1. Open Mcp Kafka in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

mcp-kafka

[CI] [License: MIT] [npm]

A Model Context Protocol server for Apache Kafka. It lets an MCP-capable client (Claude Desktop, Claude Code, etc.) monitor and manage Kafka clusters — topics, partitions, configs, and consumer groups (including lag) — with behaviour controlled entirely by flags.

Safe by default: it starts read-only, can be scoped to an allowlist of topics, protects internal/critical topics from mutation, and gates destructive operations behind an explicit opt-in.

Features

  • Monitoring — cluster/broker info, topic metadata and offsets, consumer groups, and per-partition + total consumer lag.
  • Management — create topics, add partitions, alter topic configs, reset group offsets; delete topics/groups (admin).
  • Access modes — read-only → read-write → admin, layered so a mode never exposes tools above its level.
  • Security flags — topic allowlist, protected/internal topics, delete gating, dry-run, and JSON audit logging (see below).
  • Auth — plaintext, TLS, and SASL (PLAIN / SCRAM-SHA-256 / SCRAM-SHA-512).

Security model

ConcernFlagDefaultEffect
What can the server do?KAFKA_MODEread-onlyread-only exposes only monitoring; read-write adds management; admin adds deletes. Tools above the mode are never registered.
Which topics are in scope?KAFKA_TOPIC_ALLOWLIST(all)When set, operations on other topics are refused.
Protect internal topicsKAFKA_PROTECT_INTERNAL_TOPICStrueTopics starting with _ can be read but never mutated.
Protect specific topicsKAFKA_PROTECTED_TOPICS(none)Additional read-only-forever topics.
Can it delete?KAFKA_ALLOW_DELETEfalsedelete_topic / delete_consumer_group need this and admin mode.
Preview without touching the clusterKAFKA_DRY_RUNfalseWrite/admin tools validate + log intent, then return.
Audit trailKAFKA_AUDIT_LOGtrueEmits a JSON line to stderr per guarded operation.
Interactive confirmation(automatic)—Destructive & high-impact actions prompt the human to approve via MCP elicitation before running; clients without elicitation fall back to the *_ALLOW_* gate.

Tools

Read (read-only+): cluster_info, list_topics, describe_topic, topic_offsets, list_consumer_groups, describe_consumer_group (with lag)

Write (read-write+): create_topic, create_partitions, alter_topic_config, reset_consumer_group_offsets

Admin (admin): delete_topic, delete_consumer_group (both need KAFKA_ALLOW_DELETE)

Quickstart — add to your agent

Published on npm as @dockndevai/mcp-kafka. No clone or build needed — your MCP client runs it on demand with npx. Start in read-only mode; see .env.example for every variable and docs/CLIENTS.md for the full per-client guide.

Claude Code (CLI)

bash
claude mcp add kafka -e KAFKA_BROKERS="localhost:9092" -e KAFKA_MODE="read-only" -- npx -y @dockndevai/mcp-kafka

Claude Desktop · Cursor · Windsurf — same block in claude_desktop_config.json, .cursor/mcp.json, or ~/.codeium/windsurf/mcp_config.json:

json
{  "mcpServers": {    "kafka": {      "command": "npx",      "args": [        "-y",        "@dockndevai/mcp-kafka"      ],      "env": {        "KAFKA_BROKERS": "localhost:9092",        "KAFKA_MODE": "read-only"      }    }  }}

OpenAI Codex CLI — in ~/.codex/config.toml:

toml
[mcp_servers.kafka]command = "npx"args = ["-y", "@dockndevai/mcp-kafka"]env = { KAFKA_BROKERS = "localhost:9092", KAFKA_MODE = "read-only" }

VS Code (GitHub Copilot, Agent mode) — in .vscode/mcp.json:

json
{  "servers": {    "kafka": {      "type": "stdio",      "command": "npx",      "args": [        "-y",        "@dockndevai/mcp-kafka"      ],      "env": {        "KAFKA_BROKERS": "localhost:9092",        "KAFKA_MODE": "read-only"      }    }  }}

Example prompts

  • "Which consumer groups have the most lag right now?"
  • "Describe the orders topic and show its offsets."
  • "Create a topic events with 6 partitions and 7-day retention." (needs read-write)

Run from source (development)

Prefer the published package above. To run from a clone:

bash
npm installnpm run buildnode dist/index.js   # with the environment variables set

Develop

bash
npm run devnpm testnpm run typecheck

Publishing

This server ships a server.json for the official MCP registry and an mcpName for npm ownership validation. See PUBLISHING.md for publishing to npm and listing on the MCP registry, Smithery, Glama, Cursor, and PulseMCP.

License

MIT

Source: README.md at commit 4996b18

Tools

6

cluster_info

Cluster info

Describe the Kafka cluster: brokers, controller, and cluster id.

Takes no parameters.

list_topics

List topics

List topic names. Topics outside the allowlist are filtered out.

ParametersincludeInternal

describe_topic

Describe topic

Partitions, replicas, in-sync replicas, and non-default configs for a topic.

Parameterstopicrequired

topic_offsets

Topic offsets

Earliest and latest offsets per partition for a topic (message backlog view).

Parameterstopicrequired

list_consumer_groups

List consumer groups

List consumer groups and their protocol types.

Takes no parameters.

describe_consumer_group

Describe consumer group (with lag)

Describe a consumer group's state and compute per-partition and total lag across its topics.

ParametersgroupIdrequired

Version history

3
  1. v0.3.3LatestOct 26, 2026
  2. v0.3.0Sep 29, 2026
  3. v0.2.2Sep 16, 2026

Score

90% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts
  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listedRequired15 pts
  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts