Skip to main content

Apache Kafka (REST Proxy / native) API + MCP Server + A2A Server for Agentic AI!

Project description

Kafka Mcp

API | MCP Server | A2A Agent

PyPI - Version MCP Server PyPI - Downloads GitHub Repo stars GitHub forks GitHub contributors PyPI - License GitHub GitHub last commit (by committer) GitHub pull requests GitHub closed pull requests GitHub issues GitHub top language GitHub language count GitHub repo size PyPI - Wheel PyPI - Implementation

Apache Kafka API + MCP Server + A2A Agent for the agent-utilities 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) — a requests-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 unless KAFKA_CLUSTER_ID pins it.
  • Six MCP tools (kafka-mcp console script): kafka_topics, kafka_partitions, kafka_records, kafka_groups, kafka_cluster, and the optional native kafka_native. See docs/overview.md for the full action surface.
  • An A2A agent server (kafka-agent console script) — a Pydantic-AI graph agent wired to the MCP server via MCP_URL.

Configuration (environment)

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_SSL_VERIFY True Verify TLS (set False for self-signed homelab)
KAFKATOOL True Register the Kafka tool set

The optional native client reads KAFKA_BOOTSTRAP_SERVERS (default localhost:9092) and requires the kafka-mcp[native] extra. Copy .env.example to .env and populate only what you use; blank connector credentials leave the corresponding surface inactive.

Install & run

pip install -e .
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

MCP config

Register in your client's mcp_config.json (tools surface as kafka_topics, kafka_records, kafka_groups, …). See kafka_mcp/mcp_config.json.

Additional Deployment Options

kafka-mcp can also run as a local container (Docker / Podman / uv) or be consumed from a remote deployment. The Deployment guide has full, copy-paste mcp_config.json for all four transports — stdio, streamable-http, local container / uv, and remote URL:

  • Local container / uv — launch the server from mcp_config.json via uvx, docker run, or podman run, or point at a local streamable-http container by url.
  • Remote URL — connect to a server deployed behind Caddy at http://kafka-mcp.arpa/mcp using the "url" key.

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kafka_mcp-0.7.0.tar.gz (25.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kafka_mcp-0.7.0-py3-none-any.whl (27.8 kB view details)

Uploaded Python 3

File details

Details for the file kafka_mcp-0.7.0.tar.gz.

File metadata

  • Download URL: kafka_mcp-0.7.0.tar.gz
  • Upload date:
  • Size: 25.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for kafka_mcp-0.7.0.tar.gz
Algorithm Hash digest
SHA256 bf1bdba9b64e601db5da7d418ce7677da6243e6ce4eec04c8d07d1cc59bf8726
MD5 ab5b7e39354d4cada06b2b3b2377fb90
BLAKE2b-256 959d2d175c2375d7d399460e0ee7c3ed88f19ea71261dc5eaeeb9e3215f71a5d

See more details on using hashes here.

File details

Details for the file kafka_mcp-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: kafka_mcp-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 27.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for kafka_mcp-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 af77413cbec266825ef62801a4207ce1240b8808a747bf60f2f908cb78d7f319
MD5 93fe4f370da6c75b839bd8cfcde38acf
BLAKE2b-256 c7d43f6801a2ce055be9bfe1d4ed71ab14d671e2ff5d29ef7c44e1c9746ee1cb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page