# Streamlining AI Workflows: Building an MCP Server with Microsoft Foundry Toolkit [![MCP Spec](https://img.shields.io/badge/MCP%20Spec-2025--11--25-blue.svg)](https://spec.modelcontextprotocol.io/specification/2025-11-25/) [![Python](https://img.shields.io/badge/Python-3.10+-green.svg)](https://python.org) [![VS Code](https://img.shields.io/badge/VS%20Code-Latest-orange.svg)](https://code.visualstudio.com/) ![logo](../../../translated_images/en/logo.ec93918ec338dadd.webp) ## ๐ŸŽฏ Overview [![Build AI Agents in VS Code: 4 Hands-On Labs with MCP and Microsoft Foundry Toolkit](../../../translated_images/en/11.0f6db6a0fb606885.webp)](https://youtu.be/r34Csn3rkeQ) _(Click the image above to view video of this lesson)_ Welcome to the **Model Context Protocol (MCP) Workshop**! This comprehensive hands-on workshop combines two cutting-edge technologies to revolutionize AI application development: - **๐Ÿ”— Model Context Protocol (MCP)**: An open standard for seamless AI-tool integration - **๐Ÿ› ๏ธ Microsoft Foundry Toolkit Extension for VS Code**: Microsoft's powerful AI development extension ### ๐ŸŽ“ What You'll Learn By the end of this workshop, you'll master the art of building intelligent applications that bridge AI models with real-world tools and services. From automated testing to custom API integrations, you'll gain practical skills to solve complex business challenges. ## ๐Ÿ—๏ธ Technology Stack ### ๐Ÿ”Œ Model Context Protocol (MCP) MCP is the **"USB-C for AI"** - a universal standard that connects AI models to external tools and data sources. **โœจ Key Features:** - ๐Ÿ”„ **Standardized Integration**: Universal interface for AI-tool connections - ๐Ÿ›๏ธ **Flexible Architecture**: Local & remote servers via stdio/SSE transport - ๐Ÿงฐ **Rich Ecosystem**: Tools, prompts, and resources in one protocol - ๐Ÿ”’ **Enterprise-Ready**: Built-in security and reliability **๐ŸŽฏ Why MCP Matters:** Just like USB-C eliminated cable chaos, MCP eliminates the complexity of AI integrations. One protocol, infinite possibilities. ### ๐Ÿค– Microsoft Foundry Toolkit Extension for VS Code Microsoft's flagship AI development extension that transforms VS Code into an AI powerhouse. **๐Ÿš€ Core Capabilities:** - ๐Ÿ“ฆ **Model Catalog**: Access models from Azure AI, GitHub, Hugging Face, Ollama - โšก **Local Inference**: ONNX-optimized CPU/GPU/NPU execution - ๐Ÿ—๏ธ **Agent Builder**: Visual AI agent development with MCP integration - ๐ŸŽญ **Multi-Modal**: Text, vision, and structured output support **๐Ÿ’ก Development Benefits:** - Zero-config model deployment - Visual prompt engineering - Real-time testing playground - Seamless MCP server integration ## ๐Ÿ“š Learning Journey ### [๐Ÿš€ Module 1: Microsoft Foundry Toolkit Fundamentals](./lab1/README.md) **Duration**: 15 minutes - ๐Ÿ› ๏ธ Install and configure Microsoft Foundry Toolkit for VS Code - ๐Ÿ—‚๏ธ Explore the Model Catalog (100+ models from GitHub, ONNX, OpenAI, Anthropic, Google) - ๐ŸŽฎ Master the Interactive Playground for real-time model testing - ๐Ÿค– Build your first AI agent with Agent Builder - ๐Ÿ“Š Evaluate model performance with built-in metrics (F1, relevance, similarity, coherence) - โšก Learn batch processing and multi-modal support capabilities **๐ŸŽฏ Learning Outcome**: Create a functional AI agent with comprehensive understanding of Microsoft Foundry Toolkit capabilities ### [๐ŸŒ Module 2: MCP with Microsoft Foundry Toolkit Fundamentals](./lab2/README.md) **Duration**: 20 minutes - ๐Ÿง  Master Model Context Protocol (MCP) architecture and concepts - ๐ŸŒ Explore Microsoft's MCP server ecosystem - ๐Ÿค– Build a browser automation agent using Playwright MCP server - ๐Ÿ”ง Integrate MCP servers with Microsoft Foundry Toolkit Agent Builder - ๐Ÿ“Š Configure and test MCP tools within your agents - ๐Ÿš€ Export and deploy MCP-powered agents for production use **๐ŸŽฏ Learning Outcome**: Deploy an AI agent supercharged with external tools through MCP ### [๐Ÿ”ง Module 3: Advanced MCP Development with Microsoft Foundry Toolkit](./lab3/README.md) **Duration**: 20 minutes - ๐Ÿ’ป Create custom MCP servers using Microsoft Foundry Toolkit - ๐Ÿ Configure and use the latest MCP Python SDK (v1.9.3) - ๐Ÿ” Set up and utilize MCP Inspector for debugging - ๐Ÿ› ๏ธ Build a Weather MCP Server with professional debugging workflows - ๐Ÿงช Debug MCP servers in both Agent Builder and Inspector environments **๐ŸŽฏ Learning Outcome**: Develop and debug custom MCP servers with modern tooling ### [๐Ÿ™ Module 4: Practical MCP Development - Custom GitHub Clone Server](./lab4/README.md) **Duration**: 30 minutes - ๐Ÿ—๏ธ Build a real-world GitHub Clone MCP Server for development workflows - ๐Ÿ”„ Implement smart repository cloning with validation and error handling - ๐Ÿ“ Create intelligent directory management and VS Code integration - ๐Ÿค– Use GitHub Copilot Agent Mode with custom MCP tools - ๐Ÿ›ก๏ธ Apply production-ready reliability and cross-platform compatibility **๐ŸŽฏ Learning Outcome**: Deploy a production-ready MCP server that streamlines real development workflows ## ๐Ÿ’ก Real-World Applications & Impact ### ๐Ÿข Enterprise Use Cases #### ๐Ÿ”„ DevOps Automation Transform your development workflow with intelligent automation: - **Smart Repository Management**: AI-driven code review and merge decisions - **Intelligent CI/CD**: Automated pipeline optimization based on code changes - **Issue Triage**: Automatic bug classification and assignment #### ๐Ÿงช Quality Assurance Revolution Elevate testing with AI-powered automation: - **Intelligent Test Generation**: Create comprehensive test suites automatically - **Visual Regression Testing**: AI-powered UI change detection - **Performance Monitoring**: Proactive issue identification and resolution #### ๐Ÿ“Š Data Pipeline Intelligence Build smarter data processing workflows: - **Adaptive ETL Processes**: Self-optimizing data transformations - **Anomaly Detection**: Real-time data quality monitoring - **Intelligent Routing**: Smart data flow management #### ๐ŸŽง Customer Experience Enhancement Create exceptional customer interactions: - **Context-Aware Support**: AI agents with access to customer history - **Proactive Issue Resolution**: Predictive customer service - **Multi-Channel Integration**: Unified AI experience across platforms ## ๐Ÿ› ๏ธ Prerequisites & Setup ### ๐Ÿ’ป System Requirements | Component | Requirement | Notes | |-----------|-------------|-------| | **Operating System** | Windows 10+, macOS 10.15+, Linux | Any modern OS | | **Visual Studio Code** | Latest stable version | Required for Microsoft Foundry Toolkit | | **Node.js** | v18.0+ and npm | For MCP server development | | **Python** | 3.10+ | Optional for Python MCP servers | | **Memory** | 8GB RAM minimum | 16GB recommended for local models | ### ๐Ÿ”ง Development Environment #### Recommended VS Code Extensions - **Microsoft Foundry Toolkit** (ms-windows-ai-studio.windows-ai-studio) - **Python** (ms-python.python) - **Python Debugger** (ms-python.debugpy) - **GitHub Copilot** (GitHub.copilot) - Optional but helpful #### Optional Tools - **uv**: Modern Python package manager - **MCP Inspector**: Visual debugging tool for MCP servers - **Playwright**: For web automation examples ## ๐ŸŽ–๏ธ Learning Outcomes & Certification Path ### ๐Ÿ† Skill Mastery Checklist By completing this workshop, you will achieve mastery in: #### ๐ŸŽฏ Core Competencies - [ ] **MCP Protocol Mastery**: Deep understanding of architecture and implementation patterns - [ ] **Microsoft Foundry Toolkit Proficiency**: Expert-level usage of Microsoft Foundry Toolkit for rapid development - [ ] **Custom Server Development**: Build, deploy, and maintain production MCP servers - [ ] **Tool Integration Excellence**: Seamlessly connect AI with existing development workflows - [ ] **Problem-Solving Application**: Apply learned skills to real business challenges #### ๐Ÿ”ง Technical Skills - [ ] Set up and configure Microsoft Foundry Toolkit in VS Code - [ ] Design and implement custom MCP servers - [ ] Integrate GitHub Models with MCP architecture - [ ] Build automated testing workflows with Playwright - [ ] Deploy AI agents for production use - [ ] Debug and optimize MCP server performance #### ๐Ÿš€ Advanced Capabilities - [ ] Architect enterprise-scale AI integrations - [ ] Implement security best practices for AI applications - [ ] Design scalable MCP server architectures - [ ] Create custom tool chains for specific domains - [ ] Mentor others in AI-native development ## ๐Ÿ“– Additional Resources - [MCP Specification (2025-11-25)](https://spec.modelcontextprotocol.io/specification/2025-11-25/) - [Microsoft Foundry Toolkit GitHub Repository](https://github.com/microsoft/vscode-ai-toolkit) - [Sample MCP Servers Collection](https://github.com/modelcontextprotocol/servers) - [Best Practices Guide](https://modelcontextprotocol.io/docs/best-practices) - [OWASP MCP Top 10](https://microsoft.github.io/mcp-azure-security-guide/mcp/) - Security best practices --- **๐Ÿš€ Ready to revolutionize your AI development workflow?** Let's build the future of intelligent applications together with MCP and Microsoft Foundry Toolkit! ## What's Next Continue to: [Module 11: MCP Server Hands-On Labs](../11-MCPServerHandsOnLabs/README.md) --- **Disclaimer**: This document has been translated using AI translation service [Co-op Translator](https://github.com/Azure/co-op-translator). While we strive for accuracy, please be aware that automated translations may contain errors or inaccuracies. The original document in its native language should be considered the authoritative source. For critical information, professional human translation is recommended. We are not liable for any misunderstandings or misinterpretations arising from the use of this translation.