AI MCP Proxy

AI License Required

Configure per-tool access control for passthrough-listener mode MCP servers

Configure consumer groups and key authentication to control access to individual MCP tools based on consumer roles. This configuration applies access control rules at the tool level without a default policy.

For this configuration to work properly, you need to create the following Kong Gateway entities:

services:
  - name: mcp-acl-service
    url: http://host.docker.internal:3001/mcp
routes:
  - name: mcp-acl-route
    paths:
      - "/mcp"
    service:
      name: mcp-acl-service

plugins:
  - name: key-auth
    route: mcp-acl-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

  - username: eason
    keyauth_credentials:
      - key: eason-key

Before using the AI MCP Proxy plugin, you’ll need an upstream HTTP API to expose. Use this mock API to test the plugin without relying on an external service. It simulates a small marketplace with sample users and orders exposed:

  git clone https://github.com/tomek-labuk/marketplace-acl.git && \
  cd marketplace-acl && \
  npm install && \
  npm run build && \
  node dist/server.js

The tools[n].name fields must match the exact tools name from the upstream MCP server. If the names don’t match, the ACL will fail to apply.

Check this how-to for a detailed walkthrough guide.

Prerequisites

  • A running and exposed API

Set up the plugin

Something wrong?

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!