Kong MCP-Konnect is a server project based on the Model Context Protocol (MCP) that allows AI assistants to query and analyze Kong Gateway configurations, traffic, and analytics data. This project enables AI assistants like Claude to interact with Kong Konnect's API gateway using natural language.
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
# 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
Set the following environment variables to configure the MCP server:
# Required: Your Kong Konnect API key
export KONNECT_ACCESS_TOKEN=kpat_api_key_here
# Optional: API region to use (defaults to US)
# Possible values: US, EU, AU, ME, IN
export KONNECT_REGION=us
analyze-api-requests
)Queries and analyzes Kong API gateway requests, supporting custom filters.
Input Parameters:
timeRange
: Time range for data retrieval (15M, 1H, 6H, 12H, 24H, 7D)statusCodes
: Filter by specific HTTP status codesexcludeStatusCodes
: Exclude specific HTTP status codeshttpMethods
: Filter by HTTP methodsconsumerIds
: Filter by consumer IDsserviceIds
: Filter by service IDsrouteIds
: Filter by route IDsmaxResults
: Maximum number of results to returnanalyze-consumer-requests
)Analyzes API requests made by a specific consumer.
Input Parameters:
consumerId
: ID of the consumer to analyzetimeRange
: Time range for data retrievalsuccessOnly
: Show only successful (2xx) requestsfailureOnly
: Show only failed (non-2xx) requestsmaxResults
: Maximum number of results to returnlist-services
)Lists all services associated with a control plane.
Input Parameters:
controlPlaneId
: Control plane IDsize
: Number of services to returnoffset
: Pagination offset tokenlist-routes
)Lists all routes associated with a control plane.
list-consumers
)Lists all consumers associated with a control plane.
list-plugins
)Lists all plugins associated with a control plane.
list-control-planes
)Lists all control planes in the organization.
Input Parameters:
pageSize
: Number of control planes per pagepageNumber
: Page number to retrievefilterName
: Filter control planes by namefilterClusterType
: Filter by cluster typefilterCloudGateway
: Filter by cloud gateway functionalitylabels
: Filter by labelssort
: Sort field and directionget-control-plane
)Retrieves detailed information about a specific control plane.
list-control-plane-group-members
)Lists all control plane members of a specific group.
check-control-plane-group-membership
)Checks if a control plane is a member of any group.
Download and install Claude for Desktop from the Claude website.
Create or edit the Claude Desktop configuration file:
MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"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"
}
}
}
}
After restarting, the Kong Konnect tools will be available for use with Claude.
Please list all control planes in my Kong Konnect organization.
List all services for control plane [CONTROL_PLANE_NAME/ID].
Show me all API requests with 5xx status codes for service [SERVICE_NAME/ID] in the past hour.
List all consumers for control plane [CONTROL_PLANE_NAME/ID].
Show me all requests made by consumer [CONSUMER_NAME/ID] in the past 24 hours.
What are the most common errors encountered by this consumer?
To add a new tool, follow these steps:
parameters.ts
prompts.ts
operations/
tools.ts
index.ts
Kong MCP-Konnect is a powerful tool that bridges the gap between AI assistants and Kong API gateway management. By providing a natural language interface to query and analyze API gateway configurations, traffic, and analytics data, it makes API management more intuitive and efficient. The project offers a rich feature set, from basic configuration queries to advanced traffic analysis, making it an important tool for modern API infrastructure management.