How do you build a minimal MCP server and wire it into a LangGraph agent?medium
Define tools in a server file with FastMCP using an @mcp.tool() decorator and run it over stdio; in the agent file, connect with MultiServerMCPClient pointed at that server command, call client.get_tools() to auto-discover the tools, and hand them to LangGraph's create_react_agent — the agent then chains tool calls automatically.
A two-file POC: math_server.py defines add() and multiply() as MCP tools and calls mcp.run(transport="stdio") to serve them as a local subprocess. agent.py opens an async MultiServerMCPClient with a "math" entry pointing transport "stdio" at ["python", "math_server.py"], awaits client.get_tools() to discover them, and passes those tools straight into create_react_agent(llm, tools). Given a prompt like "What is (3 + 5) * 12?", the ReAct agent calls add(3, 5) to get 8, then multiply(8, 12) to get 96 — multi-step tool use with zero manual orchestration code.