Skip to main content

Getting Started

Get KafkaMCP running and connected to your Kafka cluster in under 5 minutes.

Prerequisites

  • A running Kafka cluster (local or remote)
  • One of the following (choose your preferred install method):
    • Go 1.25+ (for source install)
    • Docker
    • Pre-built binary from GitHub Releases

Step 1: Install

:::warning Pre-release repository No signed binary or GHCR image has been published yet. Use Go Install or From Source today. The Binary and Docker commands below become available after the first tagged release. :::

go install github.com/josedab/kafkamcp/cmd/kafkamcp@latest

Step 2: Configure

Create a kafkamcp.yaml file:

server:
transport: stdio
log_level: info
# tool_packs defaults to [core-read] — ≤15 read-only tools.
# Guarded packs (ops-write/governance) require secure HTTP identity and a signing key.

clusters:
- name: local
bootstrap_servers: "localhost:9092"
security_protocol: PLAINTEXT
default: true

audit:
enabled: true
max_entries: 10000
tip

For Confluent Cloud, AWS MSK, or other managed Kafka services, see the configuration reference for SASL/TLS settings.

:::warning Guarded packs require a network transport ops-write and governance cannot be used with transport: stdio. To enable either pack you must:

  1. Switch to transport: sse or transport: streamable-http
  2. Configure a cryptographic identity provider (policies.identity.provider: static, oidc, or mtls)
  3. Set policies.default_deny: true
  4. Set KAFKAMCP_APPROVAL_SIGNING_KEY (≥32 bytes) in your environment

Every mutating tool will then require a short-lived, two-person approval grant before it executes. See the Security guide for the full approval workflow. :::

Step 3: Validate

Verify your configuration is correct:

kafkamcp validate --config kafkamcp.yaml

You should see:

Configuration is valid.

Step 4: Connect to an AI Agent

Claude Desktop

Add to your claude_desktop_config.json:

{
"mcpServers": {
"kafkamcp": {
"command": "kafkamcp",
"args": ["--config", "/path/to/kafkamcp.yaml"]
}
}
}

Restart Claude Desktop. You should see "KafkaMCP" in the available MCP servers.

Other MCP Clients

For any MCP-compatible client, start KafkaMCP in stdio mode:

kafkamcp --config kafkamcp.yaml

For remote agents, use SSE transport:

# In kafkamcp.yaml, set:
# server:
# transport: sse
# host: 0.0.0.0
# port: 3100

kafkamcp --config kafkamcp.yaml
# Agents connect to http://localhost:3100

Step 5: Try It

Once connected, ask your agent:

"List all Kafka topics in my cluster"

The agent will call kafka_list_topics and return a list of all topics with their partition counts, replication factors, and message count estimates.

Try more:

"Show me the last 5 messages from my-topic"

"Describe the consumer group my-consumer-group"

"What schemas are registered in the Schema Registry?"

What's Next?