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.10.0.tar.gz (26.5 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.10.0-py3-none-any.whl (29.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kafka_mcp-0.10.0.tar.gz
  • Upload date:
  • Size: 26.5 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.10.0.tar.gz
Algorithm Hash digest
SHA256 abe391364e196b5119ff857d8a4ee0cd0d2dc9cc85e4ee237f6609955cdd8d7c
MD5 2a51b1f8d49a5f8ef7ef5e36035c4f55
BLAKE2b-256 a3a7e7a026a74b9c1ebe8cdb25f9c21a1cfd98c6e0ca4e1a7e4058cfdde1e092

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kafka_mcp-0.10.0-py3-none-any.whl
  • Upload date:
  • Size: 29.3 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.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 47d93eedc5ec3d8182c7946cb21395acacc10d51c06e0a0312fd4bcef5e9815c
MD5 3ecad395b11658819015b4f79ae63174
BLAKE2b-256 1f1a957fc4fa386e47755d3398d4436224ea35db2356fb7c7f99a94d102c9ef6

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