learning-it by example

Back to the video

MCP Resources and Prompts, Not Just Tools

Tools are only one of three things an MCP server can offer. Here are the other two, and the one default that stopped a file leak.

Video #29 ยท AI agents and MCP

Steps in the video

  1. 0:00 Not just tools
  2. 0:24 The idea
  3. 0:55 Setup
  4. 1:12 The server
  5. 1:36 The prompt
  6. 1:54 The client
  7. 2:36 The attack
  8. 3:25 What this does not show
  9. 3:54 Mistakes to avoid
  10. 4:19 My take and next steps
  11. 4:47 Recap

Files

  • attack.py (23 lines)
  • client.py (26 lines)
  • docs/returns.txt (2 lines)
  • docs/warranty.txt (2 lines)
  • server.py (36 lines)
  • staff_pay.txt (1 lines)
  • unsafe_server.py (17 lines)

Download the code (zip)

Tested with

Python 3.12.15 | mcp==2.3.0

What this does not show

The shop and every file are made up, including the private one. Tested with the SDK's own client only, one template form and one transport. The path check covers template arguments, not other ways to build a path.

Sources

Learning IT by Example.