google-a2a
About Pure java implementation of Google A2A protocol. This project demonstrates how to build an A2A-compliant multi-agent system using Spring Boot, Ollama, and the Agent-to-Agent (A2A) protocol. The architecture is based on a Parent Agent that orchestrates multiple Child Agents (e.g., Order Agent, Seller Agent).
claude mcp add --transport stdio kuldeepsingh99-google-a2a java -jar google-a2a.jar \ --env OLLAMA_URL="URL of Ollama server (e.g., http://localhost:11434)" \ --env A2A_CONTEXT="Context or environment name for this MCP server" \ --env A2A_REGISTRY_BASE_URL="Base URL for agent discovery (e.g., https://registry.example.com)"
How to use
This MCP server implements Google's A2A (Agent-to-Agent) protocol using a Java Spring Boot-based architecture. It orchestrates multiple child agents (e.g., Order Agent, Seller Agent) by dynamically discovering their AgentCards, routing tasks through a centralized LLM (via Ollama), and aggregating responses into a natural-language answer. The Parent Agent coordinates chained workflows—for example, first querying the Order Agent to fetch B2C orders and then using a seller ID from those results to fetch additional details from the Seller Agent. Each agent operates within its own boundaries and exposes its own agent.json, enabling a modular and extensible system where new agents can be added without changing the parent orchestration logic. To use the server, ensure Ollama is running and your registry or child agents are accessible, then start the Java application to begin dynamic discovery and routing of user requests through the A2A protocol.
How to install
Prerequisites:
- JDK 11 or newer
- Maven or a built Java packaging artifact
- Ollama installed and running (for LLM routing)
- Access to agent cards via configured endpoints
Install steps:
-
Clone the repository: git clone https://github.com/kuldeepsingh99-google-a2a.git cd google-a2a
-
Build the project (Maven): mvn -f pom.xml clean package -DskipTests
-
Run Ollama (ensure it is listening on the default port or adjust configuration): ollama start
-
Start the MCP server (as a standalone JAR or from your IDE): java -jar target/google-a2a.jar
-
Optional: If you prefer Docker, build a container image and run with docker run using the provided image name.
-
Verify setup by sending a test request to the Parent Agent endpoint (configured in application.properties or environment) and observe dynamic agent discovery and task routing via the A2A protocol.
Additional notes
Tips and notes:
- Ensure Ollama is reachable at the configured Ollama URL; routing decisions rely on LLM outputs.
- The Parent Agent discovers Child Agent Cards (agent.json) dynamically; make sure child agents expose valid agent.json descriptors.
- If you modify agent endpoints or registry URLs, update A2A_REGISTRY_BASE_URL and related environment variables accordingly.
- Common issues include network access to child agents, misconfigured agent.json, or Ollama not running. Check logs for A2A protocol handshakes and LLM decision steps.
- For production, consider securing endpoints and using authenticated registry access to prevent spoofed AgentCards.
Related MCP Servers
api2mcp4j
This is a revolutionary AI MCP plugin with excellent pluggable and encapsulated features. With just a few lines of configuration, it can easily integrate into your Spring boot web program and give it MCP capabilities,inheriting the powerful engineering capabilities of the Spring series framework
Unified -Tool-Graph
Instead of dumping 1000+ tools into a model’s prompt and expecting it to choose wisely, the Unified MCP Tool Graph equips your LLM with structure, clarity, and relevance. It fixes tool confusion, prevents infinite loops, and enables modular, intelligent agent workflows.
springai -gateway
Spring Boot gateway that unifies multiple MCP servers into one endpoint for AI assistants, OAuth 2.1
slack
Spring AI를 활용한 Slack MCP 서버입니다.
devto-agent
Build and deploy an autonomous Devto Agent capable of interacting with the Dev.to platform, powered by A2A (Agent-to-Agent) and MCP (Model Context Protocol)
mcp -with-spring-ai
Build your own mcp server with spring ai