Skip to main content

A2A Host

Feature NameAgent to Agent Protocol (A2A) Host
Feature IDCrestApps.OrchardCore.AI.A2A.Host

The A2A Host feature exposes all AI Profiles of type Agent as discoverable agents via the Agent-to-Agent protocol. External A2A clients can discover available agents and send messages to them.


Agent Exposure Modes

The A2A Host supports two modes for how agents are exposed:

Multi-Agent Mode (Default)

Each Agent AI Profile is exposed as its own independent agent card. The /.well-known/agent-card.json endpoint returns a JSON array of agent cards. Each card has its own url property pointing to /a2a?agent={agentName}.

Skill Mode

When ExposeAgentsAsSkill is enabled, a single combined agent card is returned. All Agent AI Profiles are listed as skills within that card. Messages are routed using the agentName metadata field.


Endpoints

When the A2A Host feature is enabled, the following endpoints become available:

EndpointDescription
/.well-known/agent-card.jsonReturns agent card(s) for discovery (array in multi-agent mode, single object in skill mode)
/a2aThe A2A JSON-RPC endpoint for sending messages to agents
/a2a?agent={name}Routes to a specific agent in multi-agent mode

Sending Messages

Messages sent to /a2a are routed to the appropriate agent based on:

  1. Query parameter routing (multi-agent mode): The ?agent={name} query parameter specifies the target agent.
  2. Metadata routing: If the message includes agentName in its metadata, it routes to that specific agent.
  3. Default routing: If no agent is specified, the message is routed to the first available agent.

Authentication

The A2A Host supports the same authentication patterns as the MCP Server:

Authentication TypeDescription
NoneNo authentication required. Suitable for development environments.
API KeyClients must provide an API key for access.
OpenIdClients authenticate using OpenID Connect tokens. Enable the OrchardCore OpenIddict server feature for automatic integration.

Configuration

Authentication is configured via shell configuration (e.g., appsettings.json):

{
"OrchardCore": {
"CrestApps_AI": {
"A2AHost": {
"AuthenticationType": "None",
"ApiKey": "your-api-key-here",
"RequireAccessPermission": false,
"ExposeAgentsAsSkill": false
}
}
}
}
SettingTypeDefaultDescription
AuthenticationTypeNone | ApiKey | OpenIdOpenIdThe authentication method for the A2A endpoint
ApiKeystringThe API key value (required when using ApiKey authentication)
RequireAccessPermissionbooltrueWhen true, authenticated users must also have the AccessA2AHost permission
ExposeAgentsAsSkillboolfalseWhen true, all agents are combined into a single card with skills instead of individual cards

Permissions

PermissionDescription
Access A2A HostRequired when RequireAccessPermission is enabled in host options