File size: 4,939 Bytes
6918275
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# A2A Server Setup

Agent Zero can communicate with other Agent Zero instances using the A2A (Agent-to-Agent) protocol based on FastA2A. This guide shows you how to enable and configure A2A connectivity through the Settings UI.

## What is A2A?

A2A enables direct communication between multiple Agent Zero instances. This allows:

- **Distributed workflows** - Delegate tasks to specialized agent instances
- **Context isolation** - Maintain separate workspaces for different agents
- **Long-running collaboration** - Persistent agent-to-agent conversations
- **Project-specific delegation** - Route work to agents with specific project contexts

> [!NOTE]
> This guide covers enabling Agent Zero as an A2A server. For API-level integration details, see the [advanced connectivity documentation](../developer/connectivity.md).

## Enabling the A2A Server

### Step 1: Open A2A Configuration

1. Click **Settings** in the sidebar
2. Navigate to the **MCP/A2A** tab
3. Scroll to the **A0 A2A Server** section
4. Toggle **Enable A2A server** to ON

![A2A Server Settings](../res/setup/a2a/a2a-conn.png)

### Step 2: Get Connection URL

1. Click on **connection example** to view your A2A connection details
2. The dialog displays:
   - **API Token** - Automatically generated from your username and password
   - **A2A Connection URL** - The full URL other agents will use to connect
   - Optional **Project selector** - To create project-specific connection URLs

![A2A Connection Dialog](../res/setup/a2a/a2a2.png)

### Step 3: Save Configuration

1. Click **Save** to apply your settings
2. The A2A server is now active and ready to accept connections

> [!IMPORTANT]
> The API token changes when you update your Agent Zero credentials. Existing connections will need to be reconfigured with the new token.

## Connection URL Format

The basic A2A connection URL follows this format:

```
http://YOUR_HOST:PORT/a2a/t-YOUR_API_TOKEN
```

### With Project Context

To connect with a specific project active:

```
http://YOUR_HOST:PORT/a2a/t-YOUR_API_TOKEN/p-PROJECT_NAME
```

When a project is specified:
- All A2A conversations run in that project's context
- The agent has access to project-specific resources and knowledge
- Enables isolated, project-focused agent collaboration

## Example Use Cases

### 1. Local Development Setup

Two Agent Zero instances on the same machine:

```
Instance 1: http://localhost:8080/a2a/t-abc123xyz
Instance 2: http://localhost:8081/a2a/t-def456uvw
```

### 2. Remote Agent Collaboration

Connect to a remote Agent Zero instance:

```
http://agent.example.com:8080/a2a/t-remote-token
```

### 3. Project-Specific Delegation

Main agent delegates frontend work to specialized agent:

```
http://localhost:8081/a2a/t-frontend-token/p-webapp-ui
```

## Docker Networking

If running Agent Zero in Docker:

- **Same Host:** Use `host.docker.internal:PORT` (macOS/Windows) or container networking (Linux)
- **Different Hosts:** Use the public IP or domain name of the target instance
- **Port Mapping:** Ensure the Agent Zero port is exposed in your Docker configuration

## Security Considerations

- **Token Protection:** Keep your API tokens secure - they provide full access to your Agent Zero instance
- **Network Access:** Consider using firewalls or reverse proxies to restrict A2A endpoint access
- **HTTPS:** For production deployments, use HTTPS to encrypt A2A communication
- **Credential Rotation:** Changing your password will invalidate all existing A2A connection URLs

## Testing Your Connection

You can test A2A connectivity using curl:

```bash
curl -X POST http://localhost:8080/a2a/t-YOUR_TOKEN \
  -H "Content-Type: application/json" \
  -d '{"message": "Hello from another agent"}'
```

## A2A vs MCP

| Feature | A2A | MCP |
|---------|-----|-----|
| **Purpose** | Agent-to-agent chat delegation | Tool/function access |
| **Use Case** | Long-running conversations | Specific tool calls |
| **Context** | Full chat context | Function parameters only |
| **Best For** | Workflow delegation | Tool integration |

> [!TIP]
> Use A2A when you need another agent's reasoning and conversation capabilities. Use MCP when you just need access to specific tools or functions.

## Troubleshooting

### Connection Refused

- Verify the A2A server is enabled in Settings
- Check that the Agent Zero instance is running
- Confirm the port is accessible (check firewall rules)

### Invalid Token

- Token may have changed due to credential updates
- Generate a new connection URL from Settings > MCP/A2A
- Update the connecting agent's configuration

### Project Not Found

- Verify the project name in the URL matches exactly
- Check that the project exists in the target instance
- Project names are case-sensitive

## Advanced Configuration

For detailed A2A protocol specifications, API examples, and integration patterns, see the [Advanced Connectivity Guide](../developer/connectivity.md).