Skip to main content
Glama

mcp-kafka

CI License: MIT

一个面向 Apache KafkaModel Context Protocol 服务器。它让支持 MCP 的客户端(Claude Desktop、Claude Code 等)能够监控和管理 Kafka 集群——主题、分区、配置和消费者组(含 consumer lag)——行为完全由标志(flag)控制。

默认安全:服务以只读模式启动,可通过主题 allowlist 限定范围,可让内部/关键主题不被修改,并且破坏性操作被放在显式 opt-in 之后。

功能

  • 监控 — 集群/broker 信息、主题元数据和偏移量、消费者组,以及每个分区 + 总体统计的 consumer lag(消费滞后)

  • 管理 — 创建主题、增加分区、更改主题配置、重置消费组偏移量;删除主题/消费者组(admin 模式)。

  • 访问模式 —- read-onlyread-writeadmin,分层设计,任何模式都不会暴露其层级以上的工具。

  • 安全标志 — 主题 allowlist、保护内部/关键主题、删除开关、dry-run,以及 JSON 审计日志(见下文)。

  • 认证 — 明文、TLS 和 SASL(PLAIN / SCRAM-SHA-256 / SCRAM-SHA-512)。

Related MCP server: Kafka MCP Server

安全模型

关注项

标志

默认值

作用

服务器能做什么?

KAFKA_MODE

read-only

read-only 只暴露监控;read-write 增加管理;admin 增加删除。高于当前模式的工具永远不会注册

哪些主题在范围内?

KAFKA_TOPIC_ALLOWLIST

(全部)

设置后,对范围外其他主题的操作会被拒绝。

保护内部主题线程

KAFKA_PROTECT_INTERNAL_TOPICS

true

_ 开头的主题可以读,但绝不能改。

保护指定主题

KAFKA_PROTECTED_TOPICS

(无)

追加的永久只读主题。

是否可以删除?

KAFKA_ALLOW_DELETE

false

delete_topic / delete_consumer_group 需要此开关 admin 模式。

不真正触碰集群地预览

KAFKA_DRY_RUN

false

写/管理工具先校验并记录意图,然后返回。

审计追踪

KAFKA_AUDIT_LOG

true

每次受控操作都会向 stderr 输出一行 JSON。

工具

读取read-only+):cluster_infolist_topicsdescribe_topictopic_offsetslist_consumer_groupsdescribe_consumer_group(含 lag)

写入read-write+):create_topiccreate_partitionsalter_topic_configreset_consumer_group_offsets

管理admin):delete_topicdelete_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": "…"
      }
    }
  }
}

示例提示词

  • "当前哪些消费者组的 lag 最严重?"

  • "描述 orders 主题并展示其偏移量。"

  • "创建一个 6 个分区、保留 7 天的 events 主题。"(需要 read-write

开发

npm run dev
npm test
npm run typecheck

发布

本服务器提供了官方 MCP 注册表所需的 server.json,以及用于 npm 所有权验证的 mcpName。发布到 npm 并在 MCP 注册表、Smithery、Glama、Cursor 和 PulseMCP 上列出,请参阅 PUBLISHING.md

许可证

MIT

Install Server
A
license - permissive license
A
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    An 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
  • A
    license
    B
    quality
    C
    maintenance
    MCP server for Apache Kafka that allows LLM agents to inspect topics, consumer groups, and safely manage offsets (reset, rewind).
    16
    12
    Apache 2.0
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables interaction with Kafka clusters via MCP, supporting topic management (list, create, delete, inspect), connection initialization, and more through natural language.
    1
    Apache 2.0

View all related MCP servers

Related MCP Connectors

  • Managed Keycloak from any MCP client: clusters, realms, apps, SSO, users, domains, audit events.

  • Remote MCP for A2A caller identity, scope policy, verdict receipts, and audit history.

  • The official MCP Server from Mia-Platform to interact with Mia-Platform Console

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dockndevai/mcp-kafka'

If you have feedback or need assistance with the MCP directory API, please join our Discord server