By the end of this module, you will be able to:
In Module 1, we mastered AI Toolkit basics and created our first Python Agent.
Now we'll supercharge your agents by connecting them to external tools and services through the revolutionary Model Context Protocol (MCP).
Think of this as upgrading from a basic calculator to a full computer - your AI agents will gain the ability to:
Model Context Protocol (MCP) is the "USB-C for AI applications" - a revolutionary open standard that connects Large Language Models (LLMs) to external tools, data sources, and services.
Just as USB-C eliminated cable chaos by providing one universal connector, MCP eliminates AI integration complexity with one standardized protocol.
Before MCP:
With MCP:
MCP follows a client-server architecture that creates a secure, scalable ecosystem:
graph TB
A[AI Application/Agent] --> B[MCP Client]
B --> C[MCP Server 1: Files]
B --> D[MCP Server 2: Web APIs]
B --> E[MCP Server 3: Database]
B --> F[MCP Server N: Custom Tools]
C --> G[Local File System]
D --> H[External APIs]
E --> I[Database Systems]
F --> J[Enterprise Systems]
🔧 Core Components:
| Component | Role | Examples |
|-----------|------|----------|
| MCP Hosts | Applications that consume MCP services | Claude Desktop, VS Code, AI Toolkit |
| MCP Clients | Protocol handlers (1:1 with servers) | Built into host applications |
| MCP Servers | Expose capabilities via standard protocol | Playwright, Files, Azure, GitHub |
| Transport Layer | Communication methods | stdio, HTTP, WebSockets |
Microsoft leads the MCP ecosystem with a comprehensive suite of enterprise-grade servers that address real-world business needs.
🔗 Repository: azure/azure-mcp
🎯 Purpose: Comprehensive Azure resource management with AI integration
✨ Key Features:
🚀 Use Cases:
📚 Documentation: Microsoft Dataverse Integration
🎯 Purpose: Natural language interface for business data
✨ Key Features:
🚀 Use Cases:
🔗 Repository: microsoft/playwright-mcp
🎯 Purpose: Browser automation and web interaction capabilities
✨ Key Features:
🚀 Use Cases:
🔗 Repository: microsoft/files-mcp-server
🎯 Purpose: Intelligent file system operations
✨ Key Features:
🚀 Use Cases:
🔗 Repository: microsoft/markitdown
🎯 Purpose: Advanced Markdown processing and manipulation
✨ Key Features:
🚀 Use Cases:
📦 Package: @microsoft/clarity-mcp-server
🎯 Purpose: Web analytics and user behavior insights
✨ Key Features:
🚀 Use Cases:
Beyond Microsoft's servers, the MCP ecosystem includes:
🎯 Project Goal: Create an intelligent browser automation agent using Playwright MCP server that can navigate websites, extract information, and perform complex web interactions.
1. Open AI Toolkit Agent Builder
2. Create New Agent with the following configuration:
- Name: BrowserAgent
- Model: Choose GPT-4o
1. Navigate to Tools Section in Agent Builder
2. Click "Add Tool" to open the integration menu
3. Select "MCP Server" from available options
🔍 Understanding Tool Types:
1. Choose "MCP Server" option to proceed
2. Browse MCP Catalog to explore available integrations
1. Click "Use Featured MCP Servers" to access Microsoft's verified servers
2. Select "Playwright" from the featured list
3. Accept Default MCP ID or customize for your environment
🔑 Critical Step: Select ALL available Playwright methods for maximum functionality
🛠️ Essential Playwright Tools:
goto, goBack, goForward, reloadclick, fill, press, hover, dragtextContent, innerHTML, getAttributeisVisible, isEnabled, waitForSelectorscreenshot, pdf, videosetExtraHTTPHeaders, route, waitForResponse✅ Success Indicators:
🔧 Troubleshooting Common Issues:
Create sophisticated prompts that leverage Playwright's full capabilities:
# Web Automation Expert System Prompt
## Core Identity
You are an advanced web automation specialist with deep expertise in browser automation, web scraping, and user experience analysis. You have access to Playwright tools for comprehensive browser control.
## Capabilities & Approach
### Navigation Strategy
- Always start with screenshots to understand page layout
- Use semantic selectors (text content, labels) when possible
- Implement wait strategies for dynamic content
- Handle single-page applications (SPAs) effectively
### Error Handling
- Retry failed operations with exponential backoff
- Provide clear error descriptions and solutions
- Suggest alternative approaches when primary methods fail
- Always capture diagnostic screenshots on errors
### Data Extraction
- Extract structured data in JSON format when possible
- Provide confidence scores for extracted information
- Validate data completeness and accuracy
- Handle pagination and infinite scroll scenarios
### Reporting
- Include step-by-step execution logs
- Provide before/after screenshots for verification
- Suggest optimizations and alternative approaches
- Document any limitations or edge cases encountered
## Ethical Guidelines
- Respect robots.txt and rate limiting
- Avoid overloading target servers
- Only extract publicly available information
- Follow website terms of service
Design prompts that demonstrate various capabilities:
🌐 Web Analysis Example:
Navigate to github.com/kinfey and provide a comprehensive analysis including:
1. Repository structure and organization
2. Recent activity and contribution patterns
3. Documentation quality assessment
4. Technology stack identification
5. Community engagement metrics
6. Notable projects and their purposes
Include screenshots at key steps and provide actionable insights.
1. Click "Run" to launch the automation sequence
2. Monitor Real-time Execution:
- Chrome browser launches automatically
- Agent navigates to target website
- Screenshots capture each major step
- Analysis results stream in real-time
Review comprehensive analysis in Agent Builder's interface:
Agent Builder supports multiple deployment options:
✅ Skills Mastered:
🎉 Congratulations! You've successfully mastered MCP integration and can now build production-ready AI agents with external tool capabilities!
Ready to take your MCP skills to the next level? Proceed to Module 3: Advanced MCP Development with AI Toolkit where you'll learn how to:
이 모듈을 마치면 다음을 할 수 있습니다:
모듈 1에서는 AI Toolkit 기본기를 익히고 첫 Python 에이전트를 만들었습니다. 이제 혁신적인 Model Context Protocol (MCP)을 통해 외부 도구와 서비스에 연결하여 에이전트를 강력하게 업그레이드할 차례입니다.
기본 계산기에서 완전한 컴퓨터로 업그레이드하는 것과 같다고 생각하세요 — AI 에이전트가 다음과 같은 능력을 갖추게 됩니다:
Model Context Protocol (MCP)은 AI 애플리케이션을 위한 "USB-C"와 같은 혁신적인 오픈 표준입니다. 대형 언어 모델(LLM)을 외부 도구, 데이터 소스, 서비스와 연결해 줍니다. USB-C가 복잡한 케이블 문제를 하나의 표준 커넥터로 해결했듯, MCP는 AI 통합의 복잡함을 하나의 표준 프로토콜로 간소화합니다.
MCP 이전:
MCP 도입 후:
MCP는 클라이언트-서버 아키텍처를 따르며, 안전하고 확장 가능한 생태계를 만듭니다:
graph TB
A[AI Application/Agent] --> B[MCP Client]
B --> C[MCP Server 1: Files]
B --> D[MCP Server 2: Web APIs]
B --> E[MCP Server 3: Database]
B --> F[MCP Server N: Custom Tools]
C --> G[Local File System]
D --> H[External APIs]
E --> I[Database Systems]
F --> J[Enterprise Systems]
🔧 핵심 구성 요소:
| 구성 요소 | 역할 | 예시 |
|-----------|------|----------|
| MCP Hosts | MCP 서비스를 사용하는 애플리케이션 | Claude Desktop, VS Code, AI Toolkit |
| MCP Clients | 프로토콜 핸들러 (서버와 1:1 매칭) | 호스트 애플리케이션 내장 |
| MCP Servers | 표준 프로토콜로 기능 제공 | Playwright, Files, Azure, GitHub |
| 전송 계층 | 통신 방식 | stdio, HTTP, WebSockets |
Microsoft는 실제 비즈니스 요구를 충족하는 엔터프라이즈급 서버 제품군으로 MCP 생태계를 선도하고 있습니다.
🔗 저장소: azure/azure-mcp
🎯 목적: AI 통합을 통한 종합 Azure 리소스 관리
✨ 주요 기능:
🚀 활용 사례:
📚 문서: Microsoft Dataverse Integration
🎯 목적: 비즈니스 데이터를 위한 자연어 인터페이스
✨ 주요 기능:
🚀 활용 사례:
🔗 저장소: microsoft/playwright-mcp
🎯 목적: 브라우저 자동화 및 웹 상호작용 기능 제공
✨ 주요 기능:
🚀 활용 사례:
🔗 저장소: microsoft/files-mcp-server
🎯 목적: 지능형 파일 시스템 작업
✨ 주요 기능:
🚀 활용 사례:
🔗 저장소: microsoft/markitdown
🎯 목적: 고급 Markdown 처리 및 조작
✨ 주요 기능:
🚀 활용 사례:
📦 패키지: @microsoft/clarity-mcp-server
🎯 목적: 웹 분석 및 사용자 행동 인사이트 제공
✨ 주요 기능:
🚀 활용 사례:
Microsoft 서버 외에도 MCP 생태계에는 다음이 포함됩니다:
🎯 프로젝트 목표: Playwright MCP 서버를 사용해 웹사이트를 탐색하고 정보를 추출하며 복잡한 웹 상호작용을 수행하는 지능형 브라우저 자동화 에이전트를 만듭니다.
1. AI Toolkit Agent Builder 열기
2. 새 에이전트 생성 및 다음 설정 적용:
- 이름: BrowserAgent
- 모델: GPT-4o 선택
1. Agent Builder에서 도구 섹션으로 이동
2. "도구 추가" 클릭하여 통합 메뉴 열기
3. "MCP 서버" 선택
🔍 도구 유형 이해하기:
1. "MCP 서버" 옵션 선택하여 진행
2. MCP 카탈로그 탐색하여 사용 가능한 통합 확인
1. "추천 MCP 서버 사용" 클릭하여 Microsoft 검증 서버 접근
2. 추천 목록에서 "Playwright" 선택
3. 기본 MCP ID 수락 또는 환경에 맞게 수정
🔑 중요 단계: 최대 기능을 위해 Playwright의 모든 메서드 선택
🛠️ 필수 Playwright 도구:
goto, goBack, goForward, reloadclick, fill, press, hover, dragtextContent, innerHTML, getAttributeisVisible, isEnabled, waitForSelectorscreenshot, pdf, videosetExtraHTTPHeaders, route, waitForResponse✅ 성공 지표:
🔧 일반 문제 해결:
Playwright의 모든 기능을 활용하는 정교한 프롬프트 작성:
# Web Automation Expert System Prompt
## Core Identity
You are an advanced web automation specialist with deep expertise in browser automation, web scraping, and user experience analysis. You have access to Playwright tools for comprehensive browser control.
## Capabilities & Approach
### Navigation Strategy
- Always start with screenshots to understand page layout
- Use semantic selectors (text content, labels) when possible
- Implement wait strategies for dynamic content
- Handle single-page applications (SPAs) effectively
### Error Handling
- Retry failed operations with exponential backoff
- Provide clear error descriptions and solutions
- Suggest alternative approaches when primary methods fail
- Always capture diagnostic screenshots on errors
### Data Extraction
- Extract structured data in JSON format when possible
- Provide confidence scores for extracted information
- Validate data completeness and accuracy
- Handle pagination and infinite scroll scenarios
### Reporting
- Include step-by-step execution logs
- Provide before/after screenshots for verification
- Suggest optimizations and alternative approaches
- Document any limitations or edge cases encountered
## Ethical Guidelines
- Respect robots.txt and rate limiting
- Avoid overloading target servers
- Only extract publicly available information
- Follow website terms of service
다양한 기능을 보여주는 프롬프트 설계:
🌐 웹 분석 예시:
Navigate to github.com/kinfey and provide a comprehensive analysis including:
1. Repository structure and organization
2. Recent activity and contribution patterns
3. Documentation quality assessment
4. Technology stack identification
5. Community engagement metrics
6. Notable projects and their purposes
Include screenshots at key steps and provide actionable insights.
1. "실행" 클릭하여 자동화 시퀀스 시작
2. 실시간 실행 모니터링:
- Chrome 브라우저 자동 실행
- 에이전트가 대상 웹사이트 탐색
- 주요 단계마다 스크린샷 캡처
- 분석 결과 실시간 스트리밍
Agent Builder 인터페이스에서 종합 분석 검토:
Agent Builder는 다양한 배포 옵션을 지원합니다:
✅ 습득한 기술:
🎉 축하합니다! MCP 통합을 성공적으로 마스터하여 외부 도구 기능을 갖춘 프로덕션 준비 AI 에이전트를 만들 수 있게 되었습니다!
MCP 기술을 한 단계 더 발전시키고 싶다면, 모듈 3: AI Toolkit과 함께하는 고급 MCP 개발으로 이동하세요. 여기서 다음을 배우게 됩니다:
면책 조항:
이 문서는 AI 번역 서비스 Co-op Translator를 사용하여 번역되었습니다.
정확성을 위해 최선을 다하고 있으나, 자동 번역에는 오류나 부정확한 부분이 있을 수 있음을 유의해 주시기 바랍니다.
원문은 해당 언어의 원본 문서가 권위 있는 출처로 간주되어야 합니다.
중요한 정보의 경우 전문적인 인간 번역을 권장합니다.
본 번역의 사용으로 인해 발생하는 오해나 잘못된 해석에 대해 당사는 책임을 지지 않습니다.