mcp-kafka
mcp-kafka
一个面向 Apache Kafka 的 Model Context Protocol 服务器。它让支持 MCP 的客户端(Claude Desktop、Claude Code 等)能够监控和管理 Kafka 集群——主题、分区、配置和消费者组(含 consumer lag)——行为完全由标志(flag)控制。
默认安全:服务以只读模式启动,可通过主题 allowlist 限定范围,可让内部/关键主题不被修改,并且破坏性操作被放在显式 opt-in 之后。
功能
监控 — 集群/broker 信息、主题元数据和偏移量、消费者组,以及每个分区 + 总体统计的 consumer lag(消费滞后)。
管理 — 创建主题、增加分区、更改主题配置、重置消费组偏移量;删除主题/消费者组(admin 模式)。
访问模式 —-
read-only→read-write→admin,分层设计,任何模式都不会暴露其层级以上的工具。安全标志 — 主题 allowlist、保护内部/关键主题、删除开关、dry-run,以及 JSON 审计日志(见下文)。
认证 — 明文、TLS 和 SASL(PLAIN / SCRAM-SHA-256 / SCRAM-SHA-512)。
Related MCP server: Kafka MCP Server
安全模型
关注项 | 标志 | 默认值 | 作用 |
服务器能做什么? |
|
|
|
哪些主题在范围内? |
| (全部) | 设置后,对范围外其他主题的操作会被拒绝。 |
保护内部主题线程 |
|
| 以 |
保护指定主题 |
| (无) | 追加的永久只读主题。 |
是否可以删除? |
|
|
|
不真正触碰集群地预览 |
|
| 写/管理工具先校验并记录意图,然后返回。 |
审计追踪 |
|
| 每次受控操作都会向 stderr 输出一行 JSON。 |
工具
读取(read-only+):cluster_info、list_topics、describe_topic、topic_offsets、list_consumer_groups、describe_consumer_group(含 lag)
写入(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": "…"
}
}
}
}示例提示词
"当前哪些消费者组的 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
Maintenance
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
AlicenseBqualityAmaintenanceAn MCP server implementation built to interact with Confluent Kafka and Confluent Cloud REST APIs.24465166MIT- 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).1612Apache 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
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
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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