Skip to main content

KafkaMCP

Secure, vendor-neutral Kafka operations for AI agents

GoLicenseMCPDefault ≀15 tools
go install github.com/josedab/kafkamcp/cmd/kafkamcp@latest

How It Works

Three steps to give your AI agents full Kafka access.

1

Install

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

Single Go binary, no JVM or CGO. Signed Docker images and pre-built binaries begin with the first tagged release.

2

Configure

kafkamcp init --output kafkamcp.yaml

Point it at your Kafka clusters. Add Schema Registry, access policies, and audit logging as needed.

3

Connect

kafkamcp --config kafkamcp.yaml

Wire it into Claude Desktop, LangChain, CrewAI, or any MCP-compatible client. Agents get instant Kafka access.

Why KafkaMCP

Everything agents need to work with Kafka β€” built into a single server.

πŸ” Discover

Agents list topics, browse schemas, inspect consumer groups, and explore cluster topology β€” with zero prior knowledge.

πŸ“¨ Consume & Produce

Read messages with flexible positioning (offset, timestamp, latest) and publish with delivery confirmation and schema validation.

πŸ”’ Secure by Default

Per-agent access control with default-deny policies, rate limiting, TLS 1.3, and a full audit trail of every interaction.

πŸ“‹ Schema-Aware

Auto-discovers Avro, Protobuf, and JSON schemas from Schema Registry. Agents understand message structure without human annotation.

πŸ—οΈ Multi-Cluster

Connect to multiple Kafka clusters. Each tool accepts a cluster parameter. Agents discover clusters via MCP resources.

πŸ“Š Observable

Prometheus metrics, OpenTelemetry tracing, Grafana dashboards, and a built-in web UI for real-time monitoring.

Your Agent, Connected to Kafka

Once KafkaMCP is running, agents interact with Kafka using natural language.

"List all Kafka topics and their partition counts"
kafka_list_topics β€” Discover your entire Kafka topology
"Show me the last 10 messages from orders.created"
kafka_consume β€” Read messages with flexible positioning
"What's the lag on the order-processor consumer group?"
kafka_describe_consumer_group β€” Monitor consumer health and lag
"Analyze the dead-letter queue for error patterns"
kafka_analyze_dlq β€” Categorize and diagnose DLQ errors

Read-only by default (≀15 tools in core-read pack). Additional packs β€” ops-write and governance β€” unlock real, guarded mutations and policy controls behind approval enforcement. Full tool catalog and 9 MCP resources cover discovery, consumption, schema management, consumer groups, connectors, and more.

kafkamcp.yaml
server:
  transport: stdio

clusters:
  - name: production
    bootstrap_servers: "broker:9092"
    default: true
    schema_registry:
      url: "http://schema-registry:8081"

policies:
  default_deny: true
  agents:
    - id: "my-agent"
      topics:
        - pattern: "orders.*"
          permissions: [read, write]
      rate_limit:
        requests_per_minute: 120

audit:
  enabled: true

Architecture

A purpose-built bridge between AI agents and Apache Kafka.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  AI Agents (Claude, LangChain, CrewAI, AutoGen, Custom)  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚ stdio               β”‚ SSE / HTTP
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   KafkaMCP Server                         β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚ ≀15     β”‚ β”‚ 18      β”‚ β”‚ Auth β”‚ β”‚ Rate   β”‚ β”‚ Audit  β”‚ β”‚
β”‚  β”‚ Tools * β”‚ β”‚ Rsrcs   β”‚ β”‚Engineβ”‚ β”‚Limiter β”‚ β”‚ Logger β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚       └───────────┼──────────────────────────────────────│
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚  Kafka Client (franz-go) β”‚ Schema Registry β”‚ Connectβ”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
     β–Ό              β–Ό              β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Kafka  β”‚  β”‚  Schema   β”‚  β”‚  Kafka   β”‚
β”‚ Brokers β”‚  β”‚ Registry  β”‚  β”‚ Connect  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
* Default core-read pack. ops-write/governance packs available.