Skip to main content
Every other tutorial in this section is a single agent. This one wires MCP servers into a SequentialWorkflow, which is the more interesting case for a multi-agent framework: each agent gets only the server it needs, and the pipeline hands findings down the chain. Three different models, chosen by what each stage actually does: the researcher reasons over an unfamiliar codebase, the librarian does lookup-and-compare, and the reporter only has to write well from material it was handed.

Why split the tools per agent?

You could give one agent both servers. Four reasons not to:

Build it

1

Install and set your keys

Both servers used here are free and need no key of their own.
2

Stage 1 — the researcher, with DeepWiki only

The last sentence of that prompt is the whole trick of chaining agents: stage one has to emit something stage two can act on. “It uses several HTTP libraries” is useless downstream; httpx, anyio is not.
3

Stage 2 — the librarian, with Context7 only

Three loops, because each dependency needs a resolve-then-fetch pair and there is usually more than one.
4

Stage 3 — the reporter, with no tools at all

No mcp_url. There is nothing left to look up, and a tool here would only invite the model to re-do work the earlier stages already did.
5

Chain them

Sequential or concurrent?

These stages are genuinely dependent — the librarian looks up whatever dependencies the researcher found — which is why this is a chain. When stages don’t depend on each other, swap in ConcurrentWorkflow and they run in parallel. The constructor call is otherwise identical:
A useful test: if you can shuffle the agent list without changing the meaning of the run, it should be concurrent.

Other shapes worth trying

Next