Loading topic
server.py from the previous chapter.2 min readClientSession and called initialize(). The server below is the calc server from the earlier chapter, saved as server.py.2 min readClientSession and have listed tools, as in the previous chapters.2 min readClientSession from the earlier chapters, and you have the to_llm_tools helper that converts MCP tool definitions into the model's tool format.2 min readasyncio. The loop there trusts every tool call to succeed quickly. Real servers fail, hang, and return too much text.2 min readClientSession over stdio, list tools, convert them to LLM tool definitions, and run the agent loop. Here you extend that setup to more than one server.2 min readClientSession and have listed tools, as in the earlier chapters. Tools are not the only thing a server can offer. Resources and prompts use the same session, but your host decides when to use them, not the model.1 min readClientSession and async/await.2 min readsession.call_tool, tool_result blocks, and the MCP roles of host, client and server. Your application is the host, so it decides what a model may actually run. The server and the model do2 min readserver.py and client session code from the earlier chapters. You should also be comfortable running pytest and reading JSON-RPC traces.2 min read