KO

Kong Konnect MCP Server for API Traffic Analytics

Analyze Kong Konnect APIs and gateway traffic with an MCP server that lets AI assistants query, monitor, and visualize configurations and analytics.

Quick Install
npx -y @Kong/mcp-konnect

Overview

Kong Konnect MCP Server for API Traffic Analytics is a lightweight service that bridges Kong Konnect control plane data and runtime gateway metrics into a Model Context Protocol (MCP) endpoint. It collects configuration and telemetry from Konnect and exposes a queryable API that AI assistants and other tools can use to analyze, monitor, and visualize API topology and traffic patterns.

This server is useful when you want programmatic access to enriched Konnect context: relationships between services, routes, and consumers; historical and real‑time metrics (latency, error rates, request volume); and a compact API for downstream tooling such as chat assistants, observability pipelines, or automated compliance checks.

Features

  • Synchronizes Konnect control plane configuration (services, routes, plugins, consumers) into a consistent model.
  • Ingests gateway telemetry and aggregates metrics (latency, throughput, 4xx/5xx rates).
  • Exposes a simple HTTP API compatible with MCP consumers so assistants and services can query context.
  • Query primitives for topology, time‑series metrics, and anomaly detection-ready aggregates.
  • Integrations-ready: works alongside Prometheus/Grafana and downstream visualization or ML tooling.
  • Configurable polling and retention windows for metrics and configuration snapshots.
  • Lightweight deployment options: Docker, Kubernetes, or as a standalone binary/container.

Installation / Configuration

Minimum requirements:

  • A running Kong Konnect account with API access token
  • Network access to Konnect endpoints and to your gateway metrics (Prometheus or admin API)

Environment variables and configuration file (YAML) are supported.

Example configuration file (config.yaml):

konnect:
  api_url: "https://konnect.konghq.com"
  api_key: "KONNECT_API_KEY"

polling:
  config_interval_seconds: 60
  metrics_interval_seconds: 30
  metrics_retention_minutes: 1440

metrics:
  source: "prometheus"         # or "admin_api"
  prometheus:
    endpoint: "http://prometheus:9090"

server:
  listen_addr: "0.0.0.0"
  listen_port: 8080

Run with Docker:

docker run -d \
  -e KONNECT_API_KEY="${KONNECT_API_KEY}" \
  -e KONNECT_API_URL="https://konnect.konghq.com" \
  -e POLL_CONFIG_INTERVAL=60 \
  -e METRICS_SOURCE=prometheus \
  -p 8080:8080 \
  --name mcp-konnect \
  kong/mcp-konnect:latest

Kubernetes Deployment (manifest snippet):

apiVersion: apps/v1
kind: Deployment
metadata:
  name: mcp-konnect
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mcp-konnect
  template:
    metadata:
      labels:
        app: mcp-konnect
    spec:
      containers:
      - name: mcp-konnect
        image: kong/mcp-konnect:latest
        env:
        - name: KONNECT_API_KEY
          valueFrom:
            secretKeyRef:
              name: konnect-secret
              key: api-key
        - name: METRICS_SOURCE
          value: "prometheus"
        ports:
        - containerPort: 8080

Common environment variables

NamePurpose
KONNECT_API_KEYAPI key or token to access Konnect
KONNECT_API_URLKonnect API base URL
POLL_CONFIG_INTERVALHow often to sync Konnect config (seconds)
METRICS_SOURCE“prometheus” or “admin_api”
PROMETHEUS_ENDPOINTPrometheus scrape/query endpoint
LISTEN_PORTServer listen port (default 8080)

Available Resources

  • GitHub repository: https://github.com/Kong/mcp-konnect — source, issues, and full documentation.
  • Example config files and Kubernetes manifests in the repo.
  • Integration patterns: use alongside Prometheus for metrics scraping and Grafana for dashboards.
  • API documentation in the repo (OpenAPI/Swagger) — consult the repo for endpoint details and request/response schemas.

Use Cases

  1. Troubleshooting spikes in 5xx errors

    • Problem: sudden increase in 5xxs on a service.
    • How: query the server for recent 5xx rate by service over the last 15 minutes, then expand to routes and upstream targets to find the source. Example query flow:
      • GET /v1/metrics/services?metric=5xx_rate&window=15m&sort=desc
  2. Conversational assistant for Konnect

    • Problem: non‑engineers need answers about traffic and configuration.
    • How: attach an LLM-powered assistant to the MCP endpoint. The assistant can ask for summaries like “Which services have the highest average latency this hour?” and receive structured responses derived from real metrics and Konnect config.
  3. Automated compliance and drift detection

    • Problem: configuration drift between environments or missing security plugins.
    • How: schedule configuration snapshots and run queries to compare expected plugin sets on services/routes. Emit alerts