kafka-mcp-server
Expose Apache Kafka operations (topics, produce, consume, consumer groups) as MCP tools.
Kafka MCP Server
A Model Context Protocol (MCP) server that exposes Apache Kafka operations as tools. Built with TypeScript, stdio transport, and the Confluent Kafka client.
Prerequisites
- Node.js 18.18+ or 20.9+
- A running Kafka-compatible broker (Apache Kafka, Redpanda, etc.)
Setup
npm install
npm run build
Configuration
Set the KAFKA_BROKERS environment variable (required):
export KAFKA_BROKERS=localhost:9092
Multiple brokers can be comma-separated: broker1:9092,broker2:9092.
Running
npm start
The server communicates over stdio using the MCP protocol.
Claude Code
Add the MCP server using the CLI:
claude mcp add kafka-mcp-server -e KAFKA_BROKERS=localhost:9092 node /path/to/kafka-mcp-server/dist/index.js
Or add to .mcp.json in your project root:
{
"mcpServers": {
"kafka": {
"command": "node",
"args": ["/path/to/kafka-mcp-server/dist/index.js"],
"env": {
"KAFKA_BROKERS": "localhost:9092"
}
}
}
}
Claude Desktop
Add to your Claude Desktop config (claude_desktop_config.json):
{
"mcpServers": {
"kafka": {
"command": "node",
"args": ["/path/to/kafka-mcp-server/dist/index.js"],
"env": {
"KAFKA_BROKERS": "localhost:9092"
}
}
}
}
Tools
Topics
| Tool | Description | Inputs |
|---|---|---|
list-topics | List all topics | none |
describe-topic | Get topic details (partitions, replicas) | topic |
create-topic | Create a new topic | topic, numPartitions (default 1), replicationFactor (default 1) |
delete-topic | Delete a topic | topic |
Produce / Consume
| Tool | Description | Inputs |
|---|---|---|
produce | Send a message to a topic | topic, value, key (optional) |
consume | Read messages from a topic | topic, maxMessages (default 10), timeout (default 5000ms) |
The consume tool creates an ephemeral consumer that reads from the earliest offset without committing. It disconnects after reaching maxMessages or the timeout.
Cluster
| Tool | Description | Inputs |
|---|---|---|
get-cluster-info | Get broker information | none |
list-consumer-groups | List all consumer groups | none |
describe-consumer-group | Get consumer group details | groupId |
Development
npm run build # Compile TypeScript
npm start # Run the server
npm run lint # Run ESLint
npm run lint:fix # Run ESLint with auto-fix
npm run format # Format code with Prettier
npm run format:check # Check formatting
Похожие серверы
Scout Monitoring MCP
спонсорPut performance and error data directly in the hands of your AI assistant.
Alpha Vantage MCP Server
спонсорAccess financial market data: realtime & historical stock, ETF, options, forex, crypto, commodities, fundamentals, technical indicators, & more
Image MCP Server
An MCP server for AI image generation using OpenAI and Replicate APIs.
oclif MCP Server Plugin
An oclif CLI plugin that automatically discovers and serves commands via the Model Context Protocol (MCP).
FastAPI MCP Server
A MCP server implementation using the FastAPI framework, configurable via environment variables.
agent smith
Auto-generate AGENTS.md from your codebase
MCP OpenAPI Connector
Connect to any OpenAPI-based API with built-in OAuth2 authentication management.
Data Structure Protocol (DSP)
Graph-based long-term memory skill for AI (LLM) coding agents — faster context, fewer tokens, safer refactors
Apple Doc MCP
Search Apple's Developer Documentation with smart search and wildcard support.
Databutton
An MCP server for initial app planning and creating a good starting point for an app.
TradingCyborg MCP Server
A professional trading server with over 26 tools for Bybit API integration.
Docfork
Provides up-to-date documentation for over 9000 libraries directly within AI code editors.