1
Add it to Claude Code
claude mcp add kafka-mcp-server -- uv run python -m app.mainEnvironment Variables
Set these before running Kafka MCP Server.
VariableDescriptionRequired
FASTMCP_SERVER_HOSTHost address for the MCP serverNoFASTMCP_SERVER_PORTPort for the MCP serverNoMCP_URLURL for the MCP SSE endpointNoKAFKA_BOOTSTRAP_SERVERSDefault bootstrap servers for Kafka connectionNoAvailable 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.connectioncreate_topicCreates a new Kafka topic with optional configurations.connectionpayloaddelete_topicDeletes a Kafka topic by name.connectionnametopic_configsFetches configuration values for a specific topic.connectionnametopic_retentionReturns the retention.ms setting for a topic.connectionnametail_messagesReads the most recent messages for a topic.connectionnamepayloadlive_messagesCollects a short live stream of messages from a topic.connectionnamepayloadlist_consumer_groupsLists consumer groups with their state and member count.connectionconsumer_group_lagComputes lag per partition for a specific consumer group.connectiongroup_idcluster_infoReturns broker and controller metadata for the cluster.connectionlist_kafka_usersLists locally stored Kafka user entries.upsert_kafka_userCreates or updates a local Kafka user entry.userdelete_kafka_userDeletes a local Kafka user entry.usernameTry 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.