Recorded runs of a LangChain agent with two local Python tools and two MCP servers. Pick a question and step through it: each LLM call, each tool call, and the messages the agent keeps in its state.
create_agent() builds a LangGraph graph with two nodes. The model node sends the messages so far, plus a schema for every tool, to the LLM.ToolMessage, and goes back to the model. When the LLM replies without tool calls, the graph ends.MultiServerMCPClient.get_tools(), which asks each MCP server for its tools and wraps them as ordinary LangChain tools. The LLM can't tell them apart from local ones. The difference is where they run: calling one sends a JSON-RPC tools/call request to another process.