Kafka Schema Registry

A comprehensive Message Control Protocol (MCP) server for Kafka Schema Registry.

MseeP.ai Security Assessment Badge License: MIT Python Version Docker Pulls GitHub Release GitHub Issues Docker Image Size Maintained MCP Specification Trust Score

Kafka Schema Registry MCP Server

A comprehensive Model Context Protocol (MCP) server that provides Claude Desktop and other MCP clients with tools for Kafka Schema Registry operations. Features advanced schema context support, multi-registry management, and comprehensive schema export capabilities.

๐ŸŽฏ True MCP Implementation: Uses modern FastMCP 2.8.0+ framework with full MCP 2025-06-18 specification compliance. Fully compatible with Claude Desktop and other MCP clients using JSON-RPC over stdio.

Latest Version: v2.1.5 | Docker: aywengo/kafka-schema-reg-mcp:stable

๐Ÿ“‹ Table of Contents

๐Ÿš€ Quick Start

1. Run with Docker (Recommended)

# Latest stable release
docker pull aywengo/kafka-schema-reg-mcp:stable

# Recommended: Run with SLIM_MODE for optimal performance (reduced essential tool set)
docker run -e SCHEMA_REGISTRY_URL=http://localhost:8081 -e SLIM_MODE=true aywengo/kafka-schema-reg-mcp:stable

# OR run with full feature set for administrators/SRE
docker run -e SCHEMA_REGISTRY_URL=http://localhost:8081 aywengo/kafka-schema-reg-mcp:stable

2. Configure Claude Desktop

Copy a ready-to-use configuration from config-examples/:

# macOS
cp config-examples/claude_desktop_stable_config.json ~/Library/Application\ Support/Claude/claude_desktop_config.json

# Linux  
cp config-examples/claude_desktop_stable_config.json ~/.config/claude-desktop/config.json

3. Start Using with Claude

Restart Claude Desktop and try these prompts:

  • "List all schema contexts"
  • "Show me the subjects in the production context"
  • "Register a new user schema with fields for id, name, and email"

โœจ Key Features

  • ๐Ÿค– Claude Desktop Integration - Direct MCP integration with natural language interface
  • ๐Ÿข Multi-Registry Support - Manage up to 8 Schema Registry instances simultaneously
  • ๐Ÿ“‹ Schema Contexts - Logical grouping for production/staging environment isolation
  • ๐Ÿ”„ Schema Migration - Cross-registry migration with backup and verification
  • ๐Ÿ“Š Comprehensive Export - JSON, Avro IDL formats for backup and documentation
  • ๐Ÿ”’ Production Safety - VIEWONLY mode and per-registry access control
  • ๐Ÿ” OAuth 2.1 Authentication - Enterprise-grade security with scope-based permissions
  • ๐Ÿ“ˆ Real-time Progress - Async operations with progress tracking and cancellation
  • ๐Ÿ”— Resource Linking - HATEOAS navigation with enhanced tool responses
  • ๐Ÿงช Full MCP Compliance - 50+ tools following MCP 2025-06-18 specification
  • ๐Ÿš€ SLIM_MODE - Reduce tool overhead from 50+ to ~9 essential tools for better LLM performance

๐Ÿ“– See detailed feature descriptions: docs/api-reference.md

๐Ÿ› ๏ธ Claude Code Skills

This project includes 5 specialized Claude Code skills โ€“ 4 for automated schema development workflows plus 1 for schema context comparison (/context-compare, documented below):

Available Skills

  • /schema-generate - Generate production-ready Avro schemas from natural language

    /schema-generate event UserRegistered "user registration with userId, email, timestamp"
    
  • /schema-evolve - Safely evolve schemas with automatic compatibility checking

    /schema-evolve user-profile "add optional phoneNumber field"
    
  • /migration-plan - Create detailed migration plans between environments

    /migration-plan development staging
    
  • /lint-and-test - Automated quality assurance workflows

    /lint-and-test quick        # Before commit (2-3s)
    /lint-and-test fix          # Auto-fix issues (20-30s)
    /lint-and-test pre-push     # Before push (10-15s)
    

Getting Started with Skills

Quick Start: Read .claude-code/SKILLS_GUIDE.md - 5-minute tutorial

Complete Reference: .claude-code/skills/README.md - Full documentation

Setup Summary: .claude-code/skills/README.md - Configuration details

