AI MCP Proxy: 컨슈머 그룹 기반 MCP 도구 접근 제어 규칙 설정
AI MCP Proxy: 컨슈머 그룹 기반 MCP 도구 접근 제어 규칙 설정 (Set access control rules for MCP tools based on consumer groups)
이 문서는 AI MCP Proxy 플러그인을 conversion-listener 모드로 사용할 때 컨슈머 그룹별로 MCP 도구 접근을 제어하는 방법을 안내해요
출처: 문서
본문
컨슈머 그룹을 기준으로 MCP 도구에 대한 접근 제어 규칙 설정하기v3.12+
conversion-listener 모드에서 어떤 컨슈머 그룹이 특정 MCP 도구에 접근할 수 있는지 정의해요. 모든 도구에 적용되는 기본 규칙을 사용한 다음, 필요에 따라 개별 도구의 접근을 재정의하세요.
이 설정이 제대로 동작하려면 다음 Kong Gateway 엔티티를 만들어야 해요:
services: - name: mcp-service url: http://host.docker.internal:3000 routes: - name: mcp-route paths: - /marketplace plugins: - name: key-auth route: mcp-route config: key_names: - apikey consumer_groups: - name: admin - name: developer - name: suspended consumers: - username: alice groups: - name: admin keyauth_credentials: - key: alice-key - username: bob groups: - name: developer keyauth_credentials: - key: bob-key - username: carol groups: - name: suspended keyauth_credentials: - key: carol-key
conversion-listener 모드와 conversion-only 모드에서는 플러그인이 HTTP 엔드포인트 설정에서 MCP 도구를 직접 정의해요. 각 도구는 컨슈머 그룹별 접근 제어 규칙을 선택적으로 지정할 수 있어요.
AI MCP Proxy 플러그인을 사용하기 전에, 노출할 업스트림 HTTP API가 필요해요.
외부 서비스에 의존하지 않고 플러그인을 테스트하려면 이 목(mock) API를 사용하세요. 샘플 사용자와 주문이 있는 작은 마켓플레이스를 시뮬레이션하며, /marketplace/users와 /marketplace/{userId}/orders 엔드포인트를 통해 노출돼요:
curl -s -o api.js "https://gist.githubusercontent.com/subnetmarco/5ddb23876f9ce7165df17f9216f75cce/raw/a44a947d69e6f597465050cc595b6abf4db2fbea/api.js"
npm install express
node api.js
사전 준비
- 실행 중이고 외부에 노출된 API
플러그인 설정하기
전역
decK
다음 섹션을 kong.yaml 설정 파일에 추가하세요:
_format_version: "3.0"
plugins:
- name: ai-mcp-proxy
config:
mode: conversion-listener
include_consumer_groups: true
default_acl:
- scope: tools
allow:
- developer
- admin
deny:
- suspended
tools:
- description: Get users
method: GET
path: "/marketplace/users"
annotations:
title: Get users
parameters:
- name: id
in: query
required: false
schema:
type: string
description: Optional user ID
acl:
allow:
- admin
- description: Get orders for a user
method: GET
path: "/marketplace/orders"
annotations:
title: Get users orders
parameters:
- name: userid
in: query
required: true
schema:
type: string
description: User ID to filter orders
acl:
allow:
- admin
- developer
server:
timeout: 60000
max_request_body_size: 8192
{: data-file="kong.yaml" data-tool="deck" }
Admin API
다음 요청을 보내세요:
curl -i -X POST http://localhost:8001/plugins/ \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data '
{
"name": "ai-mcp-proxy",
"config": {
"mode": "conversion-listener",
"include_consumer_groups": true,
"default_acl": [
{
"scope": "tools",
"allow": [
"developer",
"admin"
],
"deny": [
"suspended"
]
}
],
"tools": [
{
"description": "Get users",
"method": "GET",
"path": "/marketplace/users",
"annotations": {
"title": "Get users"
},
"parameters": [
{
"name": "id",
"in": "query",
"required": false,
"schema": {
"type": "string"
},
"description": "Optional user ID"
}
],
"acl": {
"allow": [
"admin"
]
}
},
{
"description": "Get orders for a user",
"method": "GET",
"path": "/marketplace/orders",
"annotations": {
"title": "Get users orders"
},
"parameters": [
{
"name": "userid",
"in": "query",
"required": true,
"schema": {
"type": "string"
},
"description": "User ID to filter orders"
}
],
"acl": {
"allow": [
"admin",
"developer"
]
}
}
],
"server": {
"timeout": 60000
},
"max_request_body_size": 8192
}
}
'
Konnect API
다음 요청을 보내세요:
curl -X POST https://{region}.api.konghq.com/v2/control-planes/{controlPlaneId}/core-entities/plugins/ \
--header "accept: application/json" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer $KONNECT_TOKEN" \
--data '
{
"name": "ai-mcp-proxy",
"config": {
"mode": "conversion-listener",
"include_consumer_groups": true,
"default_acl": [
{
"scope": "tools",
"allow": [
"developer",
"admin"
],
"deny": [
"suspended"
]
}
],
"tools": [
{
"description": "Get users",
"method": "GET",
"path": "/marketplace/users",
"annotations": {
"title": "Get users"
},
"parameters": [
{
"name": "id",
"in": "query",
"required": false,
"schema": {
"type": "string"
},
"description": "Optional user ID"
}
],
"acl": {
"allow": [
"admin"
]
}
},
{
"description": "Get orders for a user",
"method": "GET",
"path": "/marketplace/orders",
"annotations": {
"title": "Get users orders"
},
"parameters": [
{
"name": "userid",
"in": "query",
"required": true,
"schema": {
"type": "string"
},
"description": "User ID to filter orders"
}
],
"acl": {
"allow": [
"admin",
"developer"
]
}
}
],
"server": {
"timeout": 60000
},
"max_request_body_size": 8192
}
}
'
다음 플레이스홀더는 여러분의 값으로 바꿔야 해요:
-
region: Kong Konnect가 호스팅되고 운영되는 지리적 리전이에요. -
KONNECT_TOKEN: Konnect 계정에 연결된 개인 액세스 토큰(PAT)이에요. -
controlPlaneId: 컨트롤 플레인의id예요.
리전별 URL과 개인 액세스 토큰에 대해 자세히 알아보려면 Konnect Control Planes Config API 레퍼런스를 참고하세요.
KIC
echo "
apiVersion: configuration.konghq.com/v1
kind: KongClusterPlugin
metadata:
name:
namespace: kong
annotations:
kubernetes.io/ingress.class: kong
labels:
global: 'true'
config:
mode: conversion-listener
include_consumer_groups: true
default_acl:
- scope: tools
allow:
- developer
- admin
deny:
- suspended
tools:
- description: Get users
method: GET
path: '/marketplace/users'
annotations:
title: Get users
parameters:
- name: id
in: query
required: false
schema:
type: string
description: Optional user ID
acl:
allow:
- admin
- description: Get orders for a user
method: GET
path: '/marketplace/orders'
annotations:
title: Get users orders
parameters:
- name: userid
in: query
required: true
schema:
type: string
description: User ID to filter orders
acl:
allow:
- admin
- developer
server:
timeout: 60000
max_request_body_size: 8192
plugin: ai-mcp-proxy
" | kubectl apply -f -
Terraform
사전 준비: 개인 액세스 토큰 설정하기
terraform {
required_providers {
konnect = {
source = "kong/konnect"
}
}
}
provider "konnect" {
personal_access_token = "$KONNECT_TOKEN"
server_url = "https://us.api.konghq.com/"
}
Konnect Gateway 플러그인을 생성하려면 Terraform 설정에 다음을 추가하세요:
resource "konnect_gateway_plugin_ai_mcp_proxy" "my_ai_mcp_proxy" {
enabled = true
config = {
mode = "conversion-listener"
include_consumer_groups = true
default_acl = [
{
scope = "tools"
allow = ["developer", "admin"]
deny = ["suspended"]
} ]
tools = [
{
description = "Get users"
method = "GET"
path = "/marketplace/users"
annotations = {
title = "Get users"
}
parameters = [
{
name = "id"
in = "query"
required = false
schema = {
type = "string"
}
description = "Optional user ID"
} ]
acl = {
allow = ["admin"]
}
},
{
description = "Get orders for a user"
method = "GET"
path = "/marketplace/orders"
annotations = {
title = "Get users orders"
}
parameters = [
{
name = "userid"
in = "query"
required = true
schema = {
type = "string"
}
description = "User ID to filter orders"
} ]
acl = {
allow = ["admin", "developer"]
}
} ]
server = {
timeout = 60000
}
max_request_body_size = 8192
}
control_plane_id = konnect_gateway_control_plane.my_konnect_cp.id
}
서비스
decK
다음 섹션을 kong.yaml 설정 파일에 추가하세요:
_format_version: "3.0"
plugins:
- name: ai-mcp-proxy
service: serviceName|Id
config:
mode: conversion-listener
include_consumer_groups: true
default_acl:
- scope: tools
allow:
- developer
- admin
deny:
- suspended
tools:
- description: Get users
method: GET
path: "/marketplace/users"
annotations:
title: Get users
parameters:
- name: id
in: query
required: false
schema:
type: string
description: Optional user ID
acl:
allow:
- admin
- description: Get orders for a user
method: GET
path: "/marketplace/orders"
annotations:
title: Get users orders
parameters:
- name: userid
in: query
required: true
schema:
type: string
description: User ID to filter orders
acl:
allow:
- admin
- developer
server:
timeout: 60000
max_request_body_size: 8192
{: data-file="kong.yaml" data-tool="deck" }
다음 플레이스홀더는 여러분의 값으로 바꿔야 해요:
serviceName|Id: 플러그인 설정이 대상으로 지정할 서비스의id또는name이에요.
Admin API
다음과 같이 요청하세요:
curl -i -X POST http://localhost:8001/services/{serviceName|Id}/plugins/ \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data '
{
"name": "ai-mcp-proxy",
"config": {
"mode": "conversion-listener",
"include_consumer_groups": true,
"default_acl": [
{
"scope": "tools",
"allow": [
"developer",
"admin"
],
"deny": [
"suspended"
]
}
],
"tools": [
{
"description": "Get users",
"method": "GET",
"path": "/marketplace/users",
"annotations": {
"title": "Get users"
},
"parameters": [
{
"name": "id",
"in": "query",
"required": false,
"schema": {
"type": "string"
},
"description": "Optional user ID"
}
],
"acl": {
"allow": [
"admin"
]
}
},
{
"description": "Get orders for a user",
"method": "GET",
"path": "/marketplace/orders",
"annotations": {
"title": "Get users orders"
},
"parameters": [
{
"name": "userid",
"in": "query",
"required": true,
"schema": {
"type": "string"
},
"description": "User ID to filter orders"
}
],
"acl": {
"allow": [
"admin",
"developer"
]
}
}
],
"server": {
"timeout": 60000
},
"max_request_body_size": 8192
}
}
'
다음 플레이스홀더는 반드시 여러분의 값으로 바꿔야 해요:
serviceName|Id: 플러그인 구성이 대상으로 삼을 서비스의id또는name이에요.
Konnect API
다음과 같이 요청하세요:
curl -X POST https://{region}.api.konghq.com/v2/control-planes/{controlPlaneId}/core-entities/services/{serviceId}/plugins/ \
--header "accept: application/json" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer $KONNECT_TOKEN" \
--data '
{
"name": "ai-mcp-proxy",
"config": {
"mode": "conversion-listener",
"include_consumer_groups": true,
"default_acl": [
{
"scope": "tools",
"allow": [
"developer",
"admin"
],
"deny": [
"suspended"
]
}
],
"tools": [
{
"description": "Get users",
"method": "GET",
"path": "/marketplace/users",
"annotations": {
"title": "Get users"
},
"parameters": [
{
"name": "id",
"in": "query",
"required": false,
"schema": {
"type": "string"
},
"description": "Optional user ID"
}
],
"acl": {
"allow": [
"admin"
]
}
},
{
"description": "Get orders for a user",
"method": "GET",
"path": "/marketplace/orders",
"annotations": {
"title": "Get users orders"
},
"parameters": [
{
"name": "userid",
"in": "query",
"required": true,
"schema": {
"type": "string"
},
"description": "User ID to filter orders"
}
],
"acl": {
"allow": [
"admin",
"developer"
]
}
}
],
"server": {
"timeout": 60000
},
"max_request_body_size": 8192
}
}
'
다음 플레이스홀더는 반드시 여러분의 값으로 바꿔야 해요:
-
region: Kong Konnect가 호스팅되고 운영되는 지리적 지역이에요. -
KONNECT_TOKEN: Konnect 계정과 연결된 개인 액세스 토큰(PAT)이에요. -
controlPlaneId: 컨트롤 플레인의id예요. -
serviceId: 플러그인 구성이 대상으로 삼을 서비스의id예요.
지역별 URL과 개인 액세스 토큰에 대해 자세히 알아보려면 Konnect Control Planes Config API 참조를 확인하세요.
KIC
echo "
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name:
namespace: kong
annotations:
kubernetes.io/ingress.class: kong
config:
mode: conversion-listener
include_consumer_groups: true
default_acl:
- scope: tools
allow:
- developer
- admin
deny:
- suspended
tools:
- description: Get users
method: GET
path: '/marketplace/users'
annotations:
title: Get users
parameters:
- name: id
in: query
required: false
schema:
type: string
description: Optional user ID
acl:
allow:
- admin
- description: Get orders for a user
method: GET
path: '/marketplace/orders'
annotations:
title: Get users orders
parameters:
- name: userid
in: query
required: true
schema:
type: string
description: User ID to filter orders
acl:
allow:
- admin
- developer
server:
timeout: 60000
max_request_body_size: 8192
plugin: ai-mcp-proxy
" | kubectl apply -f -
다음으로, service 리소스에 어노테이션을 붙여서 KongPlugin 리소스를 적용하세요:
kubectl annotate -n kong service SERVICE_NAME konghq.com/plugins=
Terraform
사전 요구 사항: 개인 액세스 토큰 구성하기
terraform {
required_providers {
konnect = {
source = "kong/konnect"
}
}
}
provider "konnect" {
personal_access_token = "$KONNECT_TOKEN"
server_url = "https://us.api.konghq.com/"
}
Konnect Gateway 플러그인을 생성하려면 Terraform 구성에 다음을 추가하세요:
resource "konnect_gateway_plugin_ai_mcp_proxy" "my_ai_mcp_proxy" {
enabled = true
config = {
mode = "conversion-listener"
include_consumer_groups = true
default_acl = [
{
scope = "tools"
allow = ["developer", "admin"]
deny = ["suspended"]
} ]
tools = [
{
description = "Get users"
method = "GET"
path = "/marketplace/users"
annotations = {
title = "Get users"
}
parameters = [
{
name = "id"
in = "query"
required = false
schema = {
type = "string"
}
description = "Optional user ID"
} ]
acl = {
allow = ["admin"]
}
},
{
description = "Get orders for a user"
method = "GET"
path = "/marketplace/orders"
annotations = {
title = "Get users orders"
}
parameters = [
{
name = "userid"
in = "query"
required = true
schema = {
type = "string"
}
description = "User ID to filter orders"
} ]
acl = {
allow = ["admin", "developer"]
}
} ]
server = {
timeout = 60000
}
max_request_body_size = 8192
}
control_plane_id = konnect_gateway_control_plane.my_konnect_cp.id
service = {
id = konnect_gateway_service.my_service.id
}
}
Route
decK
kong.yaml 구성 파일에 이 섹션을 추가하세요:
_format_version: "3.0"
plugins:
- name: ai-mcp-proxy
route: routeName|Id
config:
mode: conversion-listener
include_consumer_groups: true
default_acl:
- scope: tools
allow:
- developer
- admin
deny:
- suspended
tools:
- description: Get users
method: GET
path: "/marketplace/users"
annotations:
title: Get users
parameters:
- name: id
in: query
required: false
schema:
type: string
description: Optional user ID
acl:
allow:
- admin
- description: Get orders for a user
method: GET
path: "/marketplace/orders"
annotations:
title: Get users orders
parameters:
- name: userid
in: query
required: true
schema:
type: string
description: User ID to filter orders
acl:
allow:
- admin
- developer
server:
timeout: 60000
max_request_body_size: 8192
{: data-file="kong.yaml" data-tool="deck" }
다음 플레이스홀더는 반드시 여러분의 값으로 바꿔야 해요:
routeName|Id: 플러그인 구성이 대상으로 삼을 라우트의id또는name이에요.
Admin API
다음과 같이 요청하세요:
curl -i -X POST http://localhost:8001/routes/{routeName|Id}/plugins/ \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data '
{
"name": "ai-mcp-proxy",
"config": {
"mode": "conversion-listener",
"include_consumer_groups": true,
"default_acl": [
{
"scope": "tools",
"allow": [
"developer",
"admin"
],
"deny": [
"suspended"
]
}
],
"tools": [
{
"description": "Get users",
"method": "GET",
"path": "/marketplace/users",
"annotations": {
"title": "Get users"
},
"parameters": [
{
"name": "id",
"in": "query",
"required": false,
"schema": {
"type": "string"
},
"description": "Optional user ID"
}
],
"acl": {
"allow": [
"admin"
]
}
},
{
"description": "Get orders for a user",
"method": "GET",
"path": "/marketplace/orders",
"annotations": {
"title": "Get users orders"
},
"parameters": [
{
"name": "userid",
"in": "query",
"required": true,
"schema": {
"type": "string"
},
"description": "User ID to filter orders"
}
],
"acl": {
"allow": [
"admin",
"developer"
]
}
}
],
"server": {
"timeout": 60000
},
"max_request_body_size": 8192
}
}
'
다음 플레이스홀더는 반드시 여러분의 값으로 바꿔야 해요:
routeName|Id: 플러그인 구성이 대상으로 삼을 라우트의id또는name이에요.
Konnect API
다음 요청을 보내세요:
curl -X POST https://{region}.api.konghq.com/v2/control-planes/{controlPlaneId}/core-entities/routes/{routeId}/plugins/ \
--header "accept: application/json" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer $KONNECT_TOKEN" \
--data '
{
"name": "ai-mcp-proxy",
"config": {
"mode": "conversion-listener",
"include_consumer_groups": true,
"default_acl": [
{
"scope": "tools",
"allow": [
"developer",
"admin"
],
"deny": [
"suspended"
]
}
],
"tools": [
{
"description": "Get users",
"method": "GET",
"path": "/marketplace/users",
"annotations": {
"title": "Get users"
},
"parameters": [
{
"name": "id",
"in": "query",
"required": false,
"schema": {
"type": "string"
},
"description": "Optional user ID"
}
],
"acl": {
"allow": [
"admin"
]
}
},
{
"description": "Get orders for a user",
"method": "GET",
"path": "/marketplace/orders",
"annotations": {
"title": "Get users orders"
},
"parameters": [
{
"name": "userid",
"in": "query",
"required": true,
"schema": {
"type": "string"
},
"description": "User ID to filter orders"
}
],
"acl": {
"allow": [
"admin",
"developer"
]
}
}
],
"server": {
"timeout": 60000
},
"max_request_body_size": 8192
}
}
'
다음 자리 표시자를 여러분의 값으로 바꿔야 해요:
-
region: Kong Konnect가 호스팅되고 운영되는 지리적 리전이에요. -
KONNECT_TOKEN: Konnect 계정과 연결된 개인 액세스 토큰(PAT)이에요. -
controlPlaneId: 컨트롤 플레인의id예요. -
routeId: 플러그인 구성이 대상으로 삼을 라우트의id예요.
리전별 URL과 개인 액세스 토큰에 대해 알아보려면 Konnect Control Planes Config API 참조 문서를 확인하세요.
KIC
echo "
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name:
namespace: kong
annotations:
kubernetes.io/ingress.class: kong
config:
mode: conversion-listener
include_consumer_groups: true
default_acl:
- scope: tools
allow:
- developer
- admin
deny:
- suspended
tools:
- description: Get users
method: GET
path: '/marketplace/users'
annotations:
title: Get users
parameters:
- name: id
in: query
required: false
schema:
type: string
description: Optional user ID
acl:
allow:
- admin
- description: Get orders for a user
method: GET
path: '/marketplace/orders'
annotations:
title: Get users orders
parameters:
- name: userid
in: query
required: true
schema:
type: string
description: User ID to filter orders
acl:
allow:
- admin
- developer
server:
timeout: 60000
max_request_body_size: 8192
plugin: ai-mcp-proxy
" | kubectl apply -f -
다음으로, httproute 또는 ingress 리소스에 어노테이션을 붙여서 KongPlugin 리소스를 적용해요:
Gateway API
kubectl annotate -n kong httproute konghq.com/plugins=
Ingress
kubectl annotate -n kong ingress konghq.com/plugins=
Terraform
사전 준비: 개인 액세스 토큰 구성하기
terraform {
required_providers {
konnect = {
source = "kong/konnect"
}
}
}
provider "konnect" {
personal_access_token = "$KONNECT_TOKEN"
server_url = "https://us.api.konghq.com/"
}
Konnect Gateway 플러그인을 생성하려면 Terraform 구성에 다음 내용을 추가해요:
resource "konnect_gateway_plugin_ai_mcp_proxy" "my_ai_mcp_proxy" {
enabled = true
config = {
mode = "conversion-listener"
include_consumer_groups = true
default_acl = [
{
scope = "tools"
allow = ["developer", "admin"]
deny = ["suspended"]
} ]
tools = [
{
description = "Get users"
method = "GET"
path = "/marketplace/users"
annotations = {
title = "Get users"
}
parameters = [
{
name = "id"
in = "query"
required = false
schema = {
type = "string"
}
description = "Optional user ID"
} ]
acl = {
allow = ["admin"]
}
},
{
description = "Get orders for a user"
method = "GET"
path = "/marketplace/orders"
annotations = {
title = "Get users orders"
}
parameters = [
{
name = "userid"
in = "query"
required = true
schema = {
type = "string"
}
description = "User ID to filter orders"
} ]
acl = {
allow = ["admin", "developer"]
}
} ]
server = {
timeout = 60000
}
max_request_body_size = 8192
}
control_plane_id = konnect_gateway_control_plane.my_konnect_cp.id
route = {
id = konnect_gateway_route.my_route.id
}
}
관련 리소스
다음 단계
더 알아보기 (Learn more)
- AI MCP Proxy 플러그인의 설정 옵션과 모드별 동작을 자세히 확인할 수 있어요 — AI MCP Proxy
- 컨슈머와 컨슈머 그룹 ACL로 MCP 도구 접근을 제어하는 방법을 심화로 다뤄봐요 — Control MCP tool access with Consumer and Consumer Group ACLs
- Kong Gateway가 MCP 트래픽을 처리하는 방식에 대한 개념을 정리해 볼 수 있어요 — Kong MCP traffic gateway
- 여러 MCP 서버를 집계할 때 ACL을 적용하는 방법을 살펴봐요 — Enforce ACLs on aggregated MCP servers
- AI Gateway의 전반적인 개념과 제공 기능을 이해하는 데 도움이 돼요 — About AI Gateway