Aggregate MCP tools from multiple AI MCP Proxy plugins
Use AI MCP Proxy in conversion-only mode to convert each RESTful API into MCP tools, then configure a listener-mode plugin to aggregate and expose all tools to AI clients. Then, use Cursor, or any other compatible client to validate the aggregated tool calls.
Prerequisites
Kong Konnect
This is a Konnect tutorial and requires a Konnect personal access token.
- 
    Create a new personal access token by opening the Konnect PAT page and selecting Generate Token. 
- 
    Export your token to an environment variable: export KONNECT_TOKEN='YOUR_KONNECT_PAT'Copied!
- 
    Run the quickstart script to automatically provision a Control Plane and Data Plane, and configure your environment: curl -Ls https://get.konghq.com/quickstart | bash -s -- -k $KONNECT_TOKEN --deck-outputCopied!This sets up a Konnect Control Plane named quickstart, provisions a local Data Plane, and prints out the following environment variable exports:export DECK_KONNECT_TOKEN=$KONNECT_TOKEN export DECK_KONNECT_CONTROL_PLANE_NAME=quickstart export KONNECT_CONTROL_PLANE_URL=https://us.api.konghq.com export KONNECT_PROXY_URL='http://localhost:8000'Copied!Copy and paste these into your terminal to configure your session. 
Kong Gateway running
This tutorial requires Kong Gateway Enterprise. If you don’t have Kong Gateway set up yet, you can use the quickstart script with an enterprise license to get an instance of Kong Gateway running almost instantly.
- 
    Export your license to an environment variable: export KONG_LICENSE_DATA='LICENSE-CONTENTS-GO-HERE'Copied!
- 
    Run the quickstart script: curl -Ls https://get.konghq.com/quickstart | bash -s -- -e KONG_LICENSE_DATACopied!Once Kong Gateway is ready, you will see the following message: Kong Gateway Ready
decK v1.43+
decK is a CLI tool for managing Kong Gateway declaratively with state files. To complete this tutorial, install decK version 1.43 or later.
This guide uses deck gateway apply, which directly applies entity configuration to your Gateway instance.
  We recommend upgrading your decK installation to take advantage of this tool.
You can check your current decK version with deck version.
Required entities
For this tutorial, you’ll need Kong Gateway entities, like Gateway Services and Routes, pre-configured. These entities are essential for Kong Gateway to function but installing them isn’t the focus of this guide. Follow these steps to pre-configure them:
- 
    Run the following command: echo ' _format_version: "3.0" services: - name: mcp-service url: http://host.docker.internal:3000 - name: weather-service url: https://api.weatherapi.com/v1/current.json - name: freecurrency-service url: https://api.freecurrencyapi.com/v1/latest routes: - name: mcp-route paths: - "/marketplace" service: name: mcp-service - name: weather-route paths: - "/weather" service: name: weather-service - name: freecurrency-route paths: - "/currency" service: name: freecurrency-service - name: listener-route paths: - "/mcp-listener" ' | deck gateway apply -Copied!
To learn more about entities, you can read our entities documentation.
Mock /marketplace API server
Before setting up the first AI MCP Proxy plugin, you need an upstream HTTP API. For this tutorial, use a simple Express-based mock API that simulates a small marketplace with users and their orders. It exposes /marketplace/users and /marketplace/{userId}/orders endpoints.
Run the following to download and start the mock API:
curl -s -o api.js "https://gist.githubusercontent.com/subnetmarco/5ddb23876f9ce7165df17f9216f75cce/raw/a44a947d69e6f597465050cc595b6abf4db2fbea/api.js"
npm install express
node api.js
Verify it’s running:
curl -X GET http://localhost:3000
You should see:
{"name":"Sample Users API"}%
WeatherAPI account
- Go to WeatherAPI.
- Navigate to your dashboard and copy your API key.
- Export your API key by running the following command in your terminal:
export DECK_WEATHERAPI_API_KEY='your-weatherapi-api-key'Copied!
FreecurrencyAPI account
- Go to FreecurrencyAPI.
- Sign up for a free account.
- Navigate to your dashboard and copy your API key.
- Export your API key by running the following command in your terminal:
export DECK_FREECURRENCYAPI_API_KEY='your-freecurrencyapi-api-key'Copied!
MCP Inspector
This tutorial uses the MCP Inspector which helps you explore and debug MCP servers.
- 
    Ensure you have Node.js and npm installed. If needed, download them from https://nodejs.org. 
- Update npxto the latest version:npm install -g npxCopied!
- Then install the Inspector:
npm install -g @modelcontextprotocol/inspectorCopied!
Cursor
This tutorial uses Cursor as an MCP client:
- Go to the Cursor downloads page.
- Download the installer for your operating system.
- Install Cursor on your machine.
- Launch Cursor and sign in to your account or create a new account.
Configure the first AI MCP Proxy plugin
Let’s configure the first AI MCP Proxy plugin to convert its endpoints to MCP tools.
We configure the plugin in conversion-only mode because this instance only converts RESTful API paths into MCP tool definitions. It doesn’t handle incoming MCP requests directly. Later, we’ll aggregate these tools from multiple conversion-only instances using listener-mode plugins.
In this configuration we define tags[] at the plugin level because listener AI MCP Proxy plugin will use them to discover, aggregate, and expose the registered tools.
echo '
_format_version: "3.0"
plugins:
  - name: ai-mcp-proxy
    tags:
    - mcp-tools
    route: mcp-route
    config:
      mode: conversion-only
      tools:
      - description: Get users
        method: GET
        path: "/marketplace/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"
        parameters:
        - description: User ID to filter orders
          in: query
          name: userid
          required: true
          schema:
            type: string
