Kafka Mcp
API | MCP Server | A2A Agent
Apache Kafka API + MCP Server + A2A Agent for the Arbora ecosystem.
Version: 0.5.0
Documentation — Installation, deployment, usage across the API, CLI, and MCP interfaces, and guidance for provisioning the Apache Kafka platform are maintained in the official documentation.
kafka-mcp wraps the Apache Kafka administration and data-plane surface with typed,
deterministic tools an agent or policy router calls. It speaks to the Confluent REST
Proxy by default and ships an optional native (direct-to-broker) client and a
Pydantic-AI agent server.
What it provides
KafkaApi(kafka_mcp.api.api_client_kafka) — arequests-based REST facade over the Confluent REST Proxy v3 (with v2 consumer helpers), organized by Kafka resource: clusters, topics, partitions, records, consumer groups, brokers, and ACLs. The active cluster id resolves lazily unlessKAFKA_CLUSTER_IDpins it.- Six MCP tools (
kafka-mcpconsole script):kafka_topics,kafka_partitions,kafka_records,kafka_groups,kafka_cluster, and the optional nativekafka_native. Seedocs/overview.mdfor the full action surface. - An A2A agent server (
kafka-agentconsole script) — a Pydantic-AI graph agent wired to the MCP server viaMCP_URL.
Environment Variables
Package environment variables
| Variable | Example | Description |
|---|---|---|
KAFKA_BOOTSTRAP_SERVERS |
localhost:9092 |
|
KAFKA_REST_URL |
http://localhost:8082 |
Confluent REST Proxy base URL |
KAFKA_CLUSTER_ID |
— | Pin the cluster id (else the first cluster is cached) |
KAFKA_TOKEN |
secret-injected | Bearer token for the REST Proxy |
KAFKA_USERNAME |
— | Basic-auth user (optional) |
KAFKA_PASSWORD |
secret-injected | Basic-auth password (optional) |
KAFKA_REST_TLS_PROFILE |
— | Optional named profile from the agent-connector-sdk TLS catalog |
KAFKA_REST_TLS_PROFILE_REF |
— | Optional runtime secret ref containing a TLS profile |
KAFKA_CONNECT_URL |
http://localhost:8083 |
Kafka Connect worker REST base URL |
KAFKA_CONNECT_TOKEN |
secret-injected | Bearer token for Connect REST (no built-in auth upstream; optional) |
KAFKA_CONNECT_USERNAME |
— | Basic-auth user (optional) |
KAFKA_CONNECT_PASSWORD |
secret-injected | Basic-auth password (optional) |
KAFKA_CONNECT_TLS_PROFILE |
— | Optional named profile from the agent-connector-sdk TLS catalog |
KAFKA_CONNECT_TLS_PROFILE_REF |
— | Optional runtime secret ref containing a TLS profile |
KAFKATOOL |
True |
|
KAFKA_CONNECTTOOL |
True |
|
KAFKA_CDCTOOL |
True |
Inherited agent-connector-sdk variables (apply to every connector)
| Variable | Example | Description |
|---|---|---|
TRANSPORT |
stdio |
MCP transport: stdio | streamable-http | sse |
HOST |
127.0.0.1 |
Loopback bind host (set an authenticated ingress explicitly) |
PORT |
8000 |
Bind port (HTTP transports) |
MCP_ENABLED_TOOLS |
— | Comma-separated tool allow-list |
MCP_DISABLED_TOOLS |
— | Comma-separated tool deny-list |
MCP_ENABLED_TAGS |
— | Comma-separated tag allow-list |
MCP_DISABLED_TAGS |
— | Comma-separated tag deny-list |
EUNOMIA_TYPE |
none |
Authorization mode: none | embedded | remote |
EUNOMIA_POLICY_FILE |
mcp_policies.json |
Embedded Eunomia policy file |
EUNOMIA_REMOTE_URL |
— | Remote Eunomia authorization server URL |
ENABLE_OTEL |
False |
Enable OpenTelemetry export |
OTEL_EXPORTER_OTLP_ENDPOINT |
— | OTLP collector endpoint |
MCP_CLIENT_AUTH |
— | Outbound MCP child auth: oidc-client-credentials | basic | none |
OIDC_CLIENT_ID |
— | OIDC client id (service-account auth) |
OIDC_CLIENT_SECRET_REF |
secret://identity/oidc-client-secret |
Runtime secret reference for the OIDC service account |
MCP_BASIC_AUTH_USERNAME |
— | HTTP Basic username (MCP_CLIENT_AUTH=basic) |
MCP_BASIC_AUTH_PASSWORD_REF |
secret://identity/mcp-basic-password |
Runtime secret reference for HTTP Basic auth (MCP_CLIENT_AUTH=basic) |
DEBUG |
False |
Verbose logging |
PYTHONUNBUFFERED |
1 |
Unbuffered stdout (recommended in containers) |
MCP_URL |
http://localhost:8000/mcp |
URL of the MCP server the agent connects to |
PROVIDER |
— | Operator-configured LLM provider for the agent |
MODEL_ID |
— | Operator-configured model id for the agent |
ENABLE_WEB_UI |
True |
Serve the AG-UI web interface |
17 package + 23 inherited variable(s). Auto-generated from .env.example + the shared agent-connector-sdk set — do not edit.
Connection & credentials (Confluent REST Proxy)
| Var | Default | Meaning |
|---|---|---|
KAFKA_REST_URL |
http://localhost:8082 |
Confluent REST Proxy base URL |
KAFKA_CLUSTER_ID |
(auto) | Pin the cluster id (else the first cluster is cached) |
KAFKA_TOKEN |
(empty) | Bearer token for the REST Proxy |
KAFKA_USERNAME |
(empty) | Basic-auth user (optional) |
KAFKA_PASSWORD |
(empty) | Basic-auth password (optional) |
KAFKA_REST_TLS_PROFILE |
(system trust) | Optional named profile from the agent-connector-sdk TLS catalog |
KAFKA_REST_TLS_PROFILE_REF |
(empty) | Runtime secret ref containing a TLS profile |
Native client (optional kafka-mcp[native] extra)
| Var | Default | Meaning |
|---|---|---|
KAFKA_BOOTSTRAP_SERVERS |
localhost:9092 |
Broker bootstrap servers for the native (direct-to-broker) client |
MCP server / transport
| Var | Default | Meaning |
|---|---|---|
TRANSPORT |
stdio |
stdio, streamable-http, or sse |
HOST |
0.0.0.0 |
Bind host (HTTP transports) |
PORT |
8000 |
Bind port (HTTP transports) |
MCP_TOOL_MODE |
condensed |
Tool surface: condensed, verbose, or both |
Tool toggles
| Var | Default | Meaning |
|---|---|---|
KAFKATOOL |
True |
Register the Kafka tool set (set False to disable) |
Copy .env.example to .env and populate only what the operator use; blank
connector credentials leave the corresponding surface inactive.
Installation
Pick the extra that matches what the operator want to run:
| Extra | Installs | Use when |
|---|---|---|
kafka-mcp[mcp] |
Connector-focused MCP server (agent-connector-sdk[mcp] — FastMCP/FastAPI + epistemic-graph[full]) |
The operator only run the MCP server (smallest install / image) |
kafka-mcp[agent] |
Agent runtime (agent-connector-sdk[agent-runtime,logfire] — model orchestration + epistemic-graph[full]) |
The operator run the integrated agent |
kafka-mcp[all] |
Everything (mcp + agent + logfire) |
Development / both surfaces |
# Connector-focused MCP server (includes the shared graph engine)
uv pip install "kafka-mcp[mcp]"
# Agent runtime (adds model orchestration to the shared graph engine)
uv pip install "kafka-mcp[agent]"
# Everything (development)
uv pip install "kafka-mcp[all]" # or: python -m pip install "kafka-mcp[all]"
kafka-mcp # stdio MCP server (default transport)
kafka-mcp --transport streamable-http --host 0.0.0.0 --port 8000
Run the agent server against a live MCP server:
kafka-agent --mcp-url http://localhost:8000/mcp --host 0.0.0.0 --port 8080
Container images (:mcp vs :agent)
One multi-stage docker/Dockerfile builds two right-sized images, selected by --target:
| Image tag | Build target | Contents | Entrypoint |
|---|---|---|---|
example/kafka-mcp:mcp |
--target mcp |
kafka-mcp[mcp] — connector-focused, includes epistemic-graph[full]; no model-orchestration stack |
kafka-mcp |
example/kafka-mcp@sha256:<digest> |
--target agent (default) |
kafka-mcp[agent] — agent runtime, model orchestration + epistemic-graph[full] |
kafka-agent |
docker build --target mcp -t example/kafka-mcp:mcp docker/ # connector-focused MCP server
docker build --target agent -t example/kafka-mcp:agent-local docker/ # agent runtime
Knowledge-graph database (epistemic-graph)
Both [mcp] and [agent] carry the epistemic-graph engine through the required
Agent Utilities core dependency (epistemic-graph[full]). The [mcp] extra keeps
the server connector-focused; [agent] also enables model orchestration. Local
deployments can use the bundled engine. For production or shared state, run
epistemic-graph as a dedicated database service and configure the runtime to use it.
Deployment recipes (single-node + Raft HA), connection configuration, and architecture
diagrams are documented in the
epistemic-graph deployment guide.
MCP Configuration Examples
Install the connector-focused
[mcp]extra. Examples usekafka-mcp[mcp]to add FastMCP / FastAPI throughagent-connector-sdk[mcp]; the required Agent Utilities core still carriesepistemic-graph[full]. The[agent-runtime]extra additionally enables model orchestration.
stdio Transport (local IDEs — Cursor, Claude Desktop, VS Code)
{
"mcpServers": {
"kafka-mcp": {
"command": "uvx",
"args": [
"--from",
"kafka-mcp[mcp]",
"kafka-mcp"
],
"env": {
"KAFKATOOL": "True",
"KAFKA_BOOTSTRAP_SERVERS": "localhost:9092",
"KAFKA_CDCTOOL": "True",
"KAFKA_CONNECTTOOL": "True",
"KAFKA_CONNECT_URL": "http://localhost:8083",
"KAFKA_REST_URL": "http://localhost:8082"
}
}
}
}
Runtime references require an alias-aware launcher such as Arbora. Other launchers must omit those entries and inject the resolved values through their own runtime secret boundary.
Streamable-HTTP Transport (networked / production)
{
"mcpServers": {
"kafka-mcp": {
"command": "uvx",
"args": [
"--from",
"kafka-mcp[mcp]",
"kafka-mcp",
"--transport",
"streamable-http",
"--port",
"8000"
],
"env": {
"TRANSPORT": "streamable-http",
"HOST": "127.0.0.1",
"PORT": "8000",
"KAFKATOOL": "True",
"KAFKA_BOOTSTRAP_SERVERS": "localhost:9092",
"KAFKA_CDCTOOL": "True",
"KAFKA_CONNECTTOOL": "True",
"KAFKA_CONNECT_URL": "http://localhost:8083",
"KAFKA_REST_URL": "http://localhost:8082"
}
}
}
}
Alternatively, connect to a pre-deployed Streamable-HTTP instance by url:
{
"mcpServers": {
"kafka-mcp": {
"url": "http://localhost:8000/kafka-mcp/mcp"
}
}
}
Run a reviewed container image as a least-privilege stdio child (no listener or published port):
docker run -i --rm \
--read-only \
--cap-drop=ALL \
--security-opt=no-new-privileges \
--pids-limit=256 \
--tmpfs /tmp:rw,noexec,nosuid,nodev,size=64m \
-e TRANSPORT=stdio \
-e KAFKATOOL=True \
-e KAFKA_BOOTSTRAP_SERVERS=localhost:9092 \
-e KAFKA_CDCTOOL=True \
-e KAFKA_CONNECTTOOL=True \
-e KAFKA_CONNECT_URL=http://localhost:8083 \
-e KAFKA_REST_URL=http://localhost:8082 \
registry.example.invalid/kafka-mcp@sha256:<digest> kafka-mcp
For containerized network HTTP, supply an authenticated TLS ingress (or
direct server TLS), exact MCP_ALLOWED_HOSTS, and an exact trusted-proxy
CIDR policy through the operator-owned deployment profile. The generator
does not emit an unauthenticated non-loopback listener.
Auto-generated from the code-read env surface (package vars) — do not edit.
Additional Deployment Options
kafka-mcp can run as a local stdio process or container, or behind a remote
network boundary. The
Deployment guide carries
the detailed transport contract.
- Local container — launch a reviewed immutable image as a least-privilege stdio child with no listener or published port.
- Remote URL — connect through an operator-supplied authenticated HTTPS
ingress. Keep its URL, outbound identity references, trust profile, and exact
MCP_ALLOWED_HOSTSinAgentConfig.
Available MCP Tools
Auto-generated — do not edit between the markers below.
Intent tools
| MCP Tool | Kind | Description |
|---|---|---|
kafka_cdc_lag |
intent | Report consumer-group lag for a CDC-reading group. |
kafka_cdc_slot_health |
intent | Report what Kafka Connect exposes about a source connector's slot. |
kafka_cdc_topic_map |
intent | Resolve a Debezium connector's declared source tables to CDC topics. |
kafka_cluster |
intent | Inspect clusters/brokers and manage ACLs via the REST Proxy. |
kafka_connect |
intent | Manage Kafka Connect connectors via the worker's REST API (:8083). |
kafka_connect_plugins |
intent | List connector plugins available on the Kafka Connect worker's classpath. |
kafka_groups |
intent | Inspect Kafka consumer groups and their lag. |
kafka_ingest_catalog |
intent | Ingest the live Kafka topology into the knowledge graph (Wire-First). |
kafka_ingest_cdc_topology |
intent | Ingest the live Kafka Connect CDC topology into the knowledge graph. |
kafka_native |
intent | Produce/consume/admin directly against brokers (native client). |
kafka_partitions |
intent | List partitions for a topic or get a single partition. |
kafka_records |
intent | Produce or consume records via the Confluent REST Proxy. |
kafka_topics |
intent | Manage Kafka topics via the Confluent REST Proxy. |
13 intent tool(s) · 0 operation(s). Call an operation as act(action='<operation>', params={...}) (ask for reads); find(action='describe', params={'action': '<operation>'}) returns its arguments. An operation is enabled unless its <DOMAIN>TOOL toggle is set false. Auto-generated — do not edit.
Documentation
The complete documentation is published as the official documentation site and is the recommended reference for installation, deployment, and day-to-day operation.
| Page | Contents |
|---|---|
| Installation | pip, source, extras, prebuilt Docker image |
| Deployment | run the MCP and agent servers, Compose, Caddy + Technitium, env config |
| Usage | the MCP tools, the KafkaApi client, the CLI |
| Backing Platform | deploy Apache Kafka with Docker |
| Overview | tools, REST contract, native client |
| Architecture | the layered REST client and tool surface |
| Concepts | concept registry (CONCEPT:KAFKA-*) |
AGENTS.md is the canonical contributor/agent guidance.
Deploy with agent-connector-sdk-deployment
Provision this package with the consolidated agent-connector-sdk-deployment
workflow. It selects an installed-package, editable-source, or immutable-container
path; records only runtime secret and TLS-profile references in AgentConfig; and
runs doctor, registration, policy, observability, and rollback gates. Ask your agent
to "deploy kafka-mcp with agent-connector-sdk-deployment".
| Install mode | Command |
|---|---|
| Installed package | uv tool install "kafka-mcp[mcp]", then run kafka-mcp |
| Editable source | uv pip install -e ".[agent]", then run kafka-mcp |
| Immutable container | deploy registry.example.invalid/kafka-mcp@sha256:<digest> through the operator-selected orchestrator |
The repository embeds no deployment profile, credential value, certificate path, or
environment-specific endpoint. Supply those at runtime through AgentConfig and the
configured secret provider.
Governed capability contract
This package ships a compact canonical skill surface with specialist procedures
kept as referenced workflows. The current MCP tools, skill metadata,
connector_manifest.yml, ontology, mappings, shapes, fixtures, migrations,
tool-schema fingerprints, and certification metadata form one versioned
capability contract. Validate them together; do not rely on stale tool names or
historical per-task skill wrappers.
Runtime endpoints, credentials, certificate trust, tenant identity, retention, and observability policy are deployment inputs and are never packaged values. See Configuration, trust, and privacy before enabling a network transport, connector ingestion, Arbora delegation, or trace export.
Metadata
Release files for kafka-mcp 2.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| kafka_mcp-2.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Release files / kafka_mcp-2.4.0-py3-none-any.whl
| Download URL | kafka_mcp-2.4.0-py3-none-any.whl |
|---|---|
| Size | 62.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
405fe92fe65416a3be38a4049fcab31fe4bfe8058678532a61b4a372e5721c7b
|
|
BLAKE2b-256 checksum How to use checksums |
f722f23b28f5a35b7525587d1c25ed6bfa051322aa515062c79aa83652bffef6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Security for kafka-mcp 2.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.