mcp-kafka
mcp-kafka
Сервер Model Context Protocol для Apache Kafka. Он позволяет MCP-совместимому клиенту (Claude Desktop, Claude Code и т. д.) отслеживать и управлять кластерами Kafka — топиками, партициями, конфигурациями и группами потребителей (включая отставание) — с поведением, полностью управляемым флагами.
Безопасен по умолчанию: запускается в режиме только для чтения, может быть ограничен списком разрешённых топиков, защищает внутренние/критические топики от изменений и закрывает деструктивные операции за явным согласием.
Features
| ...... |
Мониторинг — информация о кластере/брокерах, метаданные топиков и офсеты, группы потребителей и отставание по каждой партии + общее отставание потребителей.
Управление — создание топиков, добавление партиций, изменение конфигураций топиков, сброс офсетов группы; удаление топиков/групп (admin).
Режимы доступа —
read-only→read-write→admin, выстроены так, что режим никогда не открывает инструменты выше своего уровня.Флаги безопасности — список разрешённых топиков, защищённые/внутренние топики, блокировка удаления, dry-run и запись аудита в JSON (см. ниже).
Аутентификация — без шифрования, TLS и SASL (PLAIN / SCRAM-SHA-256 / SCRAM-SHA-512).
Related MCP server: Kafka MCP Server
Security model
Вопрос | Флаг | По умолчанию | Действие |
Что может делать сервер? |
|
|
|
Какие топики находятся в зоне охвата? |
| (все) | Если список задан, операции с другими топиками отклоняются. |
Защита внутренних топиков |
|
| Топики, начинающиеся с |
Защита отдельных топиков |
| (нет) | Дополнительные топики, которые навсегда остаются только для чтения. |
Возможно ли удаление? |
|
|
|
Просмотр без изменений кластера |
|
| Инструменты записи/администрирования выполняют проверку и записывают намерение, затем просто завершаются. |
Журнал аудита |
|
| Для каждой защищаемой операции выводится JSON-строка в stderr. |
Tools
Чтение (read-only+): cluster_info, list_topics, describe_topic, topic_offsets, list_consumer_groups, describe_consumer_group (с лагом)
Запись (read-write+): create_topic, create_partitions, alter_topic_config, reset_consumer_group_offsets
Администрирование (admin): delete_topic, delete_consumer_group (оба требуют KAFKA_ALLOW_DELETE)
Использование с MCP-клиентом
Работает с Claude Code, Claude Desktop, Cursor, OpenAI Codex CLI, Windsurf, VS Code (Copilot) и любым другим MCP-клиентом — см. docs/CLIENTS.md для настройки под каждый клиент.
Установка
npm install
npm run buildЗапуск с Claude Desktop / Claude Code
{
"mcpServers": {
"kafka": {
"command": "node",
"args": ["/absolute/path/to/mcp-kafka/dist/index.js"],
"env": {
"KAFKA_BROKERS": "broker1:9092,broker2:9092",
"KAFKA_MODE": "read-only",
"KAFKA_SSL": "true",
"KAFKA_SASL_MECHANISM": "scram-sha-512",
"KAFKA_SASL_USERNAME": "mcp",
"KAFKA_SASL_PASSWORD": "…"
}
}
}
}Примеры запросов
"Какие группы потребителей сейчас имеют наибольшее отставание?"
"Опиши топик
ordersи покажи его офсеты.""Создай топик
eventsс 6 партициями и хранением в 7 дней." (требуетсяread-write)
Разработка
npm run dev
npm test
npm run typecheckПубликация
Сервер содержит server.json для официального реестра MCP и mcpName для проверки владения в npm. См. PUBLISHING.md для публикации в npm и добавлении в свой реестр MCP, Smithery, Glama, Cursor и PulseMCP.
Лицензия
MIT
Available Tools
6 toolscluster_infoCluster infoARead-onlyIdempotent
Describe the Kafka cluster: brokers, controller, and cluster id.
Inputs: no named parameters.
describe_consumer_groupDescribe consumer group (with lag)BRead-onlyIdempotent
Describe a consumer group's state and compute per-partition and total lag across its topics.
Inputs: groupId (required).
describe_topicDescribe topicCRead-onlyIdempotent
Partitions, replicas, in-sync replicas, and non-default configs for a topic.
Inputs: topic (required).
list_consumer_groupsList consumer groupsARead-onlyIdempotent
List consumer groups and their protocol types.
Inputs: no named parameters.
list_topicsList topicsBRead-onlyIdempotent
List topic names. Topics outside the allowlist are filtered out.
Inputs: includeInternal.
topic_offsetsTopic offsetsARead-onlyIdempotent
Earliest and latest offsets per partition for a topic (message backlog view).
Inputs: topic (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool targets a distinct resource+action: topic listing vs. topic detail vs. offset backlog, consumer group listing vs. group detail/lag, and cluster summary. The list_* vs describe_* split is crisp, and topic_offsets is clearly separated from describe_topic. No two tools could be reasonably confused.
Most tools follow a verb_noun pattern (list_topics, describe_topic, describe_consumer_group, list_consumer_groups), but topic_offsets and cluster_info use noun-phrase forms. The deviation is minor and still readable, and the overall style is snake_case and predictable.
Six tools is well-scoped for a read-only Kafka inspection server, covering the three core surfaces (topics, consumer groups, cluster) without redundancy. Each tool earns its place with no filler.
The read-only inspection surface is coherent and covers topic metadata, offset backlog, consumer group lag, and cluster state with no dead ends within its scope. Gaps exist for write/admin operations (create/delete topics, config changes) and message preview, but these appear intentionally out of scope.
Maintenance
Related MCP Connectors
Governed MCP gateway: one endpoint for your tools, with credential custody and audit log.
One MCP URL for all your connectors — scoped writes, enforced constraints, and a full audit trail.
Managed Keycloak from any MCP client: clusters, realms, apps, SSO, users, domains, audit events.
One MCP server for all your MCP servers: code mode, per-tool permissions, approvals and audit.
Related MCP Servers
AlicenseBqualityAmaintenanceAn MCP server implementation built to interact with Confluent Kafka and Confluent Cloud REST APIs.241,927 npm171MIT- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables interaction with Kafka clusters to manage topics, monitor consumer groups, and stream messages. It provides a comprehensive suite of tools for broker metadata inspection and local Kafka user management.MIT
- AlicenseBqualityCmaintenanceMCP server for Apache Kafka that allows LLM agents to inspect topics, consumer groups, and safely manage offsets (reset, rewind).1914Apache 2.0
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Kafka clusters via MCP, supporting topic management (list, create, delete, inspect), connection initialization, and more through natural language.1Apache 2.0