ข้ามไปยังเนื้อหา

MCP Design — From Zero to Hero

คอร์สแบบ standalone ตั้งแต่ผู้เริ่มต้นจนถึงขั้นสูง ว่าด้วยการออกแบบด้วย Model Context Protocol (spec 2026-07-28) ตั้งแต่โมเดล host/client/server และ wire protocol ไปจนถึง tools, resources, prompts, transport, elicitation, งานที่รันนาน, OAuth 2.1, security และการส่งขึ้น production — ทุกหัวข้อมี JSON บน wire คู่กับโค้ด SDK ทั้ง TypeScript และ Python

MCP Foundations

MCP คืออะไร, host/client/server, data layer กับ transport layer, JSON-RPC และ _meta, discovery กับ versioning และ server ตัวแรกของคุณใน Inspector เริ่ม →

Server Primitives

tools, structured output และ annotation, resources กับ URI template, prompts, change notification และ caching สร้าง →

Transports

stdio และ Streamable HTTP — framing, header, SSE stream, การสร้าง HTTP server และ backward compatibility กับ protocol ยุคเก่า เชื่อมต่อ →

Client Interaction

multi round-trip request, elicitation (form และ URL), progress กับ cancellation, Tasks extension และ sampling/roots/logging ที่ถูก deprecate โต้ตอบ →

Building Clients & Hosts

การเขียน client, ต่อ tools เข้ากับ LLM agent loop, ใช้ server ใน Claude Code และ Claude API, scale ไปถึงหลายร้อย tool เชื่อมระบบ →

Security & Authorization

OAuth 2.1 สำหรับ MCP — discovery, PKCE, resource indicator, client registration, การป้องกัน server, ภัยคุกคามและวิธีรับมือ, third-party auth ป้องกัน →

Production & Ecosystem

ออกแบบ tool ที่ agent ใช้ได้ดี, ทดสอบและ debug, deploy remote server, เผยแพร่ลง registry, extension และสิ่งที่เปลี่ยนไป ส่งขึ้น production →

Wire-first เสมอ

ทุกแนวคิดเริ่มจาก JSON-RPC message ที่ส่งกันจริงบน wire แล้วค่อยแสดงว่า SDK ของ TypeScript และ Python generate มันออกมาอย่างไร จะได้ไม่มีอะไรเป็น magic

สอง SDK เทียบกันชัด ๆ

ตัวอย่าง server และ client ใน TypeScript (@modelcontextprotocol/server, @modelcontextprotocol/client) และ Python (mcp) ผ่านแท็บที่ sync กัน เลือกภาษาครั้งเดียวแล้วตามไปทุกที่

เน้นการออกแบบ ไม่ใช่แค่ syntax

ทำไม protocol ถึง stateless, เมื่อไร tool ดีกว่า resource, ออกแบบ tool ให้ agent ใช้ได้ดีอย่างไร, ทำให้ remote server ปลอดภัยอย่างไร — มี trade-off ให้คิดทุกหน้า

spec ปัจจุบัน พร้อมประวัติ

เขียนตาม protocol revision 2026-07-28 พร้อมหมายเหตุที่ระบุชัดถึงยุคเก่า (2025-11-25 และก่อนหน้า) เพื่อให้ tutorial เก่า ๆ ยังอ่านรู้เรื่อง สองภาษา (English / ไทย) พร้อมบันทึกความคืบหน้า quiz