关于 Kong Konnect MCP Server
Kong Konnect MCP Server 是用于 Kong Konnect API 的 MCP 服务,允许 AI 助手查询和分析 Kong Gateway 的配置、流量与分析数据。该项目已弃用,不再维护,仓库将被归档为只读。
主要功能
- 01按多种条件筛选查询 API 请求分析数据
- 02列出服务、路由、消费者与插件
- 03查看与管理 control plane 及 control plane 分组
- 04检查 control plane 分组成员关系
适用场景
- 01通过自然语言分析 API 流量中的 5xx 错误
- 02排查特定消费者的请求问题
- 03列出并查看某个 control plane 的网关配置
MCP 相关
该项目是 MCP 服务,向 Claude 等 MCP 客户端暴露用于查询 Kong Konnect 配置与分析数据的工具。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
我们还没有获取到这个服务的安装包或远程地址,请按项目 README 中的说明安装。
工具
本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。
详细介绍
警告
⚠️ 此仓库已弃用
此项目已不再积极维护,并将归档为只读。
不会再进行更新、修复错误或添加新功能。问题和拉取请求将不再受监控。
如果你在寻找 Kong Konnect MCP 支持,请查看 Konnect 远程 MCP 服务。
Kong Konnect MCP Server
注意: 此仓库已弃用,即将归档为只读。详情请参阅上方通知。
一个用于与 Kong Konnect API 交互的模型上下文协议(MCP)服务,可让 AI 助手查询和分析 Kong Gateway 配置、流量及分析数据。
目录
概述
⚠️ 已弃用: 此项目已停止维护。以下信息仅供参考。
此项目提供模型上下文协议(MCP)服务,使 Claude 等 AI 助手能够与 Kong Konnect 的 API Gateway 交互。它提供一组工具,可通过自然语言对话查询分析数据、检查配置详情以及管理控制平面。
主要功能:
- 使用可自定义的筛选条件查询 API 请求分析数据
- 列出并检查网关服务、路由、使用者和插件
- 管理控制平面和控制平面组
- 与 Claude 及其他兼容 MCP 的 AI 助手集成
项目结构
build/ # Committed compiled JavaScript output used by the release/distribution flow
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
# Run the test suite (also rebuilds compiled output)
npm test
# Rebuild the committed build artifacts after changing src/
npm run build
此仓库包含作为其分发模式一部分而提交的 build/ 目录文件。如果你修改了 src/ 中的文件,请在提交或发布更改前重新生成 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
可用工具
此服务提供分为三类的工具:
分析工具
查询 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: Control plane ID
- size: Number of services to return
- offset: Pagination offset token
列出路由
列出与某个控制平面关联的所有路由。
Inputs:
- controlPlaneId: Control plane ID
- size: Number of routes to return
- offset: Pagination offset token
列出使用者
列出与某个控制平面关联的所有使用者。
Inputs:
- controlPlaneId: Control plane ID
- size: Number of consumers to return
- offset: Pagination offset token
列出插件
列出与某个控制平面关联的所有插件。
Inputs:
- controlPlaneId: Control plane ID
- size: Number of plugins to return
- offset: Pagination offset token
- includeRawConfig: Set to true to include raw plugin configuration values (defaults to false)
控制平面工具
列出控制平面
列出你所在组织中的所有控制平面。
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: Control plane ID 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
与 Claude 配合使用
**注意:**此配置仅供参考,不再提供设置问题的支持。
要将此 MCP 服务与 Claude for Desktop 配合使用:
-
创建或编辑 Claude Desktop 配置文件:
- MacOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- MacOS:
-
添加以下配置:
{
"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"
}
}
}
}
- 重启 Claude for Desktop
- Claude 现在即可使用 Kong Konnect 工具
示例工作流
分析 API 流量
-
首先,列出所有控制平面:
Please list all control planes in my Kong Konnect organization. -
然后,列出特定控制平面的服务:
List all services for control plane [CONTROL_PLANE_ID]. -
查询特定服务的 API 请求:
Show me all API requests for service [SERVICE_NAME/ID] in the last hour that had 5xx status codes.
排查消费者问题
-
列出控制平面的消费者:
List all consumers for control plane [CONTROL_PLANE_ID]. -
分析特定消费者的请求:
Show me all requests made by consumer [CONSUMER_NAME/ID] in the last 24 hours. -
检查常见错误或模式:
What are the most common errors experienced by this consumer?
开发
⚠️ 此项目不再接受贡献。 仓库将归档为只读状态。拉取请求和问题将不会得到审核或合并。
历史开发说明:
npm test会运行 TypeScript 构建和仓库测试套件。build/是此仓库中已提交的生成产物;修改src/后,应使用npm run build重新生成。
故障排除
**注意:**此弃用项目不提供支持。以下信息仅为参考而保留。
常见问题
连接错误
- 确认 API 密钥有效且具有必要的权限
- 检查 API 区域是否指定正确
- 确保网络能够连接到 Kong Konnect API
身份验证错误
- 在 Kong Konnect 门户中重新生成 API 密钥
- 检查环境变量是否设置正确
未找到数据
- 确认请求中使用的 ID 正确
- 检查指定控制平面中是否存在这些资源
- 确保分析查询的时间范围有效
致谢
由 Kong 构建。最初的灵感来自 Stripe 的 Agent Toolkit。
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。