본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

AI MCP 프록시: 서빙 없이 재사용 가능한 MCP 도구 사양 정의

원문 보기 위키 갱신

AI MCP 프록시: 서빙 없이 재사용 가능한 MCP 도구 사양 정의 (AI MCP Proxy)

이 문서는 AI MCP Proxy 플러그인을 변환 전용(conversion-only) 모드로 구성해, 요청을 직접 서빙하지 않으면서 재사용 가능한 MCP 도구 사양을 정의하는 방법을 안내해요. 변환 전용 모드에서는 플러그인이 스스로 요청을 처리하지 않기 때문에 태그로 참조하는 listener 플러그인과 짝을 이뤄야 한다는 점도 짚어 줘요. 간단한 마켓플레이스 목업 API를 띄운 뒤 decK와 Admin API로 get-users, get-user-orders 도구를 등록하는 과정을 단계별로 따라 해 볼 수 있어요

출처: 문서

본문

서빙 없이 재사용 가능한 MCP 도구 사양 정의하기.v3.12+

서빙 없이 재사용 가능한 MCP 도구 사양을 정의해요.

conversion-only 모드로 실행되는 AI MCP Proxy 플러그인은 요청을 직접 서빙하지 않아요. 태그를 참조하는 listener 플러그인과 짝을 이뤄야 해요. 자세한 내용은 listener 예제를 참고하세요.

이 구성이 제대로 동작하려면 다음과 같은 구성의 Service와 Route가 필요해요:

services:
- name: mcp-service
  url: http://host.docker.internal:3000
  routes:
  - name: mcp-route
    paths:
    - /marketplace

AI MCP Proxy 플러그인을 사용하기 전에 노출할 업스트림 HTTP API가 필요해요. 외부 서비스에 의존하지 않고 플러그인을 테스트하려면 이 목 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

이 예제는 config.tools.annotations.title을 사용해 도구에 의미 있는 이름을 추가해서 사람이 디버깅하기 쉽게 만들어요.

사전 준비

  • 실행 중이고 외부에 노출된 API

플러그인 설정

전역

decK

kong.yaml 구성 파일에 다음 섹션을 추가하세요:

_format_version: "3.0"
plugins:
  - name: ai-mcp-proxy
    config:
      mode: conversion-only
      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
      - description: Get orders for a user
        method: GET
        path: "/marketplace/orders"
        annotations:
          title: get-user-orders
        parameters:
        - name: userid
          in: query
          required: true
          schema:
            type: string
          description: User ID to filter orders
      max_request_body_size: 1048576

{: 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-only",
        "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"
              }
            ]
          },
          {
            "description": "Get orders for a user",
            "method": "GET",
            "path": "/marketplace/orders",
            "annotations": {
              "title": "get-user-orders"
            },
            "parameters": [
              {
                "name": "userid",
                "in": "query",
                "required": true,
                "schema": {
                  "type": "string"
                },
                "description": "User ID to filter orders"
              }
            ]
          }
        ],
        "max_request_body_size": 1048576
      }
    }
    '
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-only",
        "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"
              }
            ]
          },
          {
            "description": "Get orders for a user",
            "method": "GET",
            "path": "/marketplace/orders",
            "annotations": {
              "title": "get-user-orders"
            },
            "parameters": [
              {
                "name": "userid",
                "in": "query",
                "required": true,
                "schema": {
                  "type": "string"
                },
                "description": "User ID to filter orders"
              }
            ]
          }
        ],
        "max_request_body_size": 1048576
      }
    }
    '

다음 플레이스홀더는 반드시 여러분의 값으로 바꾸세요:

  • region: Kong Konnect가 호스팅되고 운영되는 지리적 리전이에요.

  • KONNECT_TOKEN: Konnect 계정과 연결된 개인 액세스 토큰(PAT)이에요.

  • controlPlaneId: 컨트롤 플레인의 id예요.

리전별 URL과 개인 액세스 토큰에 대해 자세히 알아보려면 Konnect Control Planes Config API reference를 참고하세요.

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-only
  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
  - description: Get orders for a user
    method: GET
    path: '/marketplace/orders'
    annotations:
      title: get-user-orders
    parameters:
    - name: userid
      in: query
      required: true
      schema:
        type: string
      description: User ID to filter orders
  max_request_body_size: 1048576
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 Plugin을 생성하려면 Terraform 구성에 다음을 추가하세요:

resource "konnect_gateway_plugin_ai_mcp_proxy" "my_ai_mcp_proxy" {
  enabled = true

  config = {
    mode = "conversion-only"
    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"
          }        ]
      }, 

      {
        description = "Get orders for a user"
        method = "GET"
        path = "/marketplace/orders"

        annotations = {
          title = "get-user-orders"
        }
        parameters = [
          {
            name = "userid"
            in = "query"
            required = true

            schema = {
              type = "string"
            }
            description = "User ID to filter orders"
          }        ]
      }    ]
    max_request_body_size = 1048576
  }

  control_plane_id = konnect_gateway_control_plane.my_konnect_cp.id
}

Service

decK

kong.yaml 구성 파일에 다음 섹션을 추가하세요:

_format_version: "3.0"
plugins:
  - name: ai-mcp-proxy
    service: serviceName|Id
    config:
      mode: conversion-only
      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
      - description: Get orders for a user
        method: GET
        path: "/marketplace/orders"
        annotations:
          title: get-user-orders
        parameters:
        - name: userid
          in: query
          required: true
          schema:
            type: string
          description: User ID to filter orders
      max_request_body_size: 1048576

