
Kong Konnect MCP Server
一个模型上下文协议服务器,使 AI 助手能够与 Kong Konnect 的 API 网关进行交互,通过自然语言提供查询分析数据、检查配置和管理控制平面的工具。
Tools
query_api_requests
Query and analyze Kong API Gateway requests with customizable filters. Before calling this it's necessary to have a controlPlaneID and a serviceID or routeID. These can be obtained using the list-control-planes, list-services, and list-routes tools. INPUT: - timeRange: String - Time range for data retrieval (15M, 1H, 6H, 12H, 24H, 7D) - statusCodes: Number[] (optional) - Filter by specific HTTP status codes - excludeStatusCodes: Number[] (optional) - Exclude specific HTTP status codes - httpMethods: String[] (optional) - Filter by HTTP methods (e.g., GET, POST) - consumerIds: String[] (optional) - Filter by consumer IDs - serviceIds: String[] (optional) - Filter by service IDs. The format of this field must be "<controlPlaneID>:<serviceID>". - routeIds: String[] (optional) - Filter by route IDs. The format of this field must be "<controlPlaneID:routeID>" - maxResults: Number - Maximum number of results to return (1-1000) OUTPUT: - metadata: Object - Contains totalRequests, timeRange, and applied filters - requests: Array - List of request objects with details including: - requestId: String - Unique request identifier - timestamp: String - When the request occurred - httpMethod: String - HTTP method used (GET, POST, etc.) - uri: String - Request URI path - statusCode: Number - HTTP status code of the response - consumerId: String - ID of the consumer making the request - serviceId: String - ID of the service handling the request - routeId: String - ID of the matched route - latency: Object - Response time metrics - clientIp: String - IP address of the client - and many more detailed fields...
get_consumer_requests
Retrieve and analyze API requests made by a specific consumer. INPUT: - consumerId: String - ID of the consumer to analyze. The format of this field must be "controlPlaneID:consumerId". - timeRange: String - Time range for data retrieval (15M, 1H, 6H, 12H, 24H, 7D) - successOnly: Boolean - Filter to only show successful (2xx) requests (default: false) - failureOnly: Boolean - Filter to only show failed (non-2xx) requests (default: false) - maxResults: Number - Maximum number of results to return (1-1000) OUTPUT: - metadata: Object - Contains consumerId, totalRequests, timeRange, and filters - statistics: Object - Usage statistics including: - averageLatencyMs: Number - Average response time in milliseconds - successRate: Number - Percentage of successful requests - statusCodeDistribution: Array - Breakdown of requests by status code - serviceDistribution: Array - Breakdown of requests by service - requests: Array - List of requests with details for each request
list_services
List all services associated with a control plane. INPUT: - controlPlaneId: String - ID of the control plane - size: Number - Number of services to return (1-1000, default: 100) - offset: String (optional) - Pagination offset token from previous response OUTPUT: - metadata: Object - Contains controlPlaneId, size, offset, nextOffset, totalCount - services: Array - List of services with details for each including: - serviceId: String - Unique identifier for the service - name: String - Display name of the service - host: String - Target host for the service - port: Number - Target port for the service - protocol: String - Protocol used (http, https, grpc, etc.) - path: String - Path prefix for the service - retries: Number - Number of retries on failure - connectTimeout: Number - Connection timeout in milliseconds - writeTimeout: Number - Write timeout in milliseconds - readTimeout: Number - Read timeout in milliseconds - tags: Array - Tags associated with the service - enabled: Boolean - Whether the service is enabled - metadata: Object - Creation and update timestamps - relatedTools: Array - List of related tools for further analysis
list_routes
List all routes associated with a control plane. INPUT: - controlPlaneId: String - ID of the control plane - size: Number - Number of routes to return (1-1000, default: 100) - offset: String (optional) - Pagination offset token from previous response OUTPUT: - metadata: Object - Contains controlPlaneId, size, offset, nextOffset, totalCount - routes: Array - List of routes with details for each including: - routeId: String - Unique identifier for the route - name: String - Display name of the route - protocols: Array - Protocols this route accepts (http, https, grpc, etc.) - methods: Array - HTTP methods this route accepts - hosts: Array - Hostnames this route matches - paths: Array - URL paths this route matches - stripPath: Boolean - Whether to strip the matched path prefix - preserveHost: Boolean - Whether to preserve the host header - serviceId: String - ID of the service this route forwards to - enabled: Boolean - Whether the route is enabled - metadata: Object - Creation and update timestamps - relatedTools: Array - List of related tools for further analysis
list_consumers
List all consumers associated with a control plane. INPUT: - controlPlaneId: String - ID of the control plane - size: Number - Number of consumers to return (1-1000, default: 100) - offset: String (optional) - Pagination offset token from previous response OUTPUT: - metadata: Object - Contains controlPlaneId, size, offset, nextOffset, totalCount - consumers: Array - List of consumers with details for each including: - consumerId: String - Unique identifier for the consumer - username: String - Username for this consumer - customId: String - Custom identifier for this consumer - tags: Array - Tags associated with the consumer - enabled: Boolean - Whether the consumer is enabled - metadata: Object - Creation and update timestamps - relatedTools: Array - List of related tools for consumer analysis
list_plugins
List all plugins associated with a control plane. INPUT: - controlPlaneId: String - ID of the control plane - size: Number - Number of plugins to return (1-1000, default: 100) - offset: String (optional) - Pagination offset token from previous response OUTPUT: - metadata: Object - Contains controlPlaneId, size, offset, nextOffset, totalCount - plugins: Array - List of plugins with details for each including: - pluginId: String - Unique identifier for the plugin - name: String - Name of the plugin (e.g., rate-limiting, cors, etc.) - enabled: Boolean - Whether the plugin is enabled - config: Object - Plugin-specific configuration - protocols: Array - Protocols this plugin applies to - tags: Array - Tags associated with the plugin - scoping: Object - Defines plugin scope including: - consumerId: String - Consumer this plugin applies to (if any) - serviceId: String - Service this plugin applies to (if any) - routeId: String - Route this plugin applies to (if any) - global: Boolean - Whether this is a global plugin - metadata: Object - Creation and update timestamps - relatedTools: Array - List of related tools for plugin configuration
list_control_planes
List all control planes in your organization. INPUT: - pageSize: Number - Number of control planes per page (1-1000, default: 10) - pageNumber: Number (optional) - Page number to retrieve - filterName: String (optional) - Filter control planes by name - filterClusterType: String (optional) - Filter by cluster type (kubernetes, docker, etc.) - filterCloudGateway: Boolean (optional) - Filter by cloud gateway capability - labels: String (optional) - Filter by labels (format: 'key:value,existCheck') - sort: String (optional) - Sort field and direction (e.g. 'name,created_at desc') OUTPUT: - metadata: Object - Contains pageSize, pageNumber, totalPages, totalCount, filters, sort - controlPlanes: Array - List of control planes with details for each including: - controlPlaneId: String - Unique identifier for the control plane - name: String - Display name of the control plane - description: String - Description of the control plane - type: String - Type of the control plane - clusterType: String - Underlying cluster type - controlPlaneEndpoint: String - URL endpoint for the control plane - telemetryEndpoint: String - URL endpoint for telemetry - hasCloudGateway: Boolean - Whether cloud gateway is enabled - labels: Object - Labels assigned to this control plane - metadata: Object - Creation and update timestamps - usage: Object - Information about how to use these results
get_control_plane
Get detailed information about a specific control plane. INPUT: - controlPlaneId: String - ID of the control plane to retrieve OUTPUT: - controlPlaneDetails: Object - Detailed information including: - controlPlaneId: String - Unique identifier for the control plane - name: String - Display name of the control plane - description: String - Description of the control plane - type: String - Type of the control plane - clusterType: String - Underlying cluster type - controlPlaneEndpoint: String - URL endpoint for the control plane - telemetryEndpoint: String - URL endpoint for telemetry - hasCloudGateway: Boolean - Whether cloud gateway is enabled - labels: Object - Labels assigned to this control plane - metadata: Object - Creation and update timestamps - relatedTools: Array - List of related tools for further analysis
list_control_plane_group_memberships
List all control planes that are members of a specific control plane group. INPUT: - groupId: String - ID of the control plane group (control plane that acts as the group) - pageSize: Number - Number of members to return per page (1-1000, default: 10) - pageAfter: String (optional) - Cursor for pagination after a specific item OUTPUT: - metadata: Object - Contains groupId, pageSize, pageAfter, nextPageAfter, totalCount - members: Array - List of member control planes with details for each including: - controlPlaneId: String - Unique identifier for the control plane - name: String - Display name of the control plane - description: String - Description of the control plane - type: String - Type of the control plane - clusterType: String - Underlying cluster type - membershipStatus: Object - Group membership status including: - status: String - Current status (OK, CONFLICT, etc.) - message: String - Status message - conflicts: Array - List of configuration conflicts if any - metadata: Object - Creation and update timestamps - relatedTools: Array - List of related tools for group management
check_control_plane_group_membership
Check if a control plane is a member of any group. INPUT: - controlPlaneId: String - ID of the control plane to check OUTPUT: - controlPlaneId: String - ID of the control plane that was checked - groupMembership: Object - Membership information including: - isMember: Boolean - Whether the control plane is a member of any group - groupId: String - ID of the group this control plane belongs to (if any) - groupName: String - Name of the group this control plane belongs to - status: String - Membership status (OK, CONFLICT, etc.) - message: String - Status message - conflicts: Array - List of configuration conflicts if any - relatedTools: Array - List of related tools for group management
README
Kong Konnect MCP 服务器
一个用于与 Kong Konnect API 交互的模型上下文协议 (MCP) 服务器,允许 AI 助手查询和分析 Kong Gateway 的配置、流量和分析数据。
https://github.com/user-attachments/assets/19c2f716-49b5-46c3-9457-65b3784e2111
目录
概述
本项目提供了一个模型上下文协议 (MCP) 服务器,使像 Claude 这样的 AI 助手能够与 Kong Konnect 的 API Gateway 交互。它提供了一组工具,可以通过自然语言对话查询分析数据、检查配置详细信息和管理控制平面。
主要特性:
- 使用可自定义的过滤器查询 API 请求分析数据
- 列出和检查网关服务、路由、消费者和插件
- 管理控制平面和控制平面组
- 与 Claude 和其他 MCP 兼容的 AI 助手集成
Konnect MCP 正在开发中,我们将在每个版本中添加额外的功能和改进。
项目结构
src/
├── index.ts # 主入口点
├── api.ts # Kong API 客户端
├── tools.ts # 工具定义
├── parameters.ts # 工具参数的 Zod 模式
├── prompts.ts # 详细的工具文档
├── operations/
│ ├── analytics.ts # API 请求分析操作
│ ├── configuration.ts # 服务、路由、消费者、插件
│ └── controlPlanes.ts # 控制平面管理
└── types.ts # 通用类型定义
安装
前提条件
- Node.js 20 或更高版本
- 具有 API 访问权限的 Kong Konnect 帐户
- 具有 MCP 功能的客户端(例如 Claude Desktop、Cursor 等)
设置
# 克隆仓库
git clone https://github.com/Kong/mcp-konnect.git
cd mcp-konnect
# 安装依赖
npm install
# 构建项目
npm run build
配置
设置以下环境变量来配置 MCP 服务器:
# 必需:您的 Kong Konnect API 密钥
export KONNECT_ACCESS_TOKEN=kpat_api_key_here
# 可选:要使用的 API 区域(默认为 US)
# 可能的值:US, EU, AU, ME, IN
export KONNECT_REGION=us
可用工具
服务器提供组织在三个类别中的工具:
分析工具
查询 API 请求
使用可自定义的过滤器查询和分析 Kong API Gateway 请求。
输入:
- timeRange:数据检索的时间范围 (15M, 1H, 6H, 12H, 24H, 7D)
- statusCodes:按特定的 HTTP 状态代码过滤
- excludeStatusCodes:排除特定的 HTTP 状态代码
- httpMethods:按 HTTP 方法过滤
- consumerIds:按消费者 ID 过滤
- serviceIds:按服务 ID 过滤
- routeIds:按路由 ID 过滤
- maxResults:要返回的最大结果数
获取消费者请求
分析特定消费者发出的 API 请求。
输入:
- consumerId:要分析的消费者的 ID
- timeRange:数据检索的时间范围
- successOnly:仅显示成功的 (2xx) 请求
- failureOnly:仅显示失败的(非 2xx)请求
- maxResults:要返回的最大结果数
配置工具
列出服务
列出与控制平面关联的所有服务。
输入:
- controlPlaneId:控制平面的 ID
- size:要返回的服务数量
- offset:分页偏移令牌
列出路由
列出与控制平面关联的所有路由。
输入:
- controlPlaneId:控制平面的 ID
- size:要返回的路由数量
- offset:分页偏移令牌
列出消费者
列出与控制平面关联的所有消费者。
输入:
- controlPlaneId:控制平面的 ID
- size:要返回的消费者数量
- offset:分页偏移令牌
列出插件
列出与控制平面关联的所有插件。
输入:
- controlPlaneId:控制平面的 ID
- size:要返回的插件数量
- offset:分页偏移令牌
控制平面工具
列出控制平面
列出您组织中的所有控制平面。
输入:
- pageSize:每页的控制平面数量
- pageNumber:要检索的页码
- filterName:按名称过滤控制平面
- filterClusterType:按集群类型过滤
- filterCloudGateway:按云网关能力过滤
- labels:按标签过滤
- sort:排序字段和方向
获取控制平面
获取有关特定控制平面的详细信息。
输入:
- controlPlaneId:要检索的控制平面的 ID
列出控制平面组成员关系
列出作为特定组的成员的所有控制平面。
输入:
- groupId:控制平面组 ID
- pageSize:每页要返回的成员数量
- pageAfter:分页游标
检查控制平面组成员关系
检查控制平面是否为任何组的成员。
输入:
- controlPlaneId:要检查的控制平面 ID
与 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
- Kong Konnect 工具现在可供 Claude 使用
示例工作流程
分析 API 流量
-
首先,列出所有控制平面:
请列出我的 Kong Konnect 组织中的所有控制平面。
-
然后,列出特定控制平面的服务:
列出控制平面 [CONTROL_PLANE_NAME/ID] 的所有服务。
-
查询特定服务的 API 请求:
显示过去一小时内服务 [SERVICE_NAME/ID] 的所有具有 5xx 状态代码的 API 请求。
排除消费者问题
-
列出控制平面的消费者:
列出控制平面 [CONTROL_PLANE_NAME/ID] 的所有消费者。
-
分析特定消费者的请求:
显示过去 24 小时内消费者 [CONSUMER_NAME/ID] 发出的所有请求。
-
检查常见错误或模式:
此消费者遇到的最常见错误是什么?
开发
添加新工具
- 在
parameters.ts
中定义参数 - 在
prompts.ts
中添加文档 - 在
operations/
中适当的文件中创建操作逻辑 - 在
tools.ts
中注册该工具 - 在
index.ts
中处理工具执行
故障排除
常见问题
连接错误
- 验证您的 API 密钥是否有效并具有必要的权限
- 检查 API 区域是否已正确指定
- 确保您的网络可以连接到 Kong Konnect API
身份验证错误
- 在 Kong Konnect 门户中重新生成您的 API 密钥
- 检查环境变量是否已正确设置
未找到数据
- 验证请求中使用的 ID 是否正确
- 检查资源是否存在于指定的控制平面中
- 确保时间范围对于分析查询有效
鸣谢
由 Kong 构建。灵感来自 Stripe 的 Agent Toolkit。
推荐服务器

Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。