' | deck gateway apply -
Configure the second AI MCP Proxy plugin for the WeatherAPI
Step 1: Add an API key using the Request Transformer Advanced plugin
To authenticate to Weather API, we’ll need to configure the Request Transformer Advanced plugin. This plugin modifies outgoing requests before they reach the upstream API. In this example, it automatically appends your WeatherAPI API key to the query string so that all requests are authenticated without needing to manually provide the key each time.
echo '
_format_version: "3.0"
plugins:
  - name: request-transformer-advanced
    route: weather-route
    enabled: true
    config:
      add:
        querystring:
        - key:${{ env "DECK_WEATHERAPI_API_KEY" }}
' | deck gateway apply -
Step 2: Configure the AI MCP Proxy plugin
We can move on to configuring the second AI MCP Proxy plugin. Like the previous marketplace configuration, this instance only converts RESTful paths into tool definitions and doesn’t process MCP requests directly. Again, the tags[] field ensures that listener-mode plugins can later discover and aggregate this tool along with others from the marketplace instance.
echo '
_format_version: "3.0"
plugins:
  - name: ai-mcp-proxy
    tags:
    - mcp-tools
    route: weather-route
    config:
      mode: conversion-only
      tools:
      - description: Get current weather for a location
        method: GET
        path: "/weather"
        parameters:
        - name: q
          in: query
          required: true
          schema:
            type: string
          description: Location query. Accepts US Zipcode, UK Postcode, Canada Postalcode,
            IP address, latitude/longitude, or city name.
' | deck gateway apply -
Configure the third AI MCP Proxy plugin for Free Currency
Step 1: Add an API key using the Request Transformer Advanced plugin
To authenticate requests to the Free Currency API, we use the Request Transformer Advanced plugin again to append the API key to all requests automatically.
echo '
_format_version: "3.0"
plugins:
  - name: request-transformer-advanced
    route: freecurrency-route
    enabled: true
    config:
      add:
        querystring:
        - apikey:${{ env "DECK_FREECURRENCYAPI_API_KEY" }}
' | deck gateway apply -
Step 2: Configure the AI MCP Proxy plugin
As in the previous steps, this AI MCP Proxy instance converts the RESTful paths of FreecurrencyAPI into tool definitions only. They will be aggregated by the listener-mode plugin based on the tags[] field.
echo '
_format_version: "3.0"
plugins:
  - name: ai-mcp-proxy
    route: freecurrency-route
    tags:
    - mcp-tools
    config:
      mode: conversion-only
      tools:
      - description: Get latest exchange rates for one or more currencies
        method: GET
        path: "/currency"
        parameters:
        - name: currencies
          in: query
          required: false
          schema:
            type: string
          description: A comma-separated list of currency codes (e.g., "EUR,USD,CAD").
' | deck gateway apply -
Configure the listener AI MCP Proxy plugin
Now, let’s configure another AI MCP Proxy plugin instance in listener mode to aggregate and expose the tools registered by the conversion-only plugins. The listener plugin discovers tools based on their shared tag value—in this case, mcp-tools—and serves them through an MCP server that AI clients can connect to.
echo '
_format_version: "3.0"
plugins:
  - name: ai-mcp-proxy
    route: listener-route
    config:
      mode: listener
      server:
        tag: mcp-tools
        timeout: 45000
      logging:
        log_statistics: true
        log_payloads: false
      max_request_body_size: 32768
' | deck gateway apply -
Validate the configuration
Run the MCP inspector
First, let’s run the MCP Inspector to see whether our listener AI MCP Proxy plugin properly aggregates all exposed tools.
- 
    Execute the following command to run the MCP Inspector: npx @modelcontextprotocol/inspector --mcp-url http://localhost:8000/mcp-listenerCopied!
- 
    If successful, you should see the following output in your terminal: Starting MCP inspector... ⚙️ Proxy server listening on localhost:6277 🔑 Session token: <YOUR_TOKEN> Use this token to authenticate requests or set DANGEROUSLY_OMIT_AUTH=true to disable auth 🚀 MCP Inspector is up and running at: http://localhost:6274/?MCP_PROXY_AUTH_TOKEN=<YOUR_TOKEN>
- 
    The script will automatically open a new browser window with MCP Inspector’s UI:  
- 
    Click the Connect button on the left. 
Make sure that you use Streamable HTTP as Transport Type and that the URL points at
http://localhost:8000/mcp-listener
- 
    In the Tools tile, click the List tools button. You should see the following tools available:  
Configure Cursor
- 
    Open your Cursor desktop app. 
- 
    Navigate to Settings in the top right corner. 
- 
    In the Cursor Settings tab, go to Tools & MCP in the left sidebar. 
- 
    In the Installed MCP Servers section, click New MCP Server. 
- 
    Paste the following JSON configuration into the newly opened mcp.jsontab:{ "mcpServers": { "mcp-listener": { "url": "http://localhost:8000/mcp-listener" } } }Copied!
- 
    Return to the Cursor settings tab. You should now see the mcp-listenerMCP server with four tools available.
- 
    To open a new Cursor chat, click cmd + L if you’re on Mac, or ctrl + L if you’re on Windows. 
- 
    In the Cursor chat tab, click @ Add Context and select mcp.json.
Validate aggregated MCP tools configuration
You can now test each exposed tool using Cursor.