MCP server

Connect an AI assistant such as Claude to KCM with the Model Context Protocol, and ask it about your Kafka clusters. Everything is read only.

Since KCM 1.8.0 Every edition Read only

1. Create a token

In Settings > Users > Service Accounts, create a service account, give it the rights it needs (for example VIEWER on one environment), then create a token with the Read only option. Service accounts come with the Team and Enterprise editions Team. With another edition, use a personal token: your name at the top right, then Generate token. It expires with your session and carries all your rights.

2. Connect your assistant

The endpoint is https://kcm.example.com/api/v1/mcp (Streamable HTTP), with the token as a bearer token.

Claude Code, with the KCM plugin (recommended)

The KCM plugin connects Claude Code and adds four ready-made reviews. In Claude Code 2.1.285 or later:

/plugin marketplace add kcmhub/kcm-claude-plugin
/plugin install kcm@kcmhub

Enter the endpoint and the token when asked, then run /reload-plugins. To change them later: /plugin configure kcm@kcmhub.

SkillWhat it does
/kcm:cluster-reviewHealth review of a cluster, with prioritized findings
/kcm:lag-triageWhy a consumer group is late, and what to check next
/kcm:connector-triageRoot error of a failed connector and likely causes
/kcm:topic-auditDurability, retention, partitions, schemas and consumers of topics

Claude Code, without the plugin

claude mcp add --transport http kcm https://kcm.example.com/api/v1/mcp \
  --header "Authorization: Bearer $KCM_TOKEN"

Claude Desktop

{
  "mcpServers": {
    "kcm": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://kcm.example.com/api/v1/mcp",
               "--header", "Authorization:${KCM_AUTH}"],
      "env": { "KCM_AUTH": "Bearer kcm_sa_..." }
    }
  }
}

VS Code

In .vscode/mcp.json:

{
  "servers": {
    "kcm": {
      "type": "http",
      "url": "https://kcm.example.com/api/v1/mcp",
      "headers": { "Authorization": "Bearer ${input:kcm-token}" }
    }
  },
  "inputs": [
    { "id": "kcm-token", "type": "promptString", "description": "KCM token", "password": true }
  ]
}

Check with curl

curl -s https://kcm.example.com/api/v1/mcp \
  -H "Authorization: Bearer $KCM_TOKEN" \
  -H "Content-Type: application/json" -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

3. Ask

Tools

ToolWhat it returns
list_environmentsEnvironments visible to the token
list_clustersKafka clusters, with environment and last known status
get_cluster_healthReachability, version, brokers, controller, under-replicated, under min ISR and offline partitions
list_topicsTopics with partitions, replication factor and a configuration summary
describe_topicPartitions, offsets and configuration of a topic
list_consumer_groupsConsumer groups with state, members, total lag and health signals
describe_consumer_groupMembers, assignments, committed offsets, lag per partition and health signals
list_schema_subjectsSchema Registry instances and their subjects
get_latest_schemaLatest schema of a subject
list_connectorsKafka Connect clusters and their connectors, with state and tasks
get_connector_statusState of a connector and of its tasks, with error traces
list_audit_eventsRecent audit events (global ADMIN, AUDITOR and SECURITY_ADMIN only)

Security

Troubleshooting

AnswerCause
401Token wrong, expired or revoked.
403, Origin not allowedA browser or a proxy adds an Origin that KCM does not know.
403, MCP server turned offAn administrator turned the switch off.
404 or an HTML pageThe URL must end with /api/v1/mcp and reach the API, in 1.8.0 or later.
KCM-CG-HEALTH-BUSYAn analysis of the same cluster is already running: call again a few seconds later.