learning-it by example

Back to the video

MCP Explained Simply: A Flight Booking Demo in Python

People talk about MCP like magic, so I spoke it by hand, in plain JSON lines.

Video #292 ยท AI agents and MCP

Steps in the video

  1. 0:00 MCP by hand, in plain JSON lines
  2. 0:25 The idea
  3. 1:04 Setup
  4. 1:31 The server
  5. 1:57 Speaking MCP by hand
  6. 2:33 The same with the SDK
  7. 3:33 What this does not show
  8. 4:13 Mistakes to avoid
  9. 4:46 My take and next steps
  10. 5:10 Recap

Files

  • client.py (21 lines)
  • raw.py (32 lines)
  • server.py (34 lines)

Download the code (zip)

Tested with

Python 3.12.15 | mcp==2.3.0

What this does not show

A made-up airline server on one machine over standard input and output, with two tools; the calls are scripted, no model chooses them, and nothing checks who is asking; resources, prompts and the web transport are not shown.

Sources

Learning IT by Example.