From PM to Reviewer: Headless Agent Orchestration with Python, MCP AND A2A

YOUR AI CAN ALREADY WRITE CODE.
THIS BOOK TEACHES IT TO WORK LIKE A TEAM.

The Problem You Already Know

Your AI assistant wrote the feature. It also ran the tests. It also decided the tests passed. It also, technically, reviewed its own pull request, approved it, and told you it was done.

You merged it. Three days later, in production, you found the bug — and when you went looking for who should have caught it, the honest answer was nobody. The same model that wrote the code was the only model that ever looked at it. It graded its own homework, and gave itself an A.

That’s not a hypothetical. It’s the default failure mode of almost every AI coding tool built today: one model wearing every hat at once — planner, coder, tester, and reviewer — with nobody in the loop whose job it is to disagree with it.

This book exists to fix exactly that.


What You’ll Actually Build: CodeForge Pod

You’re not going to read about multi-agent systems. You’re going to build one — a real, headless, four-persona development team you run from your own terminal:

  • Product Manager — turns your loose request into a strict written spec
  • Developer — connects through a real MCP server to touch your files and write the code
  • QA Tester — connects through a second MCP server to actually run it, not guess whether it works
  • Reviewer — reads the record left behind and renders a plain verdict: PASS or FAIL, sending failed work back with exact feedback

Every handoff is safe by construction, not by promise: a workspace boundary that blocks operations outside an approved folder, a dry-run mode, git-style diff previews before any write, and a full SQLite ledger of every run you can replay later.

Then you go further than almost any other technical book takes it: you expose CodeForge Pod over A2A — publishing a real, signed Agent Card and accepting a live task from an independent agent, built by someone else, over the open network.


Why MCP and A2A, Right Now

MCP (Model Context Protocol) is Anthropic’s open-source answer to the “N × M integration” problem — one standard way for any model to describe and call a tool, instead of a hundred bespoke wirings. It’s now governed by a vendor-neutral foundation under the Linux Foundation.

A2A (Agent2Agent), built by Google and also under Linux Foundation governance, solves the second wall: letting independent agents — built by different teams, on different stacks — hand work to each other.

Together they form the two-layer stack the industry is converging on in 2026: MCP running vertically, connecting an agent to its own tools; A2A running horizontally, connecting agents to each other. This book builds a real, running instance of that stack — not a diagram of one.


What’s Inside: 22 Chapters, 4 Sections, One Continuous Build

Section I — Foundations, Concepts, and Theory (Ch. 1–5) Understand what makes something an agent instead of a chatbot, exactly what MCP and A2A each solve, why four personas beat one god-agent — and write a real, signed-off Product Requirements Document for CodeForge Pod.

Section II — Build the Single-Agent Core (Ch. 6–13) Scaffold a real, installable CLI tool. Connect it to your first live MCP server. Give it a swappable AI brain across Gemini, OpenAI, and Ollama. Add real command execution with real safety rails, and give the system permanent memory in SQLite.

Section III — Multi-Agent Orchestration and A2A Interoperability (Ch. 14–19) The heart of the book. One agent becomes four disciplined specialists wired together by a self-correcting orchestration loop. Expose it over A2A. Build a live terminal dashboard, a true background daemon, and an optional read-only web view.

Section IV — Deployment, Distribution, and What’s Next (Ch. 20–22) Package CodeForge Pod as a real, installable release. Point it at your own Git repository. Prove real A2A interoperability against an independent reference agent. Compare MCP and A2A transport internals, understand the token economics of running four agents instead of one, and leave with your own roadmap.


What You’ll Walk Away Knowing

SkillWhat It Means in Practice
Multi-agent architectureSplitting one overloaded job into narrow, single-responsibility personas with a fixed handoff order
MCP client engineeringLaunching, connecting to, and safely bounding a real MCP server from your own Python client
A2A interoperabilityPublishing an Agent Card and exchanging real tasks with an agent you didn’t build
Headless orchestrationA state machine that runs unattended, retries intelligently, and reports honestly
Provider-agnostic intelligenceSwapping Gemini, OpenAI, or a fully offline Ollama model with one config line
Safety-by-constructionWorkspace jailing, dry-run previews, and diff approval before any real write happens
Production packagingShipping a real, pipx-installable CLI tool that runs on a machine that owes you nothing

Who This Book Is For

  • Software engineers and technical leads who already know Python and want a rigorous, production-grade education in multi-agent design — not another prompt-engineering listicle
  • Architects and engineering managers evaluating whether MCP and A2A belong on their team’s roadmap, who want to have built something real first
  • Anyone who has used an AI coding assistant, loved what it could do, and quietly worried about the parts where it graded its own homework
  • Engineers who want to be genuinely ready for where agentic systems are headed over the next two years

You don’t need prior MCP or A2A experience. You need working Python, a willingness to open a terminal, and the patience to build something real.


Your Toolkit

Python 3.14 & asyncio · Typer · MCP · A2A · Gemini, OpenAI & Ollama · SQLite · Textual & FastAPI · Docker


From the Authors

We’ve been building and writing about enterprise software together for over two decades, from our home base in Mumbai — more than 45 technical books across Python, distributed systems, and applied AI between us.

We’ve sat exactly where you’re about to sit: watching an agent confidently overwrite a file it should never have touched, chasing a silent failure through four layers of async code at midnight. This book is written the way we wish that explanation had existed for us — precise theory where theory earns its place, exact commands everywhere else, and a real, working system at the end of it.


Get the Complete Codebase

Every persona, every MCP server integration, every line of the orchestrator, the A2A server and client, and the Textual dashboard is included — ready to download, run, break, and rebuild in your own words.