Skip to content

[Feature] Add A2A Agent Card Registry to EventMesh #5247

@qqeasonchen

Description

@qqeasonchen

Search before asking

  • I had searched in the issues and found no similar issues.

Feature Request

Background

The A2A (Agent-to-Agent) protocol is an open standard for agent interoperability. EMQX has implemented a production-grade A2A Registry (emqx_a2a_registry) that provides Agent Card management, discovery, and status tracking via MQTT retained messages. EventMesh's current A2A implementation only includes a JSON-RPC to CloudEvent protocol adaptor and MCP message models, missing the core Agent Card lifecycle management defined by the A2A specification.

Current State

EventMesh's existing A2A implementation has the following gaps compared to the A2A specification and EMQX's reference:

Feature EMQX EventMesh (Before)
Agent Card Schema & Model Full JSON Schema + Erlang maps None
Agent Card Registry (CRUD) emqx_a2a_registry with retained messages None (stub pass-through service)
Agent Discovery (Topic-based) $a2a/v1/discovery/{org}/{unit}/{agent} None
Hierarchical Agent ID org_id / unit_id / agent_id None
Agent Status (online/offline) lookup_agent_status via MQTT client state None
Card Validation JSON Schema validation with toggle None
Security Schemes Full (APIKey / OAuth2 / mTLS / OpenID / HTTP) None
Agent Capabilities & Skills Full model per A2A spec String constants only
REST API for Card Management /a2a/cards/* None

Proposed Changes

  1. Agent Card Java Model — Add POJOs matching the A2A Agent Card JSON Schema (AgentCard, AgentInterface, AgentProvider, AgentCapabilities, AgentSkill, AgentCardSignature, SecurityScheme with all OAuth flow subtypes, SecurityRequirement)

  2. Agent Card JSON Schema — Port agent_card_schema.json from EMQX as a classpath resource for validation

  3. Agent Card Validator — JSON Schema-based validation with configurable toggle (when disabled, only validates JSON object structure)

  4. Agent Identity — Hierarchical identity model (orgId/unitId/agentId) with discovery topic construction (a2a/v1/discovery/{orgId}/{unitId}/{agentId}), topic parsing, wildcard query matching, and ID format validation (^[A-Za-z0-9._-]+$)

  5. A2A Protocol Constants — Extend with Agent Card operations (agent/card/register, agent/card/delete, agent/card/list, agent/card/update), status constants, CloudEvent extension keys, and discovery topic components

  6. Enhanced A2A Protocol Adaptor — Add Agent Card operation routing with discovery topic resolution, card validation during registration, and status metadata extensions (a2astatus, a2astatussource)

  7. A2A Publish Subscribe Service — Replace stub with full Agent Card Registry (in-memory ConcurrentHashMap, CRUD operations, agent status tracking, event metadata augmentation for discovery topics)

  8. A2A Card HTTP Handler — REST API matching EMQX's pattern:

    • GET /a2a/cards/list — list cards with query filters
    • GET /a2a/cards/card/{org_id}/{unit_id}/{agent_id} — get specific card
    • POST /a2a/cards/card/{org_id}/{unit_id}/{agent_id} — register card
    • DELETE /a2a/cards/card/{org_id}/{unit_id}/{agent_id} — delete card
  9. Demo & Dependencies — Add AgentCardDemo example; add json-schema-validator dependency

Impact Analysis

  • No impact on existing EventMesh functionality. All new code is additive — new model classes, new utilities, and new handlers. Modified files (A2AProtocolConstants, EnhancedA2AProtocolAdaptor, A2APublishSubscribeService) maintain backward compatibility: existing message routing paths are unchanged, and the process() method remains a pass-through for non-A2A-discovery events.
  • All existing tests pass (eventmesh-runtime, eventmesh-protocol-a2a, core modules).

References

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions