Python and Branches
You have reached a useful turning point. In Python and Roots, you followed ordinary functions, collections, files and tests. Now we will use that understanding to read the code surrounding a tool call.
An MCP server or a LangChain workflow can look unfamiliar even when much of its code is ordinary Python. The next lessons separate those familiar pieces from what the framework adds. You will trace the result through both.
Follow the eight lessons in order
| Lesson | What it makes visible |
|---|---|
| Classes and dataclasses | How a value keeps related data and behaviour together |
| Types and validation | The difference between describing an expected shape and enforcing it |
| Callables and decorators | What happens when a function is passed, returned or registered as a tool |
| Iterators and generators | How work can arrive one item at a time |
| Async and await | Where a program can wait without blocking all other scheduled work |
| Build a local MCP server | How a client discovers and calls a bounded tool |
| Follow a LangChain workflow | How named blocks pass data through a complete local run |
| Connect and check tools | How to connect a real local tool, challenge its inputs and judge its output |
Here, branches means applied technical areas such as MCP servers and LangChain. A book assistant is a solution that uses those branches. Neither a framework name nor a running tool is evidence that the whole solution is correct.
We will keep the example narrow: look up the book's public chapter information. The local runs need no model provider or paid API key. You will see exactly where a language model would be a separate component, with additional choices and checks.
The Python work stays focused on reading common code, predicting results and spotting clear mistakes. The framework work adds the ability to identify the pieces and follow a run. Production deployment, broad access to private data and advanced orchestration need further study and are not granted by completing these examples.
Before starting, make sure you can explain the file reader and tests in the last root chapter lesson. Then continue to classes and dataclasses, where related values gain a named shape.