AIGatewayMCPServer exposes tools over the Model Context Protocol (MCP), either by converting a REST API’s endpoints into MCP tools, or by proxying an existing MCP server. Set spec.apiSpec.type to one of five types:
|
Type
|
Client-facing?
|
Purpose
|
conversion-only
|
No
|
Converts a REST API’s endpoints into a named set of MCP tools. Not reachable directly — exposed through a listener’s sources.
|
upstream-server
|
No
|
Registers an existing, third-party MCP server as a backend, with its own tool list. Not reachable directly — exposed through a listener’s sources.
|
listener
|
Yes
|
Aggregates tools from one or more conversion-only/upstream-server resources (named in sources) and exposes them together at one route.
|
conversion-listener
|
Yes
|
A conversion-only and a listener combined into a single resource, for a REST API that doesn’t need to share tools across multiple listeners.
|
passthrough-listener
|
Yes
|
Proxies MCP protocol traffic straight through to an upstream MCP server, unconverted, with its own tool list and access control.
|
Every type shares name, displayName, enabled, labels, policies, and a config.route.paths list, alongside a type-specific tools list and config.url (the upstream to convert or proxy). listener, conversion-listener, and passthrough-listener also accept an access block, gating the endpoint by AIGatewayConsumerGroup ACLs or auth strategy, the same way spec.apiSpec.model.access does on AIGatewayModel.
The following configuration converts two REST endpoints into MCP tools, then exposes them behind an ACL-gated listener:
kind: AIGatewayMCPServer
apiVersion: aiconfiguration.konghq.com/v1alpha1
metadata:
name: flights-tools
namespace: kong
spec:
aiGatewayRef:
type: namespacedRef
namespacedRef:
name: my-ai-gateway-cp
apiSpec:
type: conversion-only
conversion-only:
name: flights-tools
displayName: Flights API tools
enabled: Enabled
config:
url: https://flights-api.example.com/openapi.json
route:
paths:
- /mcp/flights
tools:
- name: search_flights
description: Search available flights by origin, destination, and date
method: GET
path: /flights
- name: get_flight_status
description: Get real-time status for a given flight number
method: GET
path: /flights/{flightNumber}/status
---
kind: AIGatewayMCPServer
apiVersion: aiconfiguration.konghq.com/v1alpha1
metadata:
name: flights-mcp-listener
namespace: kong
spec:
aiGatewayRef:
type: namespacedRef
namespacedRef:
name: my-ai-gateway-cp
apiSpec:
type: listener
listener:
name: flights-mcp-listener
displayName: Flights MCP listener
enabled: Enabled
sources:
- flights-tools
access:
aclAttributeType: consumer
config:
route:
paths:
- /mcp/flights
A passthrough-listener or upstream-server follows the same shape, but its config.url points at a real MCP server instead of a REST API, and its tools entries don’t need method/path (those are inherent to the upstream server’s own tool definitions).