{: 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-only",
        "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"
              }
            ]
          },
          {
            "description": "Get orders for a user",
            "method": "GET",
            "path": "/marketplace/orders",
            "annotations": {
              "title": "get-user-orders"
            },
            "parameters": [
              {
                "name": "userid",
                "in": "query",
                "required": true,
                "schema": {
                  "type": "string"
                },
                "description": "User ID to filter orders"
              }
            ]
          }
        ],
        "max_request_body_size": 1048576
      }
    }
    '
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-only",
        "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"
              }
            ]
          },
          {
            "description": "Get orders for a user",
            "method": "GET",
            "path": "/marketplace/orders",
            "annotations": {
              "title": "get-user-orders"
            },
            "parameters": [
              {
                "name": "userid",
                "in": "query",
                "required": true,
                "schema": {
                  "type": "string"
                },
                "description": "User ID to filter orders"
              }
            ]
          }
        ],
        "max_request_body_size": 1048576
      }
    }
    '

다음 플레이스홀더는 여러분의 값으로 바꿔야 해요:

  • region: Kong Konnect가 호스팅되고 운영되는 지리적 지역이에요.

  • KONNECT_TOKEN: Konnect 계정에 연결된 개인 액세스 토큰(PAT)이에요.

  • controlPlaneId: 컨트롤 플레인의 id예요.

  • serviceId: 플러그인 구성이 대상으로 지정할 서비스의 id예요.

지역별 URL과 개인 액세스 토큰에 대해 자세히 알아보려면 Konnect Control Planes Config API reference를 확인하세요.

KIC
echo "
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
  name:
  namespace: kong
  annotations:
    kubernetes.io/ingress.class: kong
config:
  mode: conversion-only
  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
  - description: Get orders for a user
    method: GET
    path: '/marketplace/orders'
    annotations:
      title: get-user-orders
    parameters:
    - name: userid
      in: query
      required: true
      schema:
        type: string
      description: User ID to filter orders
  max_request_body_size: 1048576
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-only"
    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"
          }        ]
      }, 

      {
        description = "Get orders for a user"
        method = "GET"
        path = "/marketplace/orders"

        annotations = {
          title = "get-user-orders"
        }
        parameters = [
          {
            name = "userid"
            in = "query"
            required = true

            schema = {
              type = "string"
            }
            description = "User ID to filter orders"
          }        ]
      }    ]
    max_request_body_size = 1048576
  }

  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-only
      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
      - description: Get orders for a user
        method: GET
        path: "/marketplace/orders"
        annotations:
          title: get-user-orders
        parameters:
        - name: userid
          in: query
          required: true
          schema:
            type: string
          description: User ID to filter orders
      max_request_body_size: 1048576

{: 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-only",
        "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"
              }
            ]
          },
          {
            "description": "Get orders for a user",
            "method": "GET",
            "path": "/marketplace/orders",
            "annotations": {
              "title": "get-user-orders"
            },
            "parameters": [
              {
                "name": "userid",
                "in": "query",
                "required": true,
                "schema": {
                  "type": "string"
                },
                "description": "User ID to filter orders"
              }
            ]
          }
        ],
        "max_request_body_size": 1048576
      }
    }
    '

다음 플레이스홀더는 여러분의 값으로 바꿔야 해요:

  • 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-only",
        "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"
              }
            ]
          },
          {
            "description": "Get orders for a user",
            "method": "GET",
            "path": "/marketplace/orders",
            "annotations": {
              "title": "get-user-orders"
            },
            "parameters": [
              {
                "name": "userid",
                "in": "query",
                "required": true,
                "schema": {
                  "type": "string"
                },
                "description": "User ID to filter orders"
              }
            ]
          }
        ],
        "max_request_body_size": 1048576
      }
    }
    '

다음 플레이스홀더는 여러분의 값으로 바꿔야 해요:

  • region: Kong Konnect가 호스팅되고 운영되는 지리적 지역이에요.

  • KONNECT_TOKEN: Konnect 계정에 연결된 개인 액세스 토큰(PAT)이에요.

  • controlPlaneId: 컨트롤 플레인의 id예요.

  • routeId: 플러그인 구성이 대상으로 지정할 라우트의 id예요.

지역별 URL과 개인 액세스 토큰에 대해 자세히 알아보려면 Konnect Control Planes Config API reference를 확인하세요.

KIC
echo "
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
  name:
  namespace: kong
  annotations:
    kubernetes.io/ingress.class: kong
config:
  mode: conversion-only
  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
  - description: Get orders for a user
    method: GET
    path: '/marketplace/orders'
    annotations:
      title: get-user-orders
    parameters:
    - name: userid
      in: query
      required: true
      schema:
        type: string
      description: User ID to filter orders
  max_request_body_size: 1048576
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-only"
    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"
          }        ]
      }, 

      {
        description = "Get orders for a user"
        method = "GET"
        path = "/marketplace/orders"

        annotations = {
          title = "get-user-orders"
        }
        parameters = [
          {
            name = "userid"
            in = "query"
            required = true

            schema = {
              type = "string"
            }
            description = "User ID to filter orders"
          }        ]
      }    ]
    max_request_body_size = 1048576
  }

  control_plane_id = konnect_gateway_control_plane.my_konnect_cp.id
  route = {
    id = konnect_gateway_route.my_route.id
  }
}

관련 리소스

다음 단계

더 알아보기 (Learn more)

  • 플러그인의 전체 기능과 모드 구성을 먼저 훑어봐요 — AI MCP Proxy
  • 예제에서 쓴 annotations.title 등 도구 설정 옵션의 세부를 확인해요 — config.tools.annotations.title
  • 예제 실행에 필요한 게이트웨이 Service 설정 방법을 익혀요 — Service
  • API를 MCP 도구로 자동 변환하는 또 다른 접근 방식도 비교해 봐요 — Autogenerate serverless MCP
  • Kong에서 MCP 트래픽을 다루는 큰 그림을 함께 살펴봐요 — Kong MCP traffic gateway