
One LLM Isn't Enough: Build a Four-Agent System With LangGraph, MCP, and Cross-Framework Delegation
Chris Harper
3 min read
Jul 9, 2026 · 12:07 UTC
TL;DR: Multi-agent systems split complex tasks across specialists — LangGraph wires the state graph, MCP servers give each agent its tools, and the A2A protocol lets agents hand off work across frameworks.
What you'll be able to do after this:
- Design a supervisor-worker multi-agent system where a coordinator routes tasks to specialized agents
- Give each agent its tools via MCP servers — no hard-coded function lists, no code changes when tools change
- Delegate sub-tasks to agents built in a different framework (CrewAI, OpenAI Agents) via the A2A protocol
The system at a glance
The freeCodeCamp Full Book tutorial builds a Learning Accelerator — four agents that plan a curriculum, explain topics, quiz the learner, and adapt based on results:
| Agent | Role |
|---|---|
| Curriculum Planner | Takes a learning goal, returns a structured JSON roadmap |
| Explainer | Queries MCP filesystem/notes servers, grounds answers in real docs |
| Quiz Generator | Writes questions, grades responses, tracks weak areas |
| Progress Coach | Synthesizes results; delegates to a CrewAI agent via A2A |
Run it yourself
pip install langgraph mcp a2a-sdk langchain-ollama crewai langfuse deepeval
ollama pull llama3.2 # or any local model
git clone https://github.com/sandeepmb/freecodecamp-multi-agent-ai-system
Step 1 — Define the state graph
Each agent is a LangGraph node: a Python function that receives AgentState, calls an LLM + tools, and returns updated state.
from langgraph.graph import StateGraph
builder = StateGraph(AgentState)
builder.add_node("curriculum_planner", curriculum_planner_node)
builder.add_node("explainer", explainer_node)
builder.add_node("quiz_generator", quiz_node)
builder.add_node("progress_coach", coach_node)
# edges define routing between nodes
builder.add_edge("curriculum_planner", "explainer")
Step 2 — Attach MCP servers as tool sources
Instead of hard-coded functions, each agent binds to a running MCP server. The Explainer reads the learner's actual notes:
from langchain_mcp_adapters.client import MultiServerMCPClient
mcp_client = MultiServerMCPClient({
"filesystem": {"command": "python", "args": ["mcp_servers/filesystem_server.py"]},
"memory": {"command": "python", "args": ["mcp_servers/memory_server.py"]},
})
tools = await mcp_client.get_tools()
Step 3 — Cross-framework delegation via A2A
The Progress Coach can hand off work to a CrewAI agent running in a separate process. A2A makes this a standard HTTP call:
from a2a.client import A2AClient
async def delegate_to_crewai(task: str) -> str:
client = A2AClient("http://localhost:8001")
result = await client.send_task({"message": {"parts": [{"text": task}]}})
return result.artifact.parts[0].text
Step 4 — Crash recovery with SQLite checkpoints
from langgraph.checkpoint.sqlite.aio import AsyncSqliteSaver
memory = AsyncSqliteSaver.from_conn_string("checkpoints.db")
graph = builder.compile(checkpointer=memory, interrupt_after=["curriculum_planner"])
LangGraph serializes state after every node — a restart picks up at the last completed node, not from scratch.
Sources: How to Build a Multi-Agent AI System with LangGraph, MCP, and A2A [Full Book] — freeCodeCamp · GitHub companion repo · LangGraph docs