Save week12.py in your exercise folder and run python week12.py --lesson 1. The file launches itself as a separate server process and exchanges actual newline-delimited messages over pipes. It needs only Python’s standard library, no account, network, external package, or model. It should complete in seconds on a processor.
json.dumps converts a Python dictionary to JSON text; json.loads reverses that transformation. Here is a complete discovery request assembled before writing it to the server:
import json
request = {"jsonrpc": "2.0", "id": 1, "method": "server/discover",
"params": {"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientCapabilities": {},
"io.modelcontextprotocol/clientInfo": {"name": "academy", "version": "1"}}}}
line = json.dumps(request) + "\n"
assert json.loads(line)["id"] == 1
The weekly file supplies the actual process and transport code. Expect discovery, metadata rejection, and unsupported-version checks to pass. This is real local protocol execution. The model-selection and answer-generation parts of a larger assistant remain separate competencies, since no language model is called here.