Use the AI MCP Proxy plugin to control access to MCP tools with global and
per-tool ACLs based on Consumers and Consumer Groups. Use Insomnia’s MCP
Client feature to test and validate which tools each user can access.
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.
decK is a CLI tool for managing Kong Gateway declaratively with state files.
To complete this tutorial, install decKversion 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.
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:
Before using the AI MCP Proxy plugin, you need an upstream MCP-compatible HTTP server to expose. For this tutorial, we’ll use a simple Express-based MCP server that simulates a marketplace system. It provides read-only access to sample users and their orders.
The server exposes a single /mcp endpoint and registers tools instead of REST routes, including:
list_users
get_user
list_orders
list_orders_for_user
search_orders
These tools operate on in-memory marketplace data, allowing you to test MCP behavior without connecting to a real backend.
Run the following command to clone the repository, install dependencies, build the server, and start it:
Let’s configure authentication so the Kong Gateway can identify each caller. We’ll use the Key Auth plugin so each user (or AI agent) presents an API key with requests:
Let’s configure individual Consumers and assign them to groups. Each Consumer will use a unique API key and inherits group permissions which will govern access to MCP tools:
Now, let’s configure the AI MCP Proxy plugin to apply tool-level access rules. The plugin controls which users or AI agents can see or call each MCP tool. Access is determined by Consumer Groups and individual Consumers using allow and deny lists. A tool ACL replaces the default rule when present.
The table below shows the effective permissions for the configuration:
MCP Tool
Admin group
Developer group
Eason consumer
Suspended group
list_users
Supported
Not supported
Supported
Not supported
get_user
Supported
Supported
Not supported
Not supported
list_orders
Supported
Supported
Not supported
Not supported
list_orders_for_user
Supported
Supported
Not supported
Not supported
search_orders
Supported
Not supported
Not supported
Not supported
The following plugin configuration applies the ACL rules for the MCP tools shown in the table above:
Prior to AI Gateway 3.14, requests that matched an MCP ACL deny rule or failed to match an allow list returned the JSON-RPC error code INVALID_PARAMS -32602.
This has now changed to match the MCP 2025-11-25 authorization specification and returns HTTP 403 Forbidden.