AI Gateway Integration
Once your AI Gateway is installed and connected to MCP Gateway, you will begin to see real-time traffic from your MCP servers in the AI Gateway Control Plane.
As MCP Gateway routes requests to your backend tools, the UI will automatically displays:
- Discovered API endpoints
- Request performance (latency, error rate, throughput)
- Live traffic logs by endpoint and by server
- Gateway routing rules and quota usage
Connection options
You can run MCP Gateway alongside either a hosted AI Gateway or an on-premises deployment.
To enable this, your container must be granted elevated privileges using the flag
--cap-add=NET_ADMIN. This grants only your container ability to configure networking, for example, to add firewall rules using iptables.
Hosted gateway
If you are using the Hosted AI Gateway set your API key via the LUNAR_API_KEY environment variable:
docker run --rm --cap-add=NET_ADMIN -v ./:/lunar/packages/mcpx-server/config -p 9000:9000 -p 5173:5173 -p 9001:9001 -p 3000:3000 -e LUNAR_API_KEY="YOUR_LUNAR_API_KEY" --name mcpx us-central1-docker.pkg.dev/prj-common-442813/mcpx/mcpx:latest
Make sure to replace
YOUR_LUNAR_API_KEYwith your actual API key found in the AI Gateway Control Plane.
Self-Hosted
If you're running the AI Gateway on your own infrastructure, point MCP Gateway to it using the LUNAR_URL environment variable:
docker run --rm --cap-add=NET_ADMIN -v ./:/lunar/packages/mcpx-server/config -p 9000:9000 -p 5173:5173 -p 9001:9001 -p 3000:3000 -e LUNAR_URL="http://localhost:8000" --name mcpx us-central1-docker.pkg.dev/prj-common-442813/mcpx/mcpx:latest
The
LUNAR_URLmust match the hostname and port used to install the AI Gateway Container.