使用说明
MCP实战大师:从协议理解到运营
使用MCP(Model Context Protocol)进行在线实战培训
学员必读!starter-kit使用方法
学员在右上角 use this template > Create a new repository选择,在各自的帐户下创建repo。
以后 starter-kit/ 在目录中进行操作即可。
在每一集的讲课笔记中 # TODO 通过查找注释并填充代码的方式进行练习。完成本 project/ 可以在目录中查看。
前提条件
- Python 3.11+
- uv(包管理器)
- Claude Desktop或MCP兼容客户端
- Git,VS Code(建议)
快速入门
1.安装uv
macOS/Linux:
curl -LsSf https://astral.sh/uv/install.sh | sh
Windows(PowerShell):
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
2.项目设置
macOS/Linux:
cd project
uv sync
cp .env.example .env
Windows(PowerShell):
cd project
uv sync
copy .env.example .env
3.运行服务器
macOS/Linux:
uv run python src/server.py --transport stdio
Windows(PowerShell):
uv run python src\server.py --transport stdio
4.测试
uv run pytest
项目结构
mcp-course/
├── README.md # 이 파일
├── curriculum.md # 전체 커리큘럼 (27편)
├── lectures/ # 에피소드별 강의 노트
│ ├── chapter-1/ # Chapter 1: MCP 기초
│ │ ├── ep01-what-is-mcp.md
│ │ ├── ep02-architecture.md
│ │ └── ep03-first-server.md
│ └── chapter-2/ # Chapter 2: Tools 심화
│ ├── ep04-tool-basics.md
│ ├── ep05-inventory-tool.md
│ ├── ep06-error-handling.md
│ ├── ep07-policy-tool.md
│ ├── ep08-ticket-tool.md
│ └── ep09-validation.md
├── slides/ # 에피소드별 슬라이드 (Marp)
│ ├── chapter-1/
│ │ ├── ep01-slides.md
│ │ ├── ep02-slides.md
│ │ └── ep03-slides.md
│ └── chapter-2/
│ ├── ep04-slides.md
│ ├── ep05-slides.md
│ ├── ep06-slides.md
│ ├── ep07-slides.md
│ ├── ep08-slides.md
│ └── ep09-slides.md
├── project/ # 프로젝트 완성본
│ ├── pyproject.toml
│ ├── .env.example
│ ├── src/
│ │ ├── server.py # MCP 서버 엔트리포인트
│ │ ├── models.py # AppContext, 데이터 모델
│ │ ├── tools/
│ │ │ ├── inventory.py # lookup_inventory
│ │ │ ├── policy.py # search_policy
│ │ │ └── ticket.py # create_ticket
│ │ ├── resources/
│ │ │ ├── policy_index.py # 정책 인덱스 Resource
│ │ │ └── policy_detail.py # 정책 상세 Resource
│ │ ├── prompts/
│ │ │ └── templates.py # Prompt Templates
│ │ ├── validation.py # 입력 검증
│ │ └── audit.py # 감사 로깅
│ ├── data/
│ │ ├── inventory.csv # 재고 데이터 (샘플)
│ │ ├── policies/ # 사내 정책 Markdown 파일
│ │ └── tickets/ # 티켓 JSONL 저장소
│ └── tests/
│ ├── test_tools.py
│ ├── test_resources.py
│ └── test_integration.py
└── starter-kit/ # 수강생용 시작 템플릿
├── pyproject.toml
├── .env.example
├── src/
│ ├── server.py # 뼈대만 있는 서버
│ ├── models.py # TODO 주석 포함
│ ├── tools/
│ ├── resources/
│ ├── prompts/
│ ├── validation.py
│ └── audit.py
├── data/
└── tests/
课程摘要
| 模块 | 篇数 | 时间 | 主题 |
|---|---|---|---|
| 第一章 EP01-03 1小时MCP基础-概念、体系结构、第一台服务器 | |||
| 第二章 | EP04-09 | 2小时 | Tools深化-库存、策略、票证、安全性 |
| 第三章 | EP10-16 | 2小时20分钟 | Resources&Prompts-数据暴露、模板、测试 |
| 第四章 | EP17-21 | 1小时40分钟 | 集成&测试-Transport,客户端联动,Capstone |
| 第五章 | EP22-27 | 2小时 | Advanced-认证、Docker、监控、生产 |
许可证
麻省理工学院