Skip to main content
Glama
pavanjava
by pavanjava

카프카 MCP 서버

LLM 및 Agentic 애플리케이션에 대한 게시 및 사용 기능을 제공하기 위해 Apache Kafka와 통합되는 MCP(Message Context Protocol) 서버입니다.

개요

이 프로젝트는 AI 모델이 표준화된 인터페이스를 통해 Kafka 토픽과 상호 작용할 수 있도록 하는 서버를 구현합니다. 다음을 지원합니다.

  • Kafka 주제에 메시지 게시

  • Kafka 토픽에서 메시지 사용

Related MCP server: KafkaIQ

필수 조건

  • 파이썬 3.8 이상

  • Apache Kafka 인스턴스

  • Python 종속성(설치 섹션 참조)

설치

  1. 저장소를 복제합니다.

    지엑스피1

  2. 가상 환경을 만들고 활성화하세요.

    python -m venv venv
    source venv/bin/activate  # On Windows, use: venv\Scripts\activate
  3. 필요한 종속성을 설치하세요:

    pip install -r requirements.txt

    requirements.txt가 없으면 다음 패키지를 설치하세요.

    pip install aiokafka python-dotenv pydantic-settings mcp-server

구성

프로젝트 루트에 다음 변수를 사용하여 .env 파일을 만듭니다.

# Kafka Configuration
KAFKA_BOOTSTRAP_SERVERS=localhost:9092
TOPIC_NAME=your-topic-name
IS_TOPIC_READ_FROM_BEGINNING=False
DEFAULT_GROUP_ID_FOR_CONSUMER=kafka-mcp-group

# Optional: Custom Tool Descriptions
# TOOL_PUBLISH_DESCRIPTION="Custom description for the publish tool"
# TOOL_CONSUME_DESCRIPTION="Custom description for the consume tool"

용법

서버 실행

제공된 main.py 스크립트를 사용하여 서버를 실행할 수 있습니다.

python main.py --transport stdio

이용 가능한 교통 수단:

  • stdio : 표준 입출력(기본값)

  • sse : 서버에서 보낸 이벤트

Claude Desktop과 통합

Claude Desktop과 함께 이 Kafka MCP 서버를 사용하려면 Claude Desktop 구성 파일에 다음 구성을 추가하세요.

{
    "mcpServers": {
        "kafka": {
            "command": "python",
            "args": [
                "<PATH TO PROJECTS>/main.py"
            ]
        }
    }
}

<PATH TO PROJECTS> 프로젝트 디렉토리의 절대 경로로 바꾸세요.

프로젝트 구조

  • main.py : 애플리케이션의 진입점

  • kafka.py : 카프카 커넥터 구현

  • server.py : Kafka 상호 작용을 위한 도구를 갖춘 MCP 서버 구현

  • settings.py : Pydantic을 사용한 구성 관리

사용 가능한 도구

카프카-퍼블리시

구성된 Kafka 주제에 정보를 게시합니다.

카프카-소비

구성된 Kafka 토픽에서 정보를 사용합니다.

  • 참고: 토픽에서 메시지를 읽으면 동일한 그룹 ID를 사용하여 다시 읽을 수 없습니다.

주제 생성

지정된 매개변수로 새로운 Kafka 토픽을 생성합니다.

  • 옵션 :

    • --topic 생성할 주제의 이름

    • --partitions 할당할 파티션 수

    • --replication-factor 브로커 간 복제 계수

    • --config (선택 사항) 주제 수준 구성 재정의(예: retention.ms=604800000 )

주제 삭제

기존 Kafka 주제를 삭제합니다.

  • 옵션 :

    • --topic 삭제할 주제의 이름

    • --timeout (선택 사항) 삭제가 완료될 때까지 기다리는 시간

목록-주제

클러스터의 모든 주제를 나열합니다(또는 패턴으로 필터링합니다).

  • 옵션 :

    • --bootstrap-server 브로커 주소

    • --pattern (선택 사항) 주제 이름을 필터링하는 정규 표현식

    • --exclude-internal (선택 사항) 내부 주제를 제외합니다(기본값: true)

주제 구성

하나 이상의 주제에 대한 구성을 표시하거나 변경합니다.

  • 옵션 :

    • --describe 주제에 대한 현재 구성을 표시합니다.

    • --alter 구성 수정(예: --add-config retention.ms=86400000,--delete-config cleanup.policy )

    • --topic 주제의 이름

주제-메타데이터

주제 또는 클러스터에 대한 메타데이터를 검색합니다.

  • 옵션 :

    • --topic (제공된 경우) 이 주제에 대한 메타데이터만 가져옵니다.

    • --bootstrap-server 브로커 주소

    • --include-offline (선택 사항) 오프라인인 브로커 또는 파티션을 포함합니다.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

No tool schema history has been recorded yet.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to manage and monitor Apache Kafka clusters through natural language, providing real-time operations, health monitoring, consumer lag analysis, and temporal trend detection for intelligent cluster management.
    -
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables AI agents to interact with Apache Kafka through natural language, supporting operations like producing/consuming messages, managing topics, and querying brokers, partitions, and consumer group offsets.
    1
    MIT
  • F
    license
    C
    quality
    D
    maintenance
    Exposes Kafka administration operations as MCP tools, enabling AI agents to inspect Kafka clusters using natural language.
    1
    -

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pavanjava/kafka_mcp_server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server