← Back to Kafka MCP Server

Install Kafka MCP Server

Pick your client, copy the command, done.

1

Add it to Claude Code

claude mcp add kafka-mcp-server -- uv run python -m app.main

Environment Variables

Set these before running Kafka MCP Server.

VariableDescriptionRequired
FASTMCP_SERVER_HOSTHost address for the MCP serverNo
FASTMCP_SERVER_PORTPort for the MCP serverNo
MCP_URLURL for the MCP SSE endpointNo
KAFKA_BOOTSTRAP_SERVERSDefault bootstrap servers for Kafka connectionNo

Available Tools (14)

Once configured, Kafka MCP Server gives your AI agent access to:

healthReturns the health status of the server.
list_topicsLists Kafka topics with partition and replication information.
connection
create_topicCreates a new Kafka topic with optional configurations.
connectionpayload
delete_topicDeletes a Kafka topic by name.
connectionname
topic_configsFetches configuration values for a specific topic.
connectionname
topic_retentionReturns the retention.ms setting for a topic.
connectionname
tail_messagesReads the most recent messages for a topic.
connectionnamepayload
live_messagesCollects a short live stream of messages from a topic.
connectionnamepayload
list_consumer_groupsLists consumer groups with their state and member count.
connection
consumer_group_lagComputes lag per partition for a specific consumer group.
connectiongroup_id
cluster_infoReturns broker and controller metadata for the cluster.
connection
list_kafka_usersLists locally stored Kafka user entries.
upsert_kafka_userCreates or updates a local Kafka user entry.
user
delete_kafka_userDeletes a local Kafka user entry.
username

Try It Out

After setup, try these prompts with your AI agent:

List all topics currently available on my Kafka cluster.
Check the consumer group lag for the group 'analytics-processor'.
Tail the last 10 messages from the 'user-events' topic.
Create a new topic named 'test-topic' with 3 partitions.
Show me the cluster metadata and broker information.
Prerequisites & system requirements
  • An MCP-compatible client (Claude Code, Cursor, Windsurf, Claude Desktop, or Codex)
  • Python 3.8+ with pip installed

Keep this setup from going cold

Save the docs, env vars, and workflow around Kafka MCP Server in Conare so Claude Code, Codex, and Cursor remember it next time.

Remember this setup