Skills Features

  • โœ… Natural language schema generation with templates
  • โœ… Automatic compatibility checking (BACKWARD, FORWARD, FULL)
  • โœ… Migration planning with rollback procedures
  • โœ… Pre-commit and pre-push quality automation
  • โœ… Integration with Black, Ruff, isort, Flake8
  • โœ… Docker-based test execution
  • โœ… Comprehensive error handling and auto-fix

Try it now: /schema-generate event TestEvent "test with id and timestamp"

๐Ÿ“ฆ Installation

Option A: Docker (Recommended)

# Production stable
docker pull aywengo/kafka-schema-reg-mcp:stable

# Latest development  
docker pull aywengo/kafka-schema-reg-mcp:latest

# Specific version
docker pull aywengo/kafka-schema-reg-mcp:2.1.3

Running with SLIM_MODE

To reduce LLM overhead, run with SLIM_MODE enabled:

# Run with a reduced essential tool set
docker run -e SCHEMA_REGISTRY_URL=http://localhost:8081 -e SLIM_MODE=true aywengo/kafka-schema-reg-mcp:stable

๐Ÿ’ก SLIM_MODE Benefits:

  • Reduces tool count to an essential subset
  • Significantly faster LLM response times
  • Lower token usage and reduced costs
  • Ideal for production read-only operations
  • Maintains full remote deployment support

Option B: Local Python

git clone https://github.com/aywengo/kafka-schema-reg-mcp
cd kafka-schema-reg-mcp
pip install -r requirements.txt
python kafka_schema_registry_unified_mcp.py

Option C: Docker Compose

docker-compose up -d  # Includes Schema Registry for testing

๐Ÿ“– Detailed installation guide: docs/deployment.md

โš™๏ธ Configuration

Single Registry Mode

export SCHEMA_REGISTRY_URL="http://localhost:8081"
export SCHEMA_REGISTRY_USER=""           # Optional
export SCHEMA_REGISTRY_PASSWORD=""       # Optional
export VIEWONLY="false"                  # Production safety
export SLIM_MODE="false"                 # Optional: Enable to reduce tool overhead (default: false)

Multi-Registry Mode (Up to 8 Registries)

# Development Registry
export SCHEMA_REGISTRY_NAME_1="development"
export SCHEMA_REGISTRY_URL_1="http://dev-registry:8081"
export VIEWONLY_1="false"

# Production Registry (with safety)
export SCHEMA_REGISTRY_NAME_2="production"  
export SCHEMA_REGISTRY_URL_2="http://prod-registry:8081"
export VIEWONLY_2="true"                     # Read-only protection

Claude Desktop Configuration

Pre-configured examples available in config-examples/:

ConfigurationUse CaseFile
ProductionStable Docker deploymentclaude_desktop_stable_config.json
Multi-EnvironmentDEV/STAGING/PROD registriesclaude_desktop_multi_registry_docker.json
Local DevelopmentPython local executionclaude_desktop_config.json
View-Only SafetyProduction with safetyclaude_desktop_viewonly_config.json

๐Ÿ“– Complete configuration guide: config-examples/README.md

SLIM_MODE Configuration (Performance Optimization)

SLIM_MODE reduces the number of exposed MCP tools to an essential subset, significantly reducing LLM overhead and improving response times.

๐Ÿ’ก Recommendation: SLIM_MODE is recommended for most use cases as it provides all essential schema management capabilities with optimal performance.

When to Use SLIM_MODE (Recommended)

  • Default choice for most users and day-to-day operations
  • When experiencing slow LLM responses due to too many tools
  • For production environments focused on read-only operations
  • When you only need basic schema management capabilities
  • To reduce token usage and improve performance

When to Use Non-SLIM Mode

  • For administrators or SRE teams performing long-running operations
  • When you need advanced operations like:
    • Schema migrations across registries
    • Bulk schema removals and cleanup operations
    • Complex batch operations and workflows
    • Interactive guided wizards for complex tasks
    • Comprehensive export/import operations

Enable SLIM_MODE

export SLIM_MODE="true"  # Reduces tools from 50+ to ~9
# Enables reduced essential tool set

Tools Available in SLIM_MODE

Essential Read-Only Tools:

  • ping - Server health check
  • set_default_registry, get_default_registry - Registry management
  • count_contexts, count_schemas, count_schema_versions - Statistics

Basic Write Operations:

  • register_schema - Register new schemas
  • check_compatibility - Schema compatibility checking
  • create_context - Create new contexts

Essential Export Operations:

  • export_schema - Export single schema
  • export_subject - Export all subject versions

Resources Available (All Modes):

  • All 19 resources remain available in SLIM_MODE
  • registry://, schema://, subject:// resource URIs
  • Full read access through resource-first approach

Tools Hidden in SLIM_MODE:

  • All migration tools (migrate_schema, migrate_context)
  • All batch operations (clear_context_batch)
  • Advanced export/import tools (export_context, export_global)
  • All interactive/elicitation tools (*_interactive variants)
  • Heavy statistics tools with async operations
  • Workflow tools
  • Configuration update tools
  • Delete operations

Note: Task status tracking is now handled by FastMCP's built-in Docket system. Custom task management tools have been removed in favor of FastMCP's native task tracking.

Note: You can switch between modes by restarting with SLIM_MODE=false to access the full tool set.

๐Ÿ“Š MCP Tools and Resources

This section provides a comprehensive analysis of all MCP tools and resources exposed by the Kafka Schema Registry MCP Server.

Backward Compatibility Wrapper Tools

These tools are maintained for backward compatibility with existing clients. They internally use efficient implementations but are exposed as tools to prevent "Tool not listed" errors. Consider migrating to the corresponding resources for better performance.

Tool NameSLIM_MODEScopeRecommended ResourceDescription
list_registriesโœ…readregistry://namesList all configured registries
get_registry_infoโœ…readregistry://info/{name}Get registry information
test_registry_connectionโœ…readregistry://status/{name}Test registry connection
test_all_registriesโœ…readregistry://statusTest all registry connections
list_subjectsโœ…readregistry://{name}/subjectsList all subjects
get_schemaโœ…readschema://{name}/{context}/{subject}Get schema content
get_schema_versionsโœ…readschema://{name}/{context}/{subject}/versionsGet schema versions
get_global_configโœ…readregistry://{name}/configGet global configuration
get_modeโœ…readregistry://modeGet registry mode
list_contextsโœ…readregistry://{name}/contextsList all contexts
get_subject_configโœ…readsubject://{name}/{context}/{subject}/configGet subject configuration
get_subject_modeโœ…readsubject://{name}/{context}/{subject}/modeGet subject mode

Core MCP Tools

CategoryNameTypeSLIM_MODEScopeDescription
CorepingToolโœ…readMCP ping/pong health check
Registry Managementset_default_registryToolโœ…adminSet default registry
Registry Managementget_default_registryToolโœ…readGet current default registry
Schema Operationsregister_schemaToolโœ…writeRegister new schema version
Schema Operationscheck_compatibilityToolโœ…readCheck schema compatibility
Context Managementcreate_contextToolโœ…writeCreate new context
Context Managementdelete_contextToolโŒadminDelete context
Subject Managementdelete_subjectToolโŒadminDelete subject and versions
Configurationupdate_global_configToolโŒadminUpdate global configuration
Configurationupdate_subject_configToolโŒadminUpdate subject configuration
Configurationadd_subject_aliasToolโŒwriteCreate alias subject pointing to an existing subject
Configurationdelete_subject_aliasToolโŒwriteRemove an alias subject
Mode Managementupdate_modeToolโŒadminUpdate registry mode
Mode Managementupdate_subject_modeToolโŒadminUpdate subject mode
Statisticscount_contextsToolโœ…readCount contexts
Statisticscount_schemasToolโœ…readCount schemas
Statisticscount_schema_versionsToolโœ…readCount schema versions
Statisticsget_registry_statisticsToolโŒreadGet comprehensive registry stats
Exportexport_schemaToolโœ…readExport single schema
Exportexport_subjectToolโœ…readExport all subject versions
Exportexport_contextToolโŒreadExport all context subjects
Exportexport_globalToolโŒreadExport all contexts/schemas
Exportexport_global_interactiveToolโŒreadInteractive global export
Migrationmigrate_schemaToolโŒadminMigrate schema between registries
Migrationmigrate_contextToolโŒadminMigrate context between registries
Migrationmigrate_context_interactiveToolโŒadminInteractive context migration
Comparisoncompare_registriesToolโŒreadCompare two registries
Comparisoncompare_contexts_across_registriesToolโŒreadCompare contexts across registries
Comparisonfind_missing_schemasToolโŒreadFind missing schemas
Batch Operationsclear_context_batchToolโŒadminClear context with batch operations
Batch Operationsclear_multiple_contexts_batchToolโŒadminClear multiple contexts
Interactiveregister_schema_interactiveToolโŒwriteInteractive schema registration
Interactivecheck_compatibility_interactiveToolโŒreadInteractive compatibility check
Interactivecreate_context_interactiveToolโŒwriteInteractive context creation
Resource Discoverylist_available_resourcesToolโœ…readList all available resources
Resource Discoverysuggest_resource_for_toolToolโœ…readGet resource migration suggestions
Resource Discoverygenerate_resource_templatesToolโœ…readGenerate resource URI templates
Elicitationsubmit_elicitation_responseToolโŒwriteSubmit elicitation response
Elicitationlist_elicitation_requestsToolโŒreadList elicitation requests
Elicitationget_elicitation_requestToolโŒreadGet elicitation request details
Elicitationcancel_elicitation_requestToolโŒadminCancel elicitation request
Elicitationget_elicitation_statusToolโŒreadGet elicitation system status
Workflowslist_available_workflowsToolโŒreadList available workflows
Workflowsget_workflow_statusToolโŒreadGet workflow status
Workflowsguided_schema_migrationToolโŒadminStart schema migration wizard
Workflowsguided_context_reorganizationToolโŒadminStart context reorganization wizard
Workflowsguided_disaster_recoveryToolโŒadminStart disaster recovery wizard
Utilityget_mcp_compliance_status_toolToolโŒreadGet MCP compliance status
Utilityget_oauth_scopes_info_toolToolโŒreadGet OAuth scopes information
Utilitytest_oauth_discovery_endpointsToolโŒreadTest OAuth discovery endpoints
Utilityget_operation_info_toolToolโŒreadGet operation metadata
Utilitycheck_viewonly_modeToolโŒreadCheck if registry is in viewonly mode
RESOURCESregistry://statusResourceโœ…readOverall registry connection status
RESOURCESregistry://infoResourceโœ…readDetailed server configuration
RESOURCESregistry://modeResourceโœ…readRegistry mode detection
RESOURCESregistry://namesResourceโœ…readList of configured registry names
RESOURCESregistry://status/{name}Resourceโœ…readSpecific registry connection status
RESOURCESregistry://info/{name}Resourceโœ…readSpecific registry configuration
RESOURCESregistry://mode/{name}Resourceโœ…readSpecific registry mode
RESOURCESregistry://{name}/subjectsResourceโœ…readList subjects for registry
RESOURCESregistry://{name}/contextsResourceโœ…readList contexts for registry
RESOURCESregistry://{name}/configResourceโœ…readGlobal config for registry
RESOURCESschema://{name}/{context}/{subject}Resourceโœ…readSchema content with context
RESOURCESschema://{name}/{subject}Resourceโœ…readSchema content default context
RESOURCESschema://{name}/{context}/{subject}/versionsResourceโœ…readSchema versions with context
RESOURCESschema://{name}/{subject}/versionsResourceโœ…readSchema versions default context
RESOURCESsubject://{name}/{context}/{subject}/configResourceโœ…readSubject config with context
RESOURCESsubject://{name}/{subject}/configResourceโœ…readSubject config default context
RESOURCESsubject://{name}/{context}/{subject}/modeResourceโœ…readSubject mode with context
RESOURCESsubject://{name}/{subject}/modeResourceโœ…readSubject mode default context
RESOURCESelicitation://response/{request_id}ResourceโŒwriteElicitation response handling

๐Ÿ’ฌ Usage Examples

Schema Management

# In Claude Desktop, use natural language:
"Register a user schema with id, name, email fields"
"Check if my updated schema is compatible"
"Export all schemas from staging context"
"List subjects in production context"

Multi-Registry Operations

"Compare development and production registries"
"Migrate user-events schema from staging to production"
"Test connections to all registries"
"Show me registry statistics"

Batch Operations

"Clear all schemas from test context"
"Export global schemas for backup"
"Count schemas across all contexts"

๐Ÿ“– More examples: examples/ | ๐Ÿ“– Use cases: docs/use-cases.md

๐Ÿ”’ Authentication & Security

OAuth 2.1 Support (Optional)

# Enable authentication
export ENABLE_AUTH=true
export AUTH_ISSUER_URL="https://your-oauth-provider.com"
export AUTH_AUDIENCE="your-client-id"

Supported Providers: Azure AD, Google OAuth, Keycloak, Okta, GitHub

Permission Scopes:

  • read - View schemas, configurations
  • write - Register schemas, update configs (includes read)
  • admin - Delete subjects, full control (includes write + read)

Production Safety Features

  • VIEWONLY Mode - Prevent accidental changes in production
  • URL Validation - SSRF protection with configurable localhost access
  • Scope-based Authorization - Fine-grained tool-level permissions
  • Per-Registry Controls - Independent safety settings

๐Ÿ“– Security guide: docs/deployment.md#security

๐Ÿ“š Documentation

GuideDescription
API ReferenceComplete tool documentation with examples
Subject AliasingHow to add and remove subject aliases
Use CasesReal-world scenarios and implementation patterns
Deployment GuideDocker, Kubernetes, cloud platforms, CI/CD
IDE IntegrationVS Code, Claude Code, Cursor setup
Configuration ExamplesReady-to-use Claude Desktop configs
Testing GuideComprehensive testing setup
ChangelogVersion history and migration notes
v2.0.0 HighlightsMajor version features

Additional Resources

  • Examples - Usage examples and code samples
  • Scripts - Utility scripts and automation
  • Helm Charts - Kubernetes deployment
  • Tests - Test suites and validation

๐Ÿงช Testing

Quick Test

cd tests/
./run_all_tests.sh --quick    # Essential tests
./run_all_tests.sh           # Complete test suite

Docker Testing

python tests/test_docker_mcp.py

MCP Inspector Tests (UI-driven)

# From repository root
cd inspector-tests

# Single registry (DEV)
./run-inspector-tests.sh stable

# Multi-registry (DEV + PROD)
./run-inspector-tests.sh multi

# Test a specific Docker tag
DOCKER_VERSION=latest ./run-inspector-tests.sh stable

๐Ÿ“– Testing guide: TESTING_SETUP_GUIDE.md

๐Ÿš€ Deployment

Production Docker

# With docker-compose
docker-compose up -d

# Direct Docker  
docker run -d -p 38000:8000 \
  -e SCHEMA_REGISTRY_URL=http://registry:8081 \
  aywengo/kafka-schema-reg-mcp:stable

Kubernetes

# Using Helm charts
helm install kafka-schema-mcp ./helm/kafka-schema-reg-mcp

๐Ÿ“– Deployment guide: docs/deployment.md

๐Ÿค Contributing

We welcome contributions! Please see:

Quick Development Setup

git clone https://github.com/aywengo/kafka-schema-reg-mcp
cd kafka-schema-reg-mcp
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
python kafka_schema_registry_unified_mcp.py

๐Ÿ†• What's New

v2.1.x (Latest)

  • ๐Ÿงญ Subject Aliasing - New tools add_subject_alias and delete_subject_alias
  • ๐Ÿ› ๏ธ Fixes - Evolution assistant and import interactive fixes
  • ๐Ÿ“ฆ Enhancements - Continued MCP tool refinements and testing improvements
  • ๐Ÿ—‘๏ธ Removed Deprecated Tools - Custom task management tools removed in favor of FastMCP's built-in Docket system

v2.0.x

  • ๐Ÿ”’ Security Fixes - Resolved credential exposure in logging
  • ๐Ÿค– Interactive Schema Migration - Smart migration with user preference elicitation
  • ๐Ÿ’พ Automatic Backups - Pre-migration backup creation
  • โœ… Post-Migration Verification - Comprehensive schema validation
  • ๐Ÿš€ FastMCP 2.8.0+ Framework - Complete architecture upgrade
  • ๐Ÿ“Š MCP 2025-06-18 Compliance - Latest protocol specification
  • ๐Ÿ” OAuth 2.1 Generic Discovery - Universal provider compatibility
  • ๐Ÿ”— Resource Linking - HATEOAS navigation in tool responses

๐Ÿ“– Full changelog: CHANGELOG.md | ๐Ÿ“– v2.0.0 features: README-v2.0.0-HIGHLIGHTS.md


๐Ÿณ Glama.ai:


๐Ÿณ Docker Hub: aywengo/kafka-schema-reg-mcp | ๐Ÿ“Š Stats: 50+ MCP Tools (12 backward compatibility), 19 Resources, 8 Registries, OAuth 2.1, Multi-platform

License: MIT | Maintainer: @aywengo | Issues: GitHub Issues

Related Servers