AI Gateway
Labs to explore AI Models, MCP servers, and Agents with the AI Gateway powered by Azure API Management and Microsoft Foundry 🚀
What is AI Gateway?
AI Gateway is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to labs to explore ai models, mcp servers, and agents with the ai gateway powered by azure api management and microsoft foundry 🚀
Labs to explore AI Models, MCP servers, and Agents with the AI Gateway powered by Azure API Management and Microsoft Foundry 🚀
This server falls under the Cloud Services category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Labs to explore AI Models, MCP servers, and Agents with the
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx ai-gatewayConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use AI Gateway
AI Gateway is a collection of hands-on labs built on Azure API Management (APIM) and Microsoft Foundry that demonstrates enterprise patterns for managing AI models, MCP servers, and agents at scale. The labs cover token rate limiting, semantic caching, backend load balancing, OAuth-protected MCP tool calling, agent orchestration with AutoGen and OpenAI Agents SDK, and cost control via a FinOps framework. It is designed for developers and architects who want to learn how to deploy production-grade AI infrastructure on Azure with security, observability, and multi-model routing built in.
Prerequisites
- Active Azure subscription with Contributor and RBAC Administrator roles
- Azure CLI installed and authenticated to your subscription
- Python 3.12 or later installed
- VS Code with the Jupyter extension (or GitHub Codespaces for a zero-install environment)
Clone the repository
Download the AI Gateway labs repository to your local machine or open it directly in GitHub Codespaces for a pre-configured cloud environment.
git clone https://github.com/Azure-Samples/AI-Gateway.git
cd AI-GatewayInstall Python dependencies
Install the required Python packages for running the Jupyter notebooks and utility scripts.
pip install -r requirements.txtAuthenticate Azure CLI
Log in to your Azure account and set the target subscription before running any lab that provisions Azure resources.
az login
az account set --subscription "<your-subscription-id>"Open a lab notebook
Navigate to the labs directory and open a Jupyter notebook for the topic you want to explore. Each lab is self-contained and includes Bicep templates for provisioning the required Azure resources.
# Open VS Code and then open a notebook, e.g.:
code labs/token-rate-limiting/token-rate-limiting.ipynbRun the MCP server lab
The MCP server lab demonstrates OAuth-secured tool calling via Azure API Management. Follow the notebook cells to deploy the APIM policy, register an MCP server, and test tool invocations from an AI agent.
# Navigate to the MCP lab folder and open the notebook:
code labs/mcp-server/AI Gateway Examples
Client configuration
The AI Gateway project deploys MCP servers behind Azure API Management. Once the lab deploys your APIM instance, connect to the MCP endpoint it provisions.
{
"mcpServers": {
"ai-gateway": {
"command": "npx",
"args": ["ai-gateway"],
"env": {
"AZURE_APIM_ENDPOINT": "https://<your-apim-name>.azure-api.net",
"AZURE_API_KEY": "<your-apim-subscription-key>"
}
}
}
}Prompts to try
After deploying the gateway labs, explore AI management capabilities through your AI assistant.
- "List the available AI models registered in the gateway"
- "Check the current token usage and remaining quota for this subscription"
- "Route this request to the Azure OpenAI endpoint with the lowest latency"
- "Show me the semantic cache hit rate for the last hour"Troubleshooting AI Gateway
Bicep deployment fails with an authorization error
Ensure your Azure account has both Contributor and RBAC Administrator roles on the target subscription. Run 'az role assignment list --assignee $(az ad signed-in-user show --query id -o tsv)' to verify your current role assignments.
Jupyter notebooks cannot import Azure SDK modules
Run 'pip install -r requirements.txt' inside the activated Python environment that VS Code is using as the notebook kernel. Check the kernel selector in VS Code to confirm the right environment is selected.
MCP server lab returns 401 when calling a tool
The MCP lab uses OAuth credential management through APIM. Ensure the OAuth app registration is complete and that the subscription key in your request header matches the one generated by the APIM deployment notebook cell.
Frequently Asked Questions about AI Gateway
What is AI Gateway?
AI Gateway is a Model Context Protocol (MCP) server that labs to explore ai models, mcp servers, and agents with the ai gateway powered by azure api management and microsoft foundry 🚀 It connects AI assistants to external tools and data sources through a standardized interface.
How do I install AI Gateway?
Follow the installation instructions on the AI Gateway GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with AI Gateway?
AI Gateway works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is AI Gateway free to use?
Yes, AI Gateway is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
AI Gateway Alternatives — Similar Cloud Services Servers
Looking for alternatives to AI Gateway? Here are other popular cloud services servers you can use with Claude, Cursor, and VS Code.
Open WebUI
★ 138.2kUser-friendly AI Interface (Supports Ollama, OpenAI API, ...)
Anything LLM
★ 60.4kThe all-in-one AI productivity accelerator. On device and privacy first with no annoying setup or configuration.
LocalAI
★ 46.4kLocalAI is the open-source AI engine. Run any model - LLMs, vision, voice, image, video - on any hardware. No GPU required.
Nacos
★ 33.0kan easy-to-use dynamic service discovery, configuration and service management platform for building AI cloud native applications.
Xiaozhi ESP32
★ 26.7k本项目为xiaozhi-esp32提供后端服务,帮助您快速搭建ESP32设备控制服务器。Backend service for xiaozhi-esp32, helps you quickly build an ESP32 device control server.
Gateway
★ 11.8kA blazing fast AI Gateway with integrated guardrails. Route to 1,600+ LLMs, 50+ AI Guardrails with 1 fast & friendly API.
Browse More Cloud Services MCP Servers
Explore all cloud services servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up AI Gateway in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use AI Gateway?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.