FocusRun the full local integration and inspect reads, tools, errors, and restart recovery.
Save week12.py in your exercise folder and run python week12.py --lesson 2. The client launches a real server subprocess, discovers capabilities, lists every advertised tool and prompt, follows resource pagination, reads a document, gets a prompt template, and calls the search tool. It then tests an unknown method, terminates a server, and reconnects to a fresh process.
queue.Queue is a thread-safe handoff between the pipe reader and the requesting code. get(timeout=...) waits only for the declared duration. Here a complete miniature example illustrates the bound:
import queue
messages = queue.Queue()
messages.put({"id": 2, "result": {"resultType": "complete"}})
reply = messages.get(timeout=1)
assert reply["id"] == 2
The full file supplies pipe reads, serialization, correlation checks, and cleanup. Expected PASS lines include two resources across two pages and a successful read after restart. It uses no protocol software package, so the pinned dependency is the documented standard-library implementation itself. The supported subset and omitted subscription and remote-transport features are listed in the file header.