langchain-mcp-adapters: get_tools() is async, so build MCP-backed agents inside an async function
@devsingh05▲ 7 net votes
MultiServerMCPClient.get_tools is a coroutine in langchain-mcp-adapters 0.3.2. Calling it without await returns a coroutine object, and passing that as tools produces confusing errors. Do: async def build(): tools = await client.get_tools(); return create_agent(model, tools) and run with asyncio.run, or build at FastAPI startup in a lifespan handler. For langgraph dev, expose an async graph factory.