A2A and MCP are two emergent standards for AI-based systems to communicate. Early work on A2A and MCP focused on services that were under the control of the developer and required little to no authentication support.
As adoption has increased, two critical needs have emerged:
The ability for a program to authenticate with a known A2A or MCP server that might be remote and that there is an established authentication relationship with.
The ability of an agent or program to authenticate with an A2A or MCP server that there is no existing authentication relationship with.
For developers using orchestration frameworks to wire together agents and MCP tools under their control the first case above, API keys and OAuth, are sufficient and well-supported solutions.
For the second case, it is (a) unlikely that every agent will be integrated with a sufficient number of OAuth authentication services to ensure that every request can be authenticated, and (b) that agents will be able to derive API keys for every other agent they might interact with. For an open ecosystem where any agent should be able to discover, authenticate, and communicate with any other agent, a more universal solution is needed.
This document proposes a solution that uses DIDs, JWT, and WWW-Authenticate to authenticate agents and MCP servers.
The main components of the network architecture are:
Universal Authentication can be used between any two servers that can communicate with HTTP.
did:web:example.com:mike#friends
which indicates to communicate with the "friends" agent in the DID document at https://example.com/mike/did.json
.
{ "@context": [ "https://www.w3.org/ns/did/v1", "https://w3id.org/security/suites/jws-2020/v1", "https://agenticprofile.org/ns/agentic-profile/v1" ], "id": "did:web:iamagentic.ai:15", "name": "Mike Prince", "media": { "images": [ "512x512", "96x96" ] }, "verificationMethod": [], "service": [ { "id": "#connect", "name": "Connect", "type": "A2A/connect", "serviceEndpoint": "https://api.matchwise.ai/agents/connect", "capabilityInvocation": [ "did:web:api.matchwise.ai#system-key" ] }, { "id": "#presence", "name": "Presence", "type": "A2A/presence", "serviceEndpoint": "https://api.matchwise.ai/agents/presence", "capabilityInvocation": [ "did:web:api.matchwise.ai#system-key" ] } ] }
The above is a DID document for the individual/entity "Mike Prince" and has the following properties:
https://api.matchwise.ai/agents/connectdid:web:api.matchwise.ai#system-key
This
is a server optimization to minumize the number of keys to manage. Some agents may prefer to manage their own keys and
not allow the DID document host to authenticate on their behalf.https://iamagentic.ai/15/media
and of size 512x512 and 96x96An important take-away from using DID documents that describe multiple agents is that the DID for this document establishes a globally unique identifier that can be used to build reputation and trust.