Kong Konnect MCP Server

Official
by Kong

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Enables interaction with Kong Konnect APIs, allowing users to query API Gateway analytics, inspect configuration details (services, routes, consumers, plugins), and manage control planes through a structured interface.

Kong Konnect MCP サーバー

Kong Konnect API と対話するためのモデル コンテキスト プロトコル (MCP) サーバー。AI アシスタントが Kong Gateway の構成、トラフィック、分析を照会および分析できるようにします。

https://github.com/user-attachments/assets/19c2f716-49b5-46c3-9457-65b3784e2111

目次

概要

このプロジェクトは、ClaudeのようなAIアシスタントがKong KonnectのAPIゲートウェイと連携できるようにするModel Context Protocol(MCP)サーバーを提供します。分析データのクエリ、構成の詳細の検査、自然言語による会話によるコントロールプレーンの管理など、一連のツールを提供します。

主な機能:

  • カスタマイズ可能なフィルターを使用したクエリ API リクエスト分析
  • ゲートウェイ サービス、ルート、コンシューマー、プラグインを一覧表示して検査する
  • コントロールプレーンとコントロールプレーングループを管理する
  • Claude やその他の MCP 対応 AI アシスタントとの統合

Konnect MCP は現在開発中であり、リリースごとに機能と改善が追加される予定です。

プロジェクト構造

src/ ├── index.ts # Main entry point ├── api.ts # Kong API client ├── tools.ts # Tool definitions ├── parameters.ts # Zod schemas for tool parameters ├── prompts.ts # Detailed tool documentation ├── operations/ │ ├── analytics.ts # API request analytics operations │ ├── configuration.ts # Services, routes, consumers, plugins │ └── controlPlanes.ts # Control plane management └── types.ts # Common type definitions

インストール

前提条件

  • Node.js 20以上
  • APIアクセス可能なKong Konnectアカウント
  • MCP 機能を備えたクライアント (例: Claude Desktop、Cursor など)

設定

# Clone the repository git clone https://github.com/Kong/mcp-konnect.git cd mcp-konnect # Install dependencies npm install # Build the project npm run build

構成

MCP サーバーを構成するには、次の環境変数を設定します。

# Required: Your Kong Konnect API key export KONNECT_ACCESS_TOKEN=kpat_api_key_here # Optional: The API region to use (defaults to US) # Possible values: US, EU, AU, ME, IN export KONNECT_REGION=us

利用可能なツール

サーバーは、次の 3 つのカテゴリに分類されたツールを提供します。

分析ツール

クエリAPIリクエスト

カスタマイズ可能なフィルターを使用して、Kong API Gateway リクエストをクエリおよび分析します。

Inputs: - timeRange: Time range for data retrieval (15M, 1H, 6H, 12H, 24H, 7D) - statusCodes: Filter by specific HTTP status codes - excludeStatusCodes: Exclude specific HTTP status codes - httpMethods: Filter by HTTP methods - consumerIds: Filter by consumer IDs - serviceIds: Filter by service IDs - routeIds: Filter by route IDs - maxResults: Maximum number of results to return

消費者のリクエストを取得する

特定のコンシューマーによって行われた API リクエストを分析します。

Inputs: - consumerId: ID of the consumer to analyze - timeRange: Time range for data retrieval - successOnly: Show only successful (2xx) requests - failureOnly: Show only failed (non-2xx) requests - maxResults: Maximum number of results to return

設定ツール

リストサービス

コントロール プレーンに関連付けられているすべてのサービスを一覧表示します。

Inputs: - controlPlaneId: ID of the control plane - size: Number of services to return - offset: Pagination offset token

ルート一覧

コントロール プレーンに関連付けられているすべてのルートを一覧表示します。

Inputs: - controlPlaneId: ID of the control plane - size: Number of routes to return - offset: Pagination offset token

消費者リスト

コントロール プレーンに関連付けられているすべてのコンシューマーを一覧表示します。

Inputs: - controlPlaneId: ID of the control plane - size: Number of consumers to return - offset: Pagination offset token

プラグイン一覧

コントロール プレーンに関連付けられているすべてのプラグインを一覧表示します。

Inputs: - controlPlaneId: ID of the control plane - size: Number of plugins to return - offset: Pagination offset token

