AI Gateway

v1.0.0Cloud Servicesstable

Labs to explore AI Models, MCP servers, and Agents with the AI Gateway powered by Azure API Management and Microsoft Foundry 🚀

a2aagentsapimanagementautogenazure
Share:
926
Stars
0
Downloads
0
Weekly
0/5

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

Azure-powered AI model and agent exploration
API management with MCP integration
Azure-Samples

Maintainer

LicenseMIT
Languagejupyter notebook
Versionv1.0.0
UpdatedMay 22, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx ai-gateway

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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)
1

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-Gateway
2

Install Python dependencies

Install the required Python packages for running the Jupyter notebooks and utility scripts.

pip install -r requirements.txt
3

Authenticate 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>"
4

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.ipynb
5

Run 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.

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.

Quick Config Preview

{ "mcpServers": { "ai-gateway": { "command": "npx", "args": ["-y", "ai-gateway"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides