Skip to content

M16 solution

The expected, fully-commented artifacts for M16's lab. Peek only after you've tried.

File What it is
mcp_server.py A real MCP server (FastMCP) exposing three tools, a safe calculate, plus synthetic lookup_ioc / search_logs (the M9 SOC tools, now shareable). Each @mcp.tool() publishes its name, description, and schema automatically.
mcp_client.py A real MCP client that launches the server over stdio, discovers its tools (list_tools), and calls them (call_tool).

Run it

pip install mcp
python mcp_client.py        # starts mcp_server.py and uses its tools, no key, no network

How this was verified

Verified end-to-end for real on Python 3 with the mcp SDK (no key, no network, MCP runs over local stdio): - the client launches the server, completes the initialize handshake, lists the tools (calculate, lookup_ioc, search_logs with descriptions), and calls them, calculate('245 * 18 / 100') → 44.1 and lookup_ioc('185.220.101.45') → MALICIOUS …; - the starter server's tool (greet) was likewise discovered and called successfully.

This is one of the few modules whose full runtime is verified here (MCP needs no API key and runs locally). To use the server from a finished app, add it to that app's MCP config (e.g. Claude Desktop), that step is the learner's, on their own machine.