# A2A in Java: hands on Embabel

DevFeed: [A2A in Java: hands on Embabel](<https://devfeed.tech/articles/a2a-in-java-hands-on-embabel-22587.md>)

Original publisher: [Read original article](<https://medium.com/amex-gbt-technology/a2a-in-java-hands-on-embabel-b18d514be424?source=rss----60a0578f4096---4>)

Author: Aneshka Goyal

Published: 2026-06-21T07:01:03Z

Content type: tutorial

Language: en

Sources: [Amex GBT Technology](<https://devfeed.tech/sources/amex-gbt-technology.md>)

Topics: [Embabel](<https://devfeed.tech/topics/embabel.md>), [A2A protocol](<https://devfeed.tech/topics/a2a-protocol.md>), [Model Context Protocol](<https://devfeed.tech/topics/model-context-protocol.md>), [Maven](<https://devfeed.tech/topics/maven.md>), [Spring Framework](<https://devfeed.tech/topics/spring-framework.md>), [Amazon Bedrock](<https://devfeed.tech/topics/amazon-bedrock.md>)

Tags: [a2a](<https://devfeed.tech/tags/a2a.md>), [a2a-protocol](<https://devfeed.tech/tags/a2a-protocol.md>), [agent](<https://devfeed.tech/tags/agent.md>), [ai](<https://devfeed.tech/tags/ai.md>), [bedrock](<https://devfeed.tech/tags/bedrock.md>), [embabel](<https://devfeed.tech/tags/embabel.md>), [java](<https://devfeed.tech/tags/java.md>), [llm](<https://devfeed.tech/tags/llm.md>), [local](<https://devfeed.tech/tags/local.md>), [maven](<https://devfeed.tech/tags/maven.md>), [mcp](<https://devfeed.tech/tags/mcp.md>), [mcp-server](<https://devfeed.tech/tags/mcp-server.md>), [review](<https://devfeed.tech/tags/review.md>), [software-engineering](<https://devfeed.tech/tags/software-engineering.md>), [spring-ai](<https://devfeed.tech/tags/spring-ai.md>), [spring-boot](<https://devfeed.tech/tags/spring-boot.md>), [story](<https://devfeed.tech/tags/story.md>)

## AI overview

The example builds a Java story-writing agent with Embabel that uses Bedrock for LLM calls, a local Spring AI MCP server to supply a story word count, and A2A HTTP endpoints to accept requests. A project creator generates the starter skeleton; Maven includes Embabel's Bedrock and A2A starters. The agent exposes a goal that writes and reviews a story, while its action arguments provide prerequisites and a configured tool group makes MCP tools available. The article notes that servlet mode must be enabled for A2A endpoints, and the generator's OpenAI and Anthropic integrations are unused. In the demonstrated request, an A2A message asking for a rabbit story triggers the MCP tool and returns a completed task containing the story and review.

## Source excerpt

Part 2: Hands on with Embabel! In Part 1, we discussed how Embabel works internally. In Part 2, we'll now try to get an application started that has an LLM interaction, talks to local MCP server (for tools), and helps us achieve a goal. This time, we'll also make sure we use A2A protocol for our agent (something Embabel makes easier to do allowing us to focus on core business logic and offloading boilerplate code to Embabel). We'll use the project creator to create a skeleton project for us with some Embabel dependencies and code. uvx --from git+https://github.com/embabel/project-creator.git project-creator Please note we can use Java or Kotlin as our preferred language, I would be leveraging Java. This is a simple story teller agent who writes a story and gets it reviewed (both story generation and review comes from LLM). We'd be using Bedrock for connection to our LLM model. For fetching the word count for a topic, it uses an MCP server which is a Spring AI MCP server running locally. Dependency management is handled using Maven, and the POM file looks like this: <?xml version="1.0" encoding="UTF-8"?> <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>3.5.9</version> <relativePath/> <!-- Lookup parent from repository --> </parent> <groupId>com.example.demo-city-agent</groupId> <artifactId>Demo-city-agent</artifactId> <version>0.1.0-SNAPSHOT</version> <packaging>jar</packaging> <name>My first agent</name> <description>Generated agent project</description> <properties> <java.version>21</java.version> <embabel-agent.version>0.3.1</embabel-agent.version> </properties> <dependencies> <!-- Main Dependencies --> <dependency> <groupId>com.embabel.agent</groupId> <artifactId