MCP explained from first principles, spelled out in code

Demystifying MCP by building servers and clients from scratch with raw JSON-RPC, then connecting them to LLMs via function calling.