npm @dockndevai/mcp-kafkastdioMITupdated 9d ago
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.
What can you do with mcp kafka?
mcp-kafka
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
| Concern | Flag | Default | Effect |
|---|---|---|---|
| What can the server do? | KAFKA_MODE |
read-only |
read-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 topics | KAFKA_PROTECT_INTERNAL_TOPICS |
true |
Topics starting with _ can be read but never mutated. |
| Protect specific topics | KAFKA_PROTECTED_TOPICS |
(none) | Additional read-only-forever topics. |
| Can it delete? | KAFKA_ALLOW_DELETE |
false |
delete_topic / delete_consumer_group need this and admin mode. |
| Preview without touching the cluster | KAFKA_DRY_RUN |
false |
Write/admin tools validate + log intent, then return. |
| Audit trail | KAFKA_AUDIT_LOG |
true |
Emits a JSON line to stderr per guarded operation. |
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)
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:
{
"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:
[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:
{
"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
orderstopic and show its offsets." - "Create a topic
eventswith 6 partitions and 7-day retention." (needsread-write)
Run from source (development)
Prefer the published package above. To run from a clone:
npm install
npm run build
node dist/index.js # with the environment variables set
Develop
npm run dev
npm test
npm 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
Install
Add mcp kafka to your client. Pick the one you use.
claude mcp add mcp-kafka -- npx -y @dockndevai/mcp-kafkacodex mcp add mcp-kafka -- npx -y @dockndevai/mcp-kafkaamp mcp add mcp-kafka -- npx -y @dockndevai/mcp-kafka{
"mcpServers": {
"mcp-kafka": {
"command": "npx",
"args": [
"-y",
"@dockndevai/mcp-kafka"
]
}
}
}Add to `claude_desktop_config.json`, then restart Claude Desktop.
{
"mcpServers": {
"mcp-kafka": {
"command": "npx",
"args": [
"-y",
"@dockndevai/mcp-kafka"
]
}
}
}Add to `~/.cursor/mcp.json`, or `.cursor/mcp.json` for a single project.
code --add-mcp '{"name":"mcp-kafka","command":"npx","args":["-y","@dockndevai/mcp-kafka"]}'Or add the block manually to `.vscode/mcp.json` under `servers`.
{
"mcpServers": {
"mcp-kafka": {
"command": "npx",
"args": [
"-y",
"@dockndevai/mcp-kafka"
]
}
}
}Add to `~/.codeium/windsurf/mcp_config.json`.
{
"mcpServers": {
"mcp-kafka": {
"command": "npx",
"args": [
"-y",
"@dockndevai/mcp-kafka"
]
}
}
}Add to `cline_mcp_settings.json` via the MCP Servers panel.
{
"mcpServers": {
"mcp-kafka": {
"command": "npx",
"args": [
"-y",
"@dockndevai/mcp-kafka"
]
}
}
}Add to `~/.gemini/settings.json`.
{
"mcpServers": {
"mcp-kafka": {
"type": "local",
"command": "npx",
"args": [
"-y",
"@dockndevai/mcp-kafka"
],
"tools": [
"*"
]
}
}
}Add to `~/.copilot/mcp-config.json`, or run `/mcp add` inside the CLI.
{
"context_servers": {
"mcp-kafka": {
"command": {
"path": "npx",
"args": [
"-y",
"@dockndevai/mcp-kafka"
]
}
}
}
}Add to your Zed `settings.json`.
npx -y @dockndevai/mcp-kafkaRun `goose configure`, choose **Add Extension → Command-line Extension**, and paste this command.
Score
39 / 100
Incomplete
- Documentation25/25
- Maintenance25/25
- Trust13/20
- Capability0/15
- Install experience12/15
- Documents what it does and how to connect
- Has a resolvable package or endpoint
- Exposes at least one tool, prompt or resource
- README has substantive content
- Includes a code example
- Documents its configuration
- Mentions credentials or security posture
- Last commit 2 days ago
- Has a release history
- Repository is not archived
- Licensed MIT
- Namespace verified in the official MCP registry
- Claimed by its owner
- Published under an organisation
- 0 tool(s) documented
- Provides prompt templates
- Provides resources
- 12 documented install method(s)
- Published to a package registry
- Offers a hosted endpoint — no local install
Version history
| Versions | Published |
|---|---|
| 0.1.2Latest | Aug 30, 2026 |
| 0.1.1 | Aug 28, 2026 |
| 0.1.0 | Aug 23, 2026 |