コントロールプレーンツール

コントロールプレーンの一覧

組織内のすべてのコントロール プレーンを一覧表示します。

Inputs: - pageSize: Number of control planes per page - pageNumber: Page number to retrieve - filterName: Filter control planes by name - filterClusterType: Filter by cluster type - filterCloudGateway: Filter by cloud gateway capability - labels: Filter by labels - sort: Sort field and direction

コントロールプレーンを取得する

特定のコントロール プレーンに関する詳細情報を取得します。

Inputs: - controlPlaneId: ID of the control plane to retrieve

コントロールプレーングループメンバーシップの一覧表示

特定のグループのメンバーであるすべてのコントロール プレーンを一覧表示します。

Inputs: - groupId: Control plane group ID - pageSize: Number of members to return per page - pageAfter: Cursor for pagination

コントロールプレーンのグループメンバーシップを確認する

コントロール プレーンがいずれかのグループのメンバーであるかどうかを確認します。

Inputs: - controlPlaneId: Control plane ID to check

クロードとの使用

この MCP サーバーを Claude for Desktop で使用するには:

  1. デスクトップ版Claudeをインストールする
  2. Claude Desktop 構成ファイルを作成または編集します。
    • MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  3. 次の構成を追加します。
{ "mcpServers": { "kong-konnect": { "command": "node", "args": [ "/absolute/path/to/mcp-konnect/build/index.js" ], "env": { "KONNECT_ACCESS_TOKEN": "kpat_api_key_here", "KONNECT_REGION": "us" } } } }
  1. デスクトップ版のClaudeを再起動
  2. Kong Konnectツールがクロードでも使用できるようになります

ワークフローの例

APIトラフィックの分析

  1. まず、すべてのコントロール プレーンを一覧表示します。
    Please list all control planes in my Kong Konnect organization.
  2. 次に、特定のコントロール プレーンのサービスを一覧表示します。
    List all services for control plane [CONTROL_PLANE_NAME/ID].
  3. 特定のサービスに対する API リクエストをクエリします。
    Show me all API requests for service [SERVICE_NAME/ID] in the last hour that had 5xx status codes.

消費者問題のトラブルシューティング

  1. コントロール プレーンのコンシューマーを一覧表示します。
    List all consumers for control plane [CONTROL_PLANE_NAME/ID].
  2. 特定の消費者のリクエストを分析します。
    Show me all requests made by consumer [CONSUMER_NAME/ID] in the last 24 hours.
  3. 一般的なエラーやパターンを確認します。
    What are the most common errors experienced by this consumer?

発達

新しいツールの追加

  1. パラメータをparameters.tsで定義する
  2. prompts.tsにドキュメントを追加する
  3. operations/内の適切なファイルに操作ロジックを作成します。
  4. tools.tsにツールを登録する
  5. index.tsでツールの実行を処理する

トラブルシューティング

よくある問題

接続エラー

  • APIキーが有効であり、必要な権限があることを確認してください
  • APIリージョンが正しく指定されているか確認する
  • ネットワークがKong Konnect APIに接続できることを確認する

認証エラー

  • Kong Konnect ポータルで API キーを再生成します
  • 環境変数が正しく設定されているか確認する

データが見つかりません

  • リクエストで使用されているIDが正しいことを確認する
  • 指定されたコントロールプレーンにリソースが存在することを確認します
  • 分析クエリの時間範囲が有効であることを確認する

クレジット

Kong によって構築されました。Stripe のAgent Toolkitからインスピレーションを受けています。

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

AI アシスタントが Kong Konnect の API ゲートウェイと対話できるようにし、分析データのクエリ、構成の検査、自然言語によるコントロール プレーンの管理を行うツールを提供するモデル コンテキスト プロトコル サーバー。

  1. Table of Contents
    1. Overview
      1. Project Structure
        1. Installation
          1. Prerequisites
          2. Setup
        2. Configuration
          1. Available Tools
            1. Analytics Tools
            2. Configuration Tools
            3. Control Planes Tools
          2. Usage with Claude
            1. Example Workflows
              1. Analyzing API Traffic
              2. Troubleshooting Consumer Issues
            2. Development
              1. Adding New Tools
            3. Troubleshooting
              1. Common Issues
            4. Credits
              ID: ovzvrcmeag