Kafka MCP Server
Overview
Kafka MCP Server is a Message Context Protocol (MCP) server that integrates with Apache Kafka, enabling publish and consume functionalities for large language models (LLM) and agentic applications.
To use Kafka MCP Server, clone the repository, set up a virtual environment, install the required dependencies, configure the .env file, and run the server using the main.py script.
- Publish messages to Kafka topics. - Consume messages from Kafka topics. - Supports multiple transport options (stdio, sse).
- Integrating AI models with Kafka for real-time data processing.
- Enabling communication between agentic applications and Kafka.
- Facilitating message handling in distributed systems.
Add to your AI client
Use these steps to connect Kafka MCP Server in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.
Cursor
Add this to your .cursor/mcp.json file in your project root, then restart Cursor.
.cursor/mcp.json
{
"mcpServers": {
"kafka-mcp-server-pavanjava": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-kafka-mcp-server-pavanjava"
]
}
}
}Claude Desktop
Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
{
"mcpServers": {
"kafka-mcp-server-pavanjava": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-kafka-mcp-server-pavanjava"
]
}
}
}Claude Code
Add this to your project's .mcp.json file. Claude Code will detect it automatically.
.mcp.json (project root)
{
"mcpServers": {
"kafka-mcp-server-pavanjava": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-kafka-mcp-server-pavanjava"
]
}
}
}VS Code (Copilot)
Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.
.vscode/mcp.json
{
"servers": {
"kafka-mcp-server-pavanjava": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-kafka-mcp-server-pavanjava"
]
}
}
}Windsurf
Add this to your Windsurf MCP config file, then restart Windsurf.
~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"kafka-mcp-server-pavanjava": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-kafka-mcp-server-pavanjava"
]
}
}
}Cline
Open Cline settings, navigate to MCP Servers, and add this server configuration.
Cline MCP Settings (via UI)
{
"mcpServers": {
"kafka-mcp-server-pavanjava": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-kafka-mcp-server-pavanjava"
]
}
}
}FAQ
What are the prerequisites for using Kafka MCP Server?
You need Python 3.8+, an Apache Kafka instance, and the required Python dependencies.
How do I run the server?
You can run the server using the command `python main.py --transport stdio`.
Can I customize the tool descriptions?
Yes, you can set custom descriptions in the `.env` file.