Insights7 min read
Building a Human-in-the-Loop Multi-Agent Platform with LangGraph and MCP
How I designed an agent platform on LangGraph with Model Context Protocol tools, persistent checkpointed memory and human approval before sensitive actions.
Muhammad Mubashir
Founder & CEO, Retrieva Labs
- LangGraph
- Model Context Protocol
- AI Agents
- Human-in-the-Loop
The problem
A client wanted an agent that could search the web, query live financial data, read internal documents and act on the results, but they were rightly nervous about handing a language model unsupervised write access to anything. The brief was simple to state and hard to build well: give the agent real capability, but never let it act on anything sensitive without a person checking first.
Why LangGraph over a plain tool-calling loop
Most "agent" demos are a while loop: call the model, execute whatever tool it picked, feed the result back, repeat. That works for a demo. It falls apart the moment the agent needs to survive a server restart mid-conversation, or pause and wait for a person to approve a step before continuing.
LangGraph's StateGraph gives you both. The agent's state, including conversation history, intermediate results and the current step, is a first-class object that gets checkpointed, not something you manually serialize into a database table. I backed the checkpointer with async SQLite, so a conversation can be interrupted, the process can restart, and the agent picks up exactly where it left off.
Model Context Protocol for tool access
Instead of hand-rolling tool schemas for every integration (web search, financial data lookups, internal documents), I wired the agent to an MCP client. The practical benefit is that adding a new tool means pointing at a new MCP server, not writing and maintaining a bespoke function-calling schema and retesting the model's tool selection every time.
Designing the human-in-the-loop interrupts
The tempting shortcut is to prompt the model: "ask the user before doing anything risky." Don't do this. It is unreliable exactly when you need it most: on untested edge cases, ambiguous instructions, or a model that is confident it already has enough information.
The reliable version is a real interrupt() in the graph itself, placed before any node that calls a sensitive tool. Execution pauses, the pending action is shown to a person for approval or rejection, and only then does execution resume, with everything the agent had already reasoned through fully intact.
What I would do differently
State design took longer than the agent logic itself, and I underestimated that going in. It is worth spending real time up front deciding exactly what belongs in the checkpointed state and what can be recomputed, because changing that decision later means migrating every in-flight conversation.
I also learned to test the interrupt paths as rigorously as the happy path. It is easy to test "agent completes the task" thoroughly and barely touch "agent gets rejected at the approval step and has to recover gracefully", but that second path is the entire point of building human-in-the-loop in the first place.