使用说明
🚀 MCP Zero to One: 模型上下文協定實戰開發
歡迎來到 「從零開始掌握 MCP」 課程專案!本儲存庫包含了完整的教學文件、實作練習與範例代碼,旨在幫助開發者快速掌握 Model Context Protocol (MCP) 的開發技術。
🎯 課程目標
- 理解核心概念:深入了解 LLM 的局限性以及 MCP 如何透過標準化協議解決 Context 整合問題。
- 掌握實作技能:學會使用 Python SDK 開發 Tools, Resources 與 Prompts。
- 生態系整合:能夠將自製的 MCP Server 整合至 Claude Desktop 或自定義的 Agent 應用中。
- 進階應用:探索 Docker 部署、Remote Server 以及安全性最佳實踐。
📂 章節導航
| 章節 | 標題 | 內容簡介 | 關鍵資源 |
|---|---|---|---|
| Ch01 | 為什麼需要 MCP | LLM 的局限與 Agent 架構 | Slides, Agent Loop |
| Ch02 | MCP 是什麼 | 協定架構與 Before/After 對比 | Slides, Comparison |
| Ch03 | 三大核心功能 | Tools, Resources, Prompts 詳解 | Slides, Schema |
| Ch04 | 通訊協定基礎 | JSON-RPC, stdio, SSE 原理 | Slides, Sequence |
| Ch05 | 實作第一個 Server | 🔥 核心實作:Hello World 與計算機 | Code: Basic, Guide |
| Ch06 | Client App 整合 | Claude Desktop 設定與 Python Client | Config, Code: Client |
| Ch07 | 遠端進階應用 | Docker 容器化部署 (SSE) | Code: Remote, Docker Guide |
| Ch08 | 安全性與未來 | 安全檢查清單與生態系展望 | Checklist, Slides |
| Ch09 | 期末專案 | 打造你的個人 AI 助理工具箱 | Project Brief |
🛠️ 快速開始 (Quick Start)
1. 環境準備
本專案使用 uv 進行套件管理 (比 pip 快 10-100 倍)。
# 安裝 uv (如果尚未安裝)
curl -LsSf https://astral.sh/uv/install.sh | sh
# Clone 專案
git clone https://github.com/Zenobia000/LLM_MCP_service_scratch.git
cd mcp-zero-to-one-course
# 初始化環境
uv sync
2. 啟動第一個 Server (Inspector 模式)
uv run mcp dev 05_first_mcp_server/labs/basic_tool.py
3. 使用 Docker 部署遠端 Server
cd 07_remote_advanced/labs
docker build -t mcp-remote-server .
docker run -d -p 8090:8000 --name my-mcp-server mcp-remote-server
📚 參考資源
Maintained by MCP Course Team. Last Updated: 2026-01-15
