A2ajava
Pure java implementation of Google A2A protocol. Integrate your spring boot java applications with A2A protocol , includes client and sever both. Any agent built with a2ajava will also be exposed as MCP tool automatically
Install / Use
/learn @vishalmysore/A2ajavaQuality Score
Category
Development & EngineeringSupported Platforms
README
Java Implementation of Google's A2A Protocol: Connecting the Agentverse
This project provides a Java implementation for both an A2A (Agent-to-Agent) server and client. A2A is an open protocol developed by Google to standardize how AI agents communicate and exchange information, fostering a vibrant ecosystem of interoperable AI. This api also supports building MCP Servers in Java with use of simple annotations. Imagine a world where diverse AI agents, built with different tools and by different creators, can seamlessly collaborate to solve complex problems - that's the vision A2A is bringing to life. This implementation demonstrates how to set up this communication in Java, using the Spring Framework, with a focus on sending and retrieving tasks. a2ajava is a Swiss Army knife for building agentic applications. It is multi-protocol — works seamlessly with both A2A (Agent-to-Agent) and MCP (Model Context Protocol). It is multi-language — supports Java, Kotlin, and Groovy. It is multi-platform — compatible with Gemini, OpenAI, Claude, and Grok. It is multi-client — includes A2A and MCP clients with connectors in Java, Node, and Python. It offers multi-integration — out-of-the-box support for Selenium, human-in-the-loop workflows, and multi-LLM voting for consensus-based decision making. Agents built using the A2A protocol with a2ajava run seamlessly on MCP as well, ensuring maximum interoperability across platforms.
<a target="_blank" href="https://sonarcloud.io/summary/new_code?id=vishalmysore_a2ajava"><img src="https://sonarcloud.io/api/project_badges/measure?project=vishalmysore_a2ajava&metric=alert_status"/></a>
<a target="_blank" href="https://sonarcloud.io/summary/new_code?id=vishalmysore_a2ajava"><img src="https://sonarcloud.io/api/project_badges/measure?project=vishalmysore_a2ajava&metric=bugs"/></a>
<a target="_blank" href="https://sonarcloud.io/summary/new_code?id=vishalmysore_a2ajava"><img src="https://sonarcloud.io/api/project_badges/measure?project=vishalmysore_a2ajava&metric=vulnerabilities"/></a>
<a target="_blank" href="https://sonarcloud.io/summary/new_code?id=vishalmysore_a2ajava"><img src="https://sonarcloud.io/api/project_badges/measure?project=vishalmysore_a2ajava&metric=sqale_rating"/></a>
<a target="_blank" href="https://sonarcloud.io/summary/new_code?id=vishalmysore_a2ajava"><img src="https://sonarcloud.io/api/project_badges/measure?project=vishalmysore_a2ajava&metric=security_rating"/></a>
<a target="_blank" href="https://sonarcloud.io/summary/new_code?id=vishalmysore_a2ajava"><img src="https://sonarcloud.io/api/project_badges/measure?project=vishalmysore_a2ajava&metric=reliability_rating"/></a>
<a target="_blank" href="https://github.com/vishalmysore/a2ajava/actions/workflows/maven.yml"><img src="https://github.com/vishalmysore/a2ajava/actions/workflows/maven.yml/badge.svg"/></a>
<a target="_blank" href="https://github.com/vishalmysore/a2ajava/actions/workflows/codecov.yml"> <img src="https://github.com/vishalmysore/a2ajava/actions/workflows/codecov.yml/badge.svg"/></a>
<img alt="Test Number" src="https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/vishalmysore/6c825c69028a4f8fac9d7c1707628733/raw/test.json"/>
Quick Start
Use these example to quickly build agents using this library , forking and cloning these examples is the best way to get started with a2ajava.
- Spring A2A Agent - Use a2ajava to build a spring agent using A2A and MCP, can work with a2a client or with mcp client like claude desktop or connect to visual studio code as agent. This should be the first project to learn if you are new to agentic ai.
- Connect MCP Agent in Java - MCP Connector for Java Based agents , connect your a2a server to MCP client like claude or connect your MCP server to a2a client. Or vice versa or any permutation and combination
- Database Agent - Use a2ajava to build a database agent using Derby DB, start stop database , insert data , create table all with agentic operation for both mcp as well as a2a
- Standalone Java - Several Examples on how to Use a2ajava to build a standalone java agent using A2A and MCP work with any client
- Log Monitoring Agent - Use a2ajava to build a log monitoring agent which triggers a2a task based on the log messages. Works with both a2a and mcp clients dual protocol
- A2A Kafka Agent - Use a2ajava to build a kafka agent which can trigger a2a task or mcp tool based on the kafka messages.
- A2A Selenium Web Agent - Use a2ajava to build a selenium agent which can trigger a2a task or mcp tool for web browsing , validation of web pages.
- A2A Grafana Agent - Build observable Agents using A2A or MCP and Grafana
- A2A MongoDB RAG Agent – Perform semantic search and reasoning across agent tasks using RAG with MongoDB Agent.
- Simple Agent in Kotlin - Use A2AJava to build a simple agent in Kotlin.
- Build Agent in MCP - Use A2AJava to build a simple agent in MCP.
- MCP Agent in Kotlin - Build MCP Agent in Kotlin and connect to Claude or A2A Clients
- MCP and A2A RAG Server - State of the art RAG server using A2A and MCP with MongoDB Atlas works with both MCP as well as A2A clients
- A2A and MCP Agent with Security - Build A2A and MCP agent with security using Spring Security and JWT.
- A2A and MCP in Groovy - Build A2A and MCP agent in Groovy using A2AJava library.
- A2A and MCP in Scala - Build A2A and MCP agent in Scala using A2AJava library.
- A2A and MCP with Playwright - Build A2A and MCP agent with Playwright for web automation using A2AJava library.
- MCP and A2A with Apache Thrift - Build A2A and MCP agent with Apache Thrift for cross-language communication using A2AJava library. This example demonstrates how to use Thrift to call a service implemented in another language (e.g., Python, Go, C++) from a Java-based A2A or MCP agent.
- Single MCP Server and Client- Build a MCP server and client using A2AJava library. This example demonstrates how to build a MCP server and client using A2AJava library. It also demonstrates how to use the MCP protocol to call tools and tasks from the server.
- MCP Multi Server and Client - Build a MCP server and client with multiple servers using A2AJava library. This example demonstrates how to build a MCP server and client with multiple servers using A2AJava library. It also demonstrates how to use the MCP protocol to call tools and tasks from the server.
- Agentic Mesh - 4 Servers- Build a Agentic Mesh using A2AJava library. This example demonstrates how to build a Agentic Mesh using A2AJava library. It also demonstrates how to use the A2A protocol to call tools and tasks from the server.*
Coming Soon
- A2A Sensor Agent – Use A2A to stream data from physical sensors and trigger real-time actions. ( Please look at ChotuRobo Series)
- A2A Home Automation Agent – Use A2A to control smart home devices via MQTT or Home Assistant integrations. ( Please look at ChotuRobo Series)
- A2A MyScale Agent – Use A2A to run scalable, SQL-based vector searches on tasks and documents with MyScale.
Tutorials
- FAQ
- Introduction
- Annotations Deep Dive
- Enterprise Integration
- Image Processing
- Selenium Integration with A2A and MCP
- Advanced Features with Spring
- Handling Risk in A2A and MCP
- Human In Loop
- Kubernetes Example
- Multi Agents
Live Demo
Live demos have been deployed on hugginface you are welcome to try them out. Or clone the space and create your own space
- A2A MCP RAG Application with Tool calling - A2A Java Agent with Spring Boot and MongoDB Atlas for semantic search and reasoning. This application demonstrates how to use A2A and MCP
Related Skills
node-connect
337.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
337.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.1kCommit, push, and open a PR
