Loading topic
server.py and client session from the earlier chapters. You do not need to know J5 min readserver.py calculator from the earlier chapter. Here you will learn what happens between launching a server and making your first tool call, and where that s5 min readserver.py from the previous chapter (the calc server with one add tool). You will write the client half: launch the server, open a session, and call a tool.4 min readserver.py and client code from the earlier chapters. You should already know how ClientSession.initialize() works and what a JSON Schema looks like. Here you will look closely at what tools/list returns, how to read each field, and which mistakes cause trou4 min readserver.py from the earlier chapter, with its add tool, and a working ClientSession that lists tools. You will now wire those pieces into a loop that lets a model call MCP t5 min readasync/await and with AsyncExitStack from the standard library.5 min readinitialize(), and list tools. Here you will use the other two primitives, resources and prompts, from your own host application.5 min readasync/await and basic HTTP headers.6 min readserver.py (the add tool), the stdio client session, the to_llm_tools mapping and the agent loop from the earlier chapters. You should also be comfortable with pytest and async/await.5 min read