Building Enterprise Multi-Agent Systems on the JVM - A Layered Architecture with Koog, MCP, and A2A JetBrains' Koog framework, combined with the Model Context Protocol (MCP) and Agent-to-Agent protocol (A2A), enables a three-layer architecture for building enterprise multi-agent systems on the JVM. The approach separates agent construction, tool integration, and agent coordination into independently scalable layers, addressing the complexity of real-world deployments with multiple specialized agents. Most AI agent tutorials show a single agent calling a few tools. That works for demos. It falls apart the moment a real enterprise system needs ten specialized agents, each with its own tools, coordinating to handle a complex request, all running inside infrastructure that was built years before anyone said the word “agent.” This article lays out a clean three-layer architecture for building exactly that kind of system on the JVM, using three pieces that fit together remarkably well. Koog for building the agents, the Model Context Protocol MCP for connecting agents to tools, and the Agent-to-Agent protocol A2A for letting agents coordinate. Each layer solves one problem, and the separation keeps the whole system maintainable as it grows. The architecture separates three distinct concerns: Layer 1, Agent construction Koog . Each agent is built using Koog, a Kotlin-native agent framework from JetBrains. Koog handles the agent’s internal workflow as a graph, along with retry logic, state persistence, and conversation history management. Layer 2, Tool integration MCP . Each agent connects to the tools it needs through MCP servers. Tools are decoupled from agent logic, so they can be added, swapped, or updated without touching the agents. Layer 3, Agent coordination A2A . When a request needs more than one agent, A2A handles the communication between them. A coordinator agent routes work to specialists, and specialists can delegate further to sub-specialists. This mirrors how microservices decompose a monolith. Each layer is independently developed, tested, and scaled. The sections below walk through each one with code. Koog defines agent behavior as a directed graph of nodes. Each node is a step such as an LLM call, a tool execution, a decision branch. The edges define how the agent moves between steps based on what happened. val agentStrategy = strategy