Get the FREE Ultimate OpenClaw Setup Guide →

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).

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
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:

  1. Clone the repository: git clone https://github.com/kuldeepsingh99-google-a2a.git cd google-a2a

  2. Build the project (Maven): mvn -f pom.xml clean package -DskipTests

  3. Run Ollama (ensure it is listening on the default port or adjust configuration): ollama start

  4. Start the MCP server (as a standalone JAR or from your IDE): java -jar target/google-a2a.jar

  5. Optional: If you prefer Docker, build a container image and run with docker run using the provided image name.

  6. 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

Sponsor this space

Reach thousands of developers