Orchard Core A2A Client
The A2A Client feature lets Orchard Core AI experiences call agents hosted on other A2A servers, including other Orchard Core sites running the A2A Host feature (orchardcore-ai-a2a-host).
Guidelines
- Feature ID
CrestApps.OrchardCore.AI.A2A, from theCrestApps.OrchardCore.AI.A2Apackage (install it in the web/startup project). It depends onCrestApps.OrchardCore.AIandCrestApps.OrchardCore.Resources. - Connections are managed under Artificial Intelligence → Agent to Agent Hosts (permission
ManageA2AConnections, granted to Administrator by default). - A connection points at the base URL of an A2A host. The agent card is resolved from
/.well-known/agent-card.jsonand cached for 15 minutes. - Agent endpoints are read from the card's A2A 1.0
supportedInterfaces. Older cards that only publish a top-levelurlare still handled. - Each remote agent skill becomes a tool the model can call. Keep remote descriptions accurate, because they drive tool selection.
- Credentials are encrypted at rest with ASP.NET Core Data Protection.
Enable the feature
{
"steps": [
{
"name": "Feature",
"enable": [
"CrestApps.OrchardCore.AI",
"CrestApps.OrchardCore.AI.A2A"
],
"disable": []
}
]
}
Add a connection
- Open Artificial Intelligence → Agent to Agent Hosts and click Add Connection.
- Enter a Title, the host Endpoint (for example
https://agents.example.com), and an Authentication method. - Save. The list (
AdminListnameA2AConnections, seeorchardcore-admin-lists) shows each connection with its endpoint.
The client posts messages to the Endpoint itself and registers the agent card's skills as tools. For
the A2A host of another CrestApps site, enter that site's address followed by /a2a, and set
ExposeAgentsAsSkill to true on the host so its agents are listed as skills (orchardcore-ai-a2a-host).
Authentication types (`A2AConnectionMetadata.AuthenticationType`)
| Value | Fields |
|---|---|
| Anonymous | None (default) |
| ApiKey | ApiKey, ApiKeyHeaderName, optional ApiKeyPrefix such as Bearer |
| Basic | BasicUsername, BasicPassword |
| OAuth2ClientCredentials | OAuth2TokenEndpoint, OAuth2ClientId, OAuth2ClientSecret, OAuth2Scopes |
| OAuth2PrivateKeyJwt | OAuth2TokenEndpoint, OAuth2ClientId, OAuth2PrivateKey (PEM), optional OAuth2KeyId, OAuth2Scopes |
| OAuth2Mtls | OAuth2TokenEndpoint, OAuth2ClientId, OAuth2ClientCertificate (Base64 PFX), optional OAuth2ClientCertificatePassword, OAuth2Scopes |
| CustomHeaders | AdditionalHeaders as a JSON object |
To call an Orchard Core A2A host in ApiKey mode, use ApiKeyHeaderName Authorization and prefix ApiKey or Bearer.
Recipe step
The A2AConnection step creates connections, or updates the one whose ItemId matches. DisplayText and Endpoint are required, and the endpoint must be an absolute HTTP or HTTPS URL.
{
"steps": [
{
"name": "A2AConnection",
"Connections": [
{
"DisplayText": "Production agent hub",
"Endpoint": "https://agents.example.com",
"Properties": {
"A2AConnectionMetadata": {
"AuthenticationType": "ApiKey",
"ApiKeyHeaderName": "Authorization",
"ApiKeyPrefix": "ApiKey",
"ApiKey": "{{AgentHubApiKey}}"
}
}
}
]
}
]
}
Secrets supplied in the recipe are encrypted on import. The module registers no deployment step for A2A connections, so recreate them per environment with a recipe.
Assign connections
| Surface | Where |
|---|---|
| AI Profile | Capabilities tab, A2A Connections |
| AI Profile Template (Profile source) | Capabilities tab, A2A Connections |
| Chat Interaction | Capabilities tab, A2A Connections |
| AI Completion using Direct Config workflow task | Capabilities tab (needs CrestApps.OrchardCore.AI.Chat.Interactions and OrchardCore.Workflows) |
The section renders only when at least one connection exists.
How remote agents run
- The client fetches and caches each selected host's agent card.
- Each agent skill on the card is registered as an AI tool.
- When the model picks one,
A2AAgentProxyToolsends the message to the agent's interface URL with the connection's credentials. - The remote reply is returned to the model as tool output.
The client also contributes system functions the orchestrator can use:
| Function | Purpose |
|---|---|
| listAvailableAgents | Lists local and remote agents |
| findAgentForTask | Finds the best-matching agent for a task |
| findToolsForTask | Finds the best-matching AI tools for a task |
Upgrading from 2.x
- Remote endpoints are read from
supportedInterfaces(A2A 1.0). Hosts that still publish onlyurlkeep working. - The connections list now uses Orchard Core's
AdminListshape; theme overrides of the old row template apply only to the List layout.
Troubleshooting
| Symptom | Check |
|---|---|
| No remote tools appear | The connection is not selected on the profile, the card fetch failed, or the card was cached before the host changed (wait 15 minutes or re-save the connection). |
| 401 from the remote host | Authentication type, header name, or prefix does not match what the host expects. |
| Calls reach the wrong URL | Inspect the host's agent card supportedInterfaces; the client calls the URL the card advertises. |
| Validation error on import | Endpoint is missing or not an absolute HTTP or HTTPS URL. |