.NET
Backend-Development

Building AI Agents with Microsoft Agent Framework and Model Context Protocol using .NET

A hands-on, comprehensive workshop for .NET developers to build production-ready AI agents using Microsoft Agent Framework and the Model Context Protocol (MCP). This two-day intensive combines Microsoft's enterprise-grade agentic AI framework with the open standard for AI-context integration. You'll learn to create intelligent agents that orchestrate multiple services, integrate with business systems, and provide seamless user experiences—all while leveraging familiar .NET patterns and Microsoft.Extensions.AI abstractions.

  1. Introduction to Agentic AI with .NET

    • What are AI agents vs. traditional applications
    • Microsoft Agent Framework overview and architecture
    • Evolution: Semantic Kernel + AutoGen = Agent Framework
    • Microsoft.Extensions.AI abstractions (IChatClient, IEmbeddingGenerator)
    • Key capabilities: multi-agent orchestration, cloud/provider flexibility, enterprise features
    • Standards-based interoperability: Agent-to-Agent (A2A) protocol and MCP
  2. Building Your First Agent

    • Setting up the development environment
    • Creating a ChatClientAgent from an IChatClient
    • Understanding agent configuration: instructions, model parameters, tools
    • Running agents: Run() vs. RunStreamingAsync()
    • Working with chat history and conversation context
    • Structured output and response formats
  3. Function Calling and Tools

    • Understanding function calling in AI agents
    • Creating AIFunction instances with AIFunctionFactory.Create()
    • Tool execution lifecycle and error handling
    • Approval modes and human-in-the-loop for sensitive operations
    • Best practices for tool design and security
  4. Multi-Provider Integration

    • Working with Azure OpenAI Service
    • Integrating OpenAI directly
    • Using local models with Ollama
    • Azure AI Foundry integration
    • Provider-agnostic design patterns
    • Switching and comparing providers
  5. Agent Orchestration Patterns

    • Single agent vs. multi-agent systems
    • Sequential orchestration: step-by-step agent chains
    • Concurrent orchestration: parallel agent execution
    • Handoff orchestration: specialized agent collaboration
    • Magentic orchestration: lead agent directing other agents
    • Group chat patterns for collaborative agents
  6. Introduction to Model Context Protocol (MCP)

    • What is MCP and why it matters
    • MCP architecture: servers, clients, and transports
    • Core MCP concepts: resources, tools, prompts, and sampling
    • MCP C# SDK overview (ModelContextProtocol.* packages)
    • MCP ecosystem and the registry
    • Standards-based context integration benefits
  7. Deep Dive: Model Context Protocol Implementation

    • Building MCP servers with the C# SDK
    • Implementing resources: exposing data sources to agents
    • Implementing tools: server-side functions for agents
    • Implementing prompts: reusable prompt templates
    • Server transports: stdio, HTTP/SSE
    • Building MCP clients to consume external context
    • Using McpClient to discover and invoke tools from servers
    • Integrating MCP tools (McpClientTool) into Agent Framework agents
  8. Building Custom MCP Tools and Resources

    • Design patterns for MCP server architecture
    • Exposing enterprise data sources as MCP resources
    • Creating domain-specific tools with proper descriptions and schemas
    • Handling authentication and authorization in MCP servers
    • Sampling: allowing MCP servers to query LLMs via the client
    • Best practices for MCP server development and testing
  9. Workflows and Advanced Orchestration

    • Understanding Agent Framework Workflows
    • Workflows vs. Agents: when to use each
    • Executors and edges: building the workflow graph
    • Conditional routing and dynamic execution paths
    • External integration patterns: request/response, webhooks
    • Checkpointing: save and resume long-running workflows
    • Human-in-the-loop patterns in workflows
  10. Agent Identity, Security, and Governance

    • Microsoft Entra Agent ID overview (agent identity platform)
    • Agent identity blueprints and agent identities
    • Authentication and authorization for AI agents
    • OAuth 2.0 and OIDC for agents
    • Agent registry and discovery
    • Responsible AI features: prompt injection protection, task adherence
    • Security best practices for production agents
  11. User Interfaces and Integration

    • AG-UI protocol overview
    • Integrating agents with CopilotKit
    • ASP.NET Core integration: MapAGUI endpoint
    • Server-Sent Events (SSE) for streaming responses
    • Frontend tool calling and shared state
    • Handling approvals and confirmations in the UI
    • Building chat interfaces with AG-UI Dojo samples
  12. Observability, Monitoring, and Deployment

    • OpenTelemetry integration for agent observability
    • Tracing agent execution and tool invocations
    • Metrics and logging best practices
    • Debugging and troubleshooting agents
    • Containerizing agents for deployment
    • Deployment patterns: Azure Container Apps, Kubernetes, on-premises
    • Scaling strategies and performance optimization
    • CI/CD pipelines for agent applications
Prerequisites
  • Solid C# and .NET experience
  • Familiarity with ASP.NET Core, dependency injection, and async programming
  • Basic understanding of AI/LLMs and REST APIs
  • Access to Azure subscription (for Azure OpenAI) or OpenAI API key
  • Docker basics helpful for deployment exercises
An unhandled error has occurred. Reload 🗙