Azure API Management acts as the AI Gateway for MCP servers.
This sample implements the latest MCP Authorization specification. Then calls Microsoft Graph API in MCP tool.
This is a sequence diagram to understand the flow.
Run this azd command to provision the api management service, web app(with code) and all other required Azure resources
```shell
azd up
```
-
In a new terminal window, install and run MCP Inspector
npx @modelcontextprotocol/inspector
-
CTRL click to load the MCP Inspector web app from the URL displayed by the app (e.g. http://127.0.0.1:6274/#resources)
-
Set the transport type to
Streamable HTTP
-
Set the URL to your running API Management Streamable HTTP endpoint displayed after
azd up
and Connect -
List Tools.
-
Click the
ShowUserProfile
tool and Run Tool. The tool will return your user profile.
- Install latest VS Code Insider
- Open Command Palette and trigger
MCP: Add Server
command - Select
HTTP
as MCP server type - Set the URL to your running API Management Streamable HTTP endpoint displayed after
azd up
and Connect - Wait a while, VS Code Insider will ask you to login
- Open GitHub Copilot and ask "Who am I?" in agent mode. GitHub Copilot will return your user profile obtained from this MCP server.