zhongchen/mcp-server
If you are the rightful owner of mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
A Model Context Protocol (MCP) server for interacting with Kong Konnect APIs.
Konnect MCP Server
A Model Context Protocol (MCP) server for interacting with Kong Konnect APIs. This server allows AI tools like Claude to interact with Konnect services via structured function calls.
Overview
The Konnect MCP Server implements the Model Context Protocol to provide a bridge between AI assistants and Kong Konnect APIs. It enables AI assistants to:
- List and manage control planes
- List, create, update, and delete services
- List, create, update, and delete routes
- Search for Konnect entities
- List available search types
Prerequisites
- Node.js (v18 or later)
- Kong Konnect account
- Konnect API token with appropriate permissions
Installation
Clone the repository and install dependencies:
git clone https://github.com/your-username/konnect-mcp-server.git
cd konnect-mcp-server
npm install
Building
To build the project:
npm run build
This will compile the TypeScript code and generate the JavaScript files in the dist
directory.
Usage
To start the MCP server:
npm start
Or, you can provide your Konnect API token directly:
npm start -- --token=your_konnect_api_token
Alternatively, you can set the KONNECT_TOKEN
environment variable:
export KONNECT_TOKEN=your_konnect_api_token
npm start
Available Tools
The server exposes the following functions to AI assistants, organized by category:
Core Tools
ListControlPlanes
Lists control planes in a Konnect account.
Parameters:
region
(optional): The Konnect region (us, eu, au, in, me). Default: "us"pageSize
(optional): Maximum number of items per page. Default: 10pageNumber
(optional): Page number to retrieve. Default: 1
SearchKonnect
Searches for entities in Konnect using a query string.
Parameters:
q
(required): The query that defines the search criteria (e.g.,name:"API Gateway"
)region
(optional): The Konnect region (us, eu, au, in, me). Default: "us"pageSize
(optional): Maximum number of items per page. Default: 10pageAfter
(optional): Token for pagination to request the next page
ListSearchTypes
Lists all searchable entity types in Konnect.
Parameters:
region
(optional): The Konnect region (us, eu, au, in, me). Default: "us"
Service Tools
ListServices
Lists services in a specific control plane.
Parameters:
controlPlaneId
(required): The ID of the control planeregion
(optional): The Konnect region (us, eu, au, in, me). Default: "us"pageSize
(optional): Maximum number of items per page. Default: 10pageNumber
(optional): Page number to retrieve. Default: 1tags
(optional): Tags to filter services by. Use comma (,) for AND, forward slash (/) for OR
CreateService
Creates a new service in a control plane.
Parameters:
controlPlaneId
(required): The ID of the control planeservice
(required): Service configuration objectname
(optional): The name of the serviceprotocol
(optional): The protocol to use (http, https, grpc, etc.)host
(required): The host of the upstream serverport
(optional): The port of the upstream server- And other service configuration options
GetService
Fetches details of a specific service.
Parameters:
controlPlaneId
(required): The ID of the control planeserviceId
(required): The ID or name of the service
UpdateService
Updates an existing service.
Parameters:
controlPlaneId
(required): The ID of the control planeserviceId
(required): The ID or name of the serviceservice
(required): Updated service configuration
DeleteService
Deletes a service.
Parameters:
controlPlaneId
(required): The ID of the control planeserviceId
(required): The ID or name of the service
Route Tools
ListRoutes
Lists routes in a specific control plane.
Parameters:
controlPlaneId
(required): The ID of the control planeregion
(optional): The Konnect region (us, eu, au, in, me). Default: "us"pageSize
(optional): Maximum number of items per page. Default: 10pageOffset
(optional): Offset for paginationtags
(optional): Tags to filter routes by. Use comma (,) for AND, forward slash (/) for OR
CreateRoute
Creates a new route in a control plane.
Parameters:
controlPlaneId
(required): The ID of the control planeroute
(required): Route configuration objectname
(optional): The name of the routeprotocols
(optional): An array of protocols this route should matchmethods
(optional): An array of HTTP methods this route should matchhosts
(optional): An array of domain names this route should matchpaths
(optional): An array of paths this route should match- And other route configuration options
GetRoute
Fetches details of a specific route.
Parameters:
controlPlaneId
(required): The ID of the control planerouteId
(required): The ID or name of the route
UpdateRoute
Updates an existing route.
Parameters:
controlPlaneId
(required): The ID of the control planerouteId
(required): The ID or name of the routeroute
(required): Updated route configuration
DeleteRoute
Deletes a route.
Parameters:
controlPlaneId
(required): The ID of the control planerouteId
(required): The ID or name of the route
Development
Project Structure
The project is organized into modules by functionality:
src/
āāā core/ # Core functionality (control planes, search)
ā āāā functions.ts
ā āāā parameters.ts
ā āāā prompts.ts
ā āāā index.ts
āāā services/ # Service-related functionality
ā āāā functions.ts
ā āāā parameters.ts
ā āāā prompts.ts
ā āāā index.ts
āāā routes/ # Route-related functionality
ā āāā functions.ts
ā āāā parameters.ts
ā āāā prompts.ts
ā āāā index.ts
āāā shared/ # Shared utilities
ā āāā api.ts
āāā index.ts # Application entry point
āāā server.ts # MCP server implementation
āāā tools.ts # Tool registration and configuration
Tests
Tests are organized to match the project structure:
src/test/
āāā core/ # Tests for core functionality
āāā services/ # Tests for service-related functionality
āāā routes/ # Tests for route-related functionality
āāā shared/ # Tests for shared utilities
āāā server.test.ts # Tests for the MCP server
Available Scripts
npm run build
: Compiles the TypeScript codenpm run start
: Starts the servernpm run clean
: Removes the dist directorynpm run lint
: Lints the codebasenpm run test
: Runs testsnpm run test:watch
: Runs tests in watch modenpm run prettier
: Formats the codenpm run prettier-check
: Checks if the code is formatted
Search Query Examples
You can use the SearchKonnect
tool with various query formats:
- Search by name:
name:"API Gateway"
- Search by type:
type:user
- Search by attribute:
attributes.email:*@example.com
- Combined search:
type:team AND labels.env:prod
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.