KLogic

Setting Up KLogic MCP for AI Assistant Integration

Use the Model Context Protocol (MCP) to connect AI assistants like Claude, VS Code Copilot, and Cursor directly to your Kafka clusters via KLogic.

What is MCP & How Does It Work?

MCP enables AI assistants to call structured tools that fetch real-time data from your systems

Model Context Protocol

MCP is an open protocol that allows AI assistants to call external tools with structured inputs and outputs. KLogic implements an MCP server that exposes Kafka operations as callable tools.

Standardized tool protocol
Real-time cluster data
Secure, read-focused access

Available MCP Tools

The KLogic MCP server exposes a comprehensive set of Kafka operations that AI assistants can invoke during conversations.

list_topics, describe_topic
get_consumer_group_lag
get_broker_metrics, list_alerts

Security & Permissions

MCP access uses your existing KLogic API key with configurable permission scopes. Read-only mode is recommended for AI assistants to prevent unintended mutations.

API key authentication
Read-only scopes available
Audit log for all MCP calls

Claude Desktop Configuration

Connect KLogic to Claude Desktop in under 5 minutes

Setup Steps

1

Generate an API Key

In KLogic, navigate to Settings → API Access and create a new API key with read scope.

2

Open Claude Desktop Config

Edit ~/Library/Application Support/Claude/claude_desktop_config.json on macOS.

3

Add MCP Server Entry

Paste the KLogic MCP configuration (see right panel) into the mcpServers object.

4

Restart Claude Desktop

Fully quit and relaunch Claude Desktop. A hammer icon in the bottom-left confirms MCP tools are loaded.

claude_desktop_config.json

{
"mcpServers": {
"klogic": {
"command": "npx",
"args": [
"-y",
"@klogic/mcp-server"
],
"env": {
"KLOGIC_API_URL":
"https://your-instance.klogic.io",
"KLOGIC_API_KEY":
"kl_your_api_key_here"
}
}
}
}

Replace your-instance.klogic.io with your KLogic instance URL and update the API key.

VS Code & Cursor Setup

Integrate KLogic MCP into your development environment

VS Code with GitHub Copilot

GitHub Copilot in VS Code supports MCP servers through the.vscode/mcp.json workspace file.

// .vscode/mcp.json
{
"servers": {
"klogic": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@klogic/mcp-server"],
"env": {
"KLOGIC_API_URL": "${"input:klogicUrl}",
"KLOGIC_API_KEY": "${"input:klogicKey}"
}
}
}
}

Using input variables keeps secrets out of source control. VS Code will prompt you for values on first use.

Cursor IDE

Cursor has built-in MCP support. Configure KLogic in the Cursor settings panel under Features → MCP Servers.

1

Open Cursor Settings (Cmd/Ctrl + Shift + J)

2

Navigate to Features → MCP Servers → Add New MCP Server

3

Set type to "stdio" and command to npx -y @klogic/mcp-server

4

Add environment variables KLOGIC_API_URL and KLOGIC_API_KEY

5

Save and verify the green dot appears next to the KLogic server in the MCP panel

Example AI Prompts

What you can ask your AI assistant once KLogic MCP is connected

Consumer Lag Investigation
"Which consumer groups currently have more than 10,000 messages of lag? Show me the top 5 by lag amount and which topics they're consuming."
Broker Health Check
"Check the health of all brokers in my production cluster. Are there any under-replicated partitions or brokers with high CPU usage?"
Topic Analysis
"List all topics that match the pattern 'order-*' and tell me their partition count, replication factor, and average message throughput over the last hour."
Incident Response
"We're seeing elevated consumer lag on the payment-processor group. Pull the last 30 minutes of lag metrics and summarize what changed and when."
Configuration Audit
"Review the configuration of the 'user-events' topic. Does it have appropriate retention settings and replication factor for a critical production topic?"
Alert Review
"Show me all alerts that fired in the last 24 hours. Group them by severity and tell me which ones are still active and need attention."

Bring AI to Your Kafka Operations

KLogic MCP turns your AI assistant into a Kafka expert with real-time access to your cluster data, metrics, and operational history.

Free 14-day trial • Claude, Copilot & Cursor support • Secure API key auth