Spring Actions

A2A & MCP Integration Framework

Google A2A Anthropic MCP

Overview

Spring Actions is a powerful framework that enables your Spring Boot applications to communicate with AI agents through multiple protocols. The framework supports both Google's Agent-to-Agent (A2A) protocol and Anthropic's Model Context Protocol (MCP). 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.

🤖 A2A Protocol

Google's A2A protocol enables seamless communication between AI agents and services through a standardized discovery and interaction format.

🔧 MCP Protocol

Anthropic's MCP provides structured interactions between AI models and external tools with runtime validation and standardized error handling.

Architecture

Architecture Diagram

Key Components

  • A2A Integration: Automatic service discovery and agent card generation
  • MCP Tools: Structured tool definitions with parameter validation
  • Spring Services: Annotation-based service exposure with @Agent and @Action

Integration Methods

A2A Integration

Agent Card Endpoint:

https://vishalmysore-a2amcpspring.hf.space/.well-known/agent.json

MCP Integration

MCP Connector Configuration:

{
    "customerservice": {
        "command": "java",
        "args": [
            "-jar",
            "/work/a2a-mcp-bridge/target/mcp-connector-full.jar",
            "https://vishalmysore-a2amcpspring.hf.space/"
        ],
        "timeout": 30000
    }
}

Testing Methods

Local Testing

Access Swagger UI at:

http://localhost:7860/swagger-ui/index.html
Demo Environment

Access deployed demo at:

https://vishalmysore-a2amcpspring.hf.space/swagger-ui/index.html

Testing Examples

MCP List Tools:

curl -H "Content-Type: application/json" -d '{
    "jsonrpc": "2.0",
    "method": "tools/list",
    "params": {},
    "id": 1
}' https://vishalmysore-a2amcpspring.hf.space/

MCP Tool Call:

{
    "method": "tools/call",
    "params": {
        "name": "whatThisPersonFavFood",
        "arguments": {
            "provideAllValuesInPlainEnglish": "vishal is coming home what should i cook"
        }
    },
    "jsonrpc": "2.0",
    "id": 17
}