Real-world Model Context Protocol (MCP) demos for agentic AI development on Azure
This repository contains hands-on demos and examples that show how to build agentic AI applications using the Model Context Protocol (MCP) on Azure. MCP is an open standard that lets AI models securely connect to external data sources, tools, and services through a unified interface.
Whether you're building your first MCP server or wiring up a complex multi-agent pipeline, you'll find working examples here to get you started.
| Folder | Purpose |
|---|---|
src/ |
📦 Source code — MCP server/client implementations and sample apps |
docs/ |
📚 Documentation — architecture guides, concepts, and how-tos |
tests/ |
🧪 Tests — unit and integration tests for all examples |
Demonstrates how to wrap a plain static .NET method as an AI tool using AIFunctionFactory.Create and invoke it through an Azure AI Foundry chat-completion model with DefaultAzureCredential.
| Resource | Link |
|---|---|
| Source code | src/ADMcpExamples/MCP.DotNetMethod/ |
| Documentation | docs/dotnet-method.md |
| Tests | tests/MCP.DotNetMethod.Tests/ |
Required environment variables:
| Variable | Description |
|---|---|
Endpoint |
Azure OpenAI resource URI (e.g. https://my-resource.openai.azure.com/) |
DeploymentName |
Name of your chat-completion deployment (e.g. gpt-4o) |
Authentication uses DefaultAzureCredential — run az login or sign into Visual Studio before running locally.
An ASP.NET Core MCP server that exposes a tax calculation tool (get_tax_for_customer) over a stateless HTTP transport. Clients connect to /mcp to list and invoke tools.
| Resource | Link |
|---|---|
| Source code | src/ADMcpExamples/MCP.TaxServer/ |
| Documentation | docs/tax-server.md |
| Tests | tests/MCP.TaxServer.Tests/ |
No Azure credentials are required to run the server. No environment variables needed.
A console application that connects to a running MCP server, retrieves its tools, and passes them to an Azure AI Foundry chat-completion model. The model invokes the tax tool automatically based on the user's question.
| Resource | Link |
|---|---|
| Source code | src/ADMcpExamples/MCP.TaxClient/ |
| Documentation | docs/tax-client.md |
| Tests | tests/MCP.TaxClient.Tests/ |
Required environment variables:
| Variable | Description |
|---|---|
Endpoint |
Azure OpenAI resource URI (e.g. https://my-resource.openai.azure.com/) |
McpEndpoint |
URL of a running MCP server /mcp endpoint (e.g. http://localhost:5000/mcp) |
DeploymentName |
Name of your chat-completion deployment (e.g. gpt-4o) |
Authentication uses DefaultAzureCredential — run az login or sign into Visual Studio before running locally.
-
Clone the repository
git clone https://github.com/bovrhovn/azure-demos-mcp-examples.git cd azure-demos-mcp-examples -
Read the docs — start with the documentation folder for architecture overviews and prerequisites.
-
Browse examples — explore the source folder to find a demo that matches your scenario.
-
Run the tests — use the tests folder to verify your environment is configured correctly.
Contributions are welcome! Please:
- Fork the repository and create a feature branch.
- Add your example or fix under the appropriate folder (
src/,docs/, ortests/). - Open a pull request with a clear description of your change.
| Resource | Link |
|---|---|
| MCP on Windows — Microsoft Learn | learn.microsoft.com |
| Microsoft Learn MCP Server overview | learn.microsoft.com |
| Microsoft Learn MCP Server release notes | learn.microsoft.com |
| Get started with .NET AI and MCP | learn.microsoft.com |
| Official MCP Specification (2025-03-26) | modelcontextprotocol.io |
| Resource | Link |
|---|---|
| Microsoft MCP catalog (GitHub) | github.com/microsoft/mcp |
| MCP Python SDK | github.com/modelcontextprotocol/python-sdk |
| MCP TypeScript SDK | github.com/modelcontextprotocol/typescript-sdk |
| MCP C# SDK | github.com/modelcontextprotocol/csharp-sdk |
| Resource | Link |
|---|---|
| How we built the Microsoft Learn MCP Server | devblogs.microsoft.com |
| Kickstart Your AI Development with MCP (Microsoft Tech Community) | techcommunity.microsoft.com |
| Azure AI Foundry documentation | learn.microsoft.com |
| DefaultAzureCredential overview | learn.microsoft.com |
| AIFunctionFactory in Microsoft.Extensions.AI | learn.microsoft.com |