# Kong API Gateway MCP

> Kong API Gateway MCP lets your agent control the full lifecycle of services, routes, and plugins. You can define backend services, map traffic flows, apply AI proxies for LLM routing, and generate consumer keys—all without touching a dashboard.

## Overview
- **Category:** friends-mcp
- **Price:** Free
- **Tags:** api-gateway, microservices, traffic-management, service-orchestration, cloud-native, ai-ops

## Description

This connector gives you direct command over your Kong API Gateway instance. Instead of logging into a management UI or running complex CLI commands, your agent handles the entire process via natural language conversation. You can discover all existing services; list every enabled plugin to check for unused modules; and define entirely new backend services by specifying their URL and protocol. Need to expose that service? Simply create a route mapping specific paths or hosts to it. It's also where you manage access: generate API keys for consumers, configure rate limits by updating plugins, or apply the `ai-proxy` plugin to handle LLM traffic routing. If your workflow needs this level of infrastructure control, connecting via Vinkius is the fastest way to get started.

## Tools

### list_consumers
Retrieves a list of all registered consumer profiles managed by Kong.

### create_consumer_key
Generates an API key credential for a consumer profile in the gateway.

### create_ai_plugin
Applies a new Plugin, such as AI Proxy, to a specific backend service.

### create_route
Establishes a new routing rule to expose a defined backend service through a specific URL path.

### create_service
Defines a brand new, upstream backend service, including its full URL and communication protocol.

### delete_plugin
Permanently removes an existing plugin configuration from the gateway.

### list_plugins
Lists every enabled plugin, such as Rate Limiting or AI Proxy, configured across the gateway.

### list_routes
Retrieves all currently active routing rules defined in the Kong API Gateway.

### list_services
Retrieves a list of every backend service registered and managed by the gateway.

### update_plugin
Modifies the configuration of an existing plugin, allowing dynamic adjustments to settings like rate limits or model providers.

## Prompt Examples

**Prompt:** 
```
List all registered services in my Kong Gateway
```

**Response:** 
```
I've found 4 services: 'auth-api', 'inventory-service', 'ai-gateway-proxy', and 'legacy-backend'. Would you like to see the routing rules for any of these?
```

**Prompt:** 
```
Add the 'ai-proxy' plugin to service ID '123-abc' using OpenAI
```

**Response:** 
```
Applying AI Proxy plugin to service '123-abc'… Done. I've configured it to route traffic to OpenAI using the GPT-4 model. Your gateway is now ready to handle AI requests for this endpoint.
```

**Prompt:** 
```
Who are the registered consumers in our gateway?
```

**Response:** 
```
I've identified 3 consumers: 'MobileApp_Prod', 'ThirdParty_Partner', and 'InternalAdmin_CLI'. 'MobileApp_Prod' has 2 active API keys. Would you like to generate a new key for 'ThirdParty_Partner'?
```

## Capabilities

### Define Backend Services
Creates new upstream definitions for services, specifying the required URL and communication protocol.

### Map Client Endpoints
Configures inbound routing rules, telling the gateway how to direct client requests based on paths or hostnames.

### Manage API Authentication
Lists consumer profiles and generates new API keys for tracking specific user access.

### Configure AI Proxies
Applies and adjusts the `ai-proxy` plugin to control LLM routing, model providers, and key encapsulation settings.

### Audit Gateway Plugins
Lists all active plugins (like Rate Limiting or AI Proxy) across the gateway, allowing you to remove unused modules instantly.

## Use Cases

### A new backend needs an endpoint.
The developer runs into a dead end trying to expose their service. They ask the agent: 'Set up my inventory API.' The agent first calls `create_service` with the upstream URL, then uses `create_route` to map the appropriate path, making it live instantly.

### The AI model provider changed.
The Ops team finds that OpenAI's rate limits are too low. They instruct their agent: 'Increase the limit and switch models.' The agent uses `update_plugin` to adjust the Rate Limiting settings on the existing plugin, avoiding a manual configuration patch.

### We need to track usage for a new partner.
The security team needs dedicated access control. They ask the agent to list all current consumers using `list_consumers`, identify the partner's account, and then use `create_consumer_key` to generate a unique credential set.

### The gateway is bloated.
A Platform Engineer wants to audit the entire infrastructure. They run `list_plugins` to see what's active, spot an old module, and immediately use `delete_plugin` to clean up the proxy pipeline.

## Benefits

- You stop context switching. Instead of navigating between the CLI, a web UI, and documentation, you talk to your agent to define services or update plugins.
- Manage access control granularly. Use `list_consumers` followed by `create_consumer_key` to instantly issue credentials for any specific client or tenant.
- Control AI traffic flow dynamically. With the ability to `update_plugin`, you can swap out LLM models or adjust rate limits on the fly, optimizing provider costs without downtime.
- Build services quickly. The combination of `create_service` and `create_route` lets you define a full microservice endpoint from scratch in two steps.
- Keep your gateway clean. Run `list_plugins` to audit what's running; then use `delete_plugin` to remove outdated modules, keeping the pipeline streamlined.

## How It Works

The bottom line is you manage API connectivity through conversation, treating infrastructure setup like asking a teammate to run a command.

1. Subscribe to this MCP and provide your Kong Admin URL and Admin Token.
2. Use conversational commands to list existing resources—like services or consumer profiles.
3. Issue specific instructions (e.g., 'Create a route for payments') and the agent executes the necessary configuration changes.

## Frequently Asked Questions

**How do I check which services are available using list_services?**
Running `list_services` shows every backend service registered in the gateway. This is your starting point for knowing what APIs you can actually route traffic to.

**What's the difference between create_service and create_route?**
`create_service` defines the actual target endpoint (the 'what'). `create_route` defines how clients access it (the 'how'), mapping a URL to that service.

**How do I control AI plugins using create_ai_plugin?**
You use `create_ai_plugin` when you need to enable the AI Proxy plugin on a specific backend service. This is how your gateway starts managing LLM traffic.

**What if I want to delete an unused module? Should I use delete_plugin?**
Yes, `delete_plugin` permanently removes the specified plugin from the gateway configuration. Use this when you know a module is obsolete and needs removal.

**Can I generate API keys for existing users using create_consumer_key?**
Absolutely. First, use `list_consumers` to find the user profile name, then use `create_consumer_key` to issue a brand new credential set for that consumer.

**How do I adjust rate limiting or change an LLM provider using update_plugin?**
You use `update_plugin` to modify existing configurations in real time. This lets you adjust things like rate limits or swap out AI model providers instantly, which is crucial when your traffic needs change suddenly.

**What information does list_consumers give me about our platform's users?**
Running `list_consumers` provides a roster of every consumer profile registered in Kong. This helps engineers audit which teams or applications are using the gateway and verify their credentials before troubleshooting access issues.

**What specific details can list_services provide about backend dependencies?**
The output from `list_services` shows the core definition for each upstream target. This includes the required URL, name, and communication protocol, helping developers map out live backend services before configuring routes.

**Can I use this server to manage Kong's AI Proxy plugin?**
Absolutely. The `create_ai_plugin` tool is specifically designed to inject the `ai-proxy` plugin onto Services. You can define providers like OpenAI or Anthropic and manage model routing directly through your agent.

**How do I create a new API route through a conversation?**
Use the `create_route` tool and provide a JSON payload defining the paths and the Service ID it should point to. Your agent will handle the Admin API call to provision the routing rule instantly.

**Can my agent generate new API keys for consumers?**
Yes. The `create_consumer_key` tool allows you to provision new credentials for specific Consumers. This is perfect for onboarding new tenants or rotating keys for downstream applications securely.