# vbcherepanov/a2abridge architecture

> Architecture diagram of the GitHub repository vbcherepanov/a2abridge, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vbcherepanov/a2abridge
- Repository: https://github.com/vbcherepanov/a2abridge

## Overview

a2abridge turns local or federated AI coding agents into A2A peers. An IDE’s MCP client invokes bridge tools to discover peers, send or stream tasks, and retrieve replies; incoming messages enter an inbox that the IDE can drain or answer. Each bridge also serves an A2A HTTP surface, advertises its Agent Card, and optionally registers for discovery or webhook push. The graph includes installation and persistent-directory capabilities documented in the README; some links to unsampled subsystems are therefore documented rather than source-verified.

Main entry points: [`internal/cli/bridge.go`](https://github.com/vbcherepanov/a2abridge/blob/main/internal/cli/bridge.go) (Bridge assembly), [`internal/agent/store.go`](https://github.com/vbcherepanov/a2abridge/blob/main/internal/agent/store.go) (Inbox and tasks), [`internal/agent/mcp.go`](https://github.com/vbcherepanov/a2abridge/blob/main/internal/agent/mcp.go) (MCP tools), [`internal/agent/server.go`](https://github.com/vbcherepanov/a2abridge/blob/main/internal/agent/server.go) (A2A HTTP surface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Bridge runtime"]
  node_cli["Command entry<br/>[main.go]"]
  node_bridge["Bridge assembly<br/>[bridge.go]"]
  node_http["A2A HTTP surface<br/>[server.go]"]
end

subgraph group_agent["Agent workflow"]
  node_mcp["MCP tools<br/>[mcp.go]"]
  node_store[("Inbox and tasks<br/>[store.go]")]
  node_executor["Task executor<br/>[executor.go]"]
  node_responder["Auto responder<br/>[responder.go]"]
  node_nudger["Prompt nudger<br/>[nudger.go]"]
  node_hooks["User hooks<br/>[userhooks.go]"]
  node_push["Webhook push<br/>[push.go]"]
end

subgraph group_discovery["Peer discovery"]
  node_directory[("Local directory<br/>[registry.go]")]
  node_peers["Peer clients<br/>[peers.go]"]
  node_mdns["mDNS discovery<br/>[mdns.go]"]
end

subgraph group_operations["Setup and operations"]
  node_install["IDE configuration<br/>[install.go]"]
  node_ideconfig["Config writers"]
  node_service["Directory service<br/>[service.go]"]
end

node_ide(("IDE / MCP client"))
node_remote(("A2A peer"))

node_ide -->|"invokes tools"| node_mcp
node_cli -->|"dispatches"| node_bridge
node_bridge -->|"registers tools"| node_mcp
node_bridge -->|"assembles server"| node_http
node_bridge -->|"configures inbox"| node_store
node_bridge -.->|"registers peers"| node_directory
node_bridge -->|"publishes optionally"| node_mdns
node_mcp -->|"resolves peers"| node_peers
node_mcp -->|"reads and updates"| node_store
node_mcp -->|"sends A2A tasks"| node_remote
node_http -->|"dispatches tasks"| node_executor
node_http -->|"stores tasks"| node_store
node_http -->|"configures notifications"| node_push
node_store -->|"fires inbox hooks"| node_hooks
node_responder -->|"handles incoming"| node_store
node_nudger -.->|"delivers prompts"| node_store
node_push -->|"posts webhooks"| node_remote
node_directory -.->|"lists peer URLs"| node_peers
node_service -.->|"runs daemon"| node_directory
node_install -->|"writes IDE settings"| node_ideconfig

click node_cli "https://github.com/vbcherepanov/a2abridge/blob/main/cmd/a2abridge/main.go"
click node_bridge "https://github.com/vbcherepanov/a2abridge/blob/main/internal/cli/bridge.go"
click node_http "https://github.com/vbcherepanov/a2abridge/blob/main/internal/agent/server.go"
click node_mcp "https://github.com/vbcherepanov/a2abridge/blob/main/internal/agent/mcp.go"
click node_store "https://github.com/vbcherepanov/a2abridge/blob/main/internal/agent/store.go"
click node_executor "https://github.com/vbcherepanov/a2abridge/blob/main/internal/agent/executor.go"
click node_responder "https://github.com/vbcherepanov/a2abridge/blob/main/internal/agent/responder.go"
click node_nudger "https://github.com/vbcherepanov/a2abridge/blob/main/internal/agent/nudger.go"
click node_hooks "https://github.com/vbcherepanov/a2abridge/blob/main/internal/agent/userhooks.go"
click node_push "https://github.com/vbcherepanov/a2abridge/blob/main/internal/agent/push.go"
click node_directory "https://github.com/vbcherepanov/a2abridge/blob/main/internal/directory/registry.go"
click node_peers "https://github.com/vbcherepanov/a2abridge/blob/main/internal/agent/peers.go"
click node_mdns "https://github.com/vbcherepanov/a2abridge/blob/main/internal/mdns/mdns.go"
click node_install "https://github.com/vbcherepanov/a2abridge/blob/main/internal/cli/install.go"
click node_ideconfig "https://github.com/vbcherepanov/a2abridge/tree/main/internal/ideconfig"
click node_service "https://github.com/vbcherepanov/a2abridge/blob/main/internal/cli/service.go"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_bridge,node_http,node_ide toneBlue
class node_mcp,node_store,node_executor,node_responder,node_nudger,node_hooks,node_push toneAmber
class node_directory,node_peers,node_mdns toneMint
class node_install,node_ideconfig,node_service toneRose
class node_remote toneIndigo
```

## Components

### Bridge runtime

- [Command entry](https://github.com/vbcherepanov/a2abridge/blob/main/cmd/a2abridge/main.go): `cmd/a2abridge/main.go`
- [Bridge assembly](https://github.com/vbcherepanov/a2abridge/blob/main/internal/cli/bridge.go): `internal/cli/bridge.go`
- [A2A HTTP surface](https://github.com/vbcherepanov/a2abridge/blob/main/internal/agent/server.go): `internal/agent/server.go`

### Agent workflow

- [MCP tools](https://github.com/vbcherepanov/a2abridge/blob/main/internal/agent/mcp.go): `internal/agent/mcp.go`
- [Inbox and tasks](https://github.com/vbcherepanov/a2abridge/blob/main/internal/agent/store.go): `internal/agent/store.go`
- [Task executor](https://github.com/vbcherepanov/a2abridge/blob/main/internal/agent/executor.go): `internal/agent/executor.go`
- [Auto responder](https://github.com/vbcherepanov/a2abridge/blob/main/internal/agent/responder.go): `internal/agent/responder.go`
- [Prompt nudger](https://github.com/vbcherepanov/a2abridge/blob/main/internal/agent/nudger.go): `internal/agent/nudger.go`
- [User hooks](https://github.com/vbcherepanov/a2abridge/blob/main/internal/agent/userhooks.go): `internal/agent/userhooks.go`
- [Webhook push](https://github.com/vbcherepanov/a2abridge/blob/main/internal/agent/push.go): `internal/agent/push.go`

### Peer discovery

- [Local directory](https://github.com/vbcherepanov/a2abridge/blob/main/internal/directory/registry.go): `internal/directory/registry.go`
- [Peer clients](https://github.com/vbcherepanov/a2abridge/blob/main/internal/agent/peers.go): `internal/agent/peers.go`
- [mDNS discovery](https://github.com/vbcherepanov/a2abridge/blob/main/internal/mdns/mdns.go): `internal/mdns/mdns.go`

### Setup and operations

- [IDE configuration](https://github.com/vbcherepanov/a2abridge/blob/main/internal/cli/install.go): `internal/cli/install.go`
- [Config writers](https://github.com/vbcherepanov/a2abridge/tree/main/internal/ideconfig): `internal/ideconfig`
- [Directory service](https://github.com/vbcherepanov/a2abridge/blob/main/internal/cli/service.go): `internal/cli/service.go`

### Other components

- **IDE / MCP client**
- **A2A peer**

## Connections

- IDE / MCP client → MCP tools: invokes tools (evidence: `README.md`)
- Command entry → Bridge assembly: dispatches (evidence: `cmd/a2abridge/main.go`)
- Bridge assembly → MCP tools: registers tools (evidence: `internal/cli/bridge.go`)
- Bridge assembly → A2A HTTP surface: assembles server (evidence: `internal/cli/bridge.go`)
- Bridge assembly → Inbox and tasks: configures inbox (evidence: `internal/cli/bridge.go`)
- Bridge assembly → Local directory: registers peers (evidence: `README.md`)
- Bridge assembly → mDNS discovery: publishes optionally (evidence: `internal/cli/bridge.go`)
- MCP tools → Peer clients: resolves peers (evidence: `internal/agent/mcp.go`)
- MCP tools → Inbox and tasks: reads and updates (evidence: `internal/agent/mcp.go`)
- MCP tools → A2A peer: sends A2A tasks (evidence: `README.md`)
- A2A HTTP surface → Task executor: dispatches tasks (evidence: `internal/agent/server.go`)
- A2A HTTP surface → Inbox and tasks: stores tasks (evidence: `internal/agent/server.go`)
- A2A HTTP surface → Webhook push: configures notifications (evidence: `internal/agent/server.go`)
- Inbox and tasks → User hooks: fires inbox hooks (evidence: `internal/agent/store.go`)
- Auto responder → Inbox and tasks: handles incoming
- Prompt nudger → Inbox and tasks: delivers prompts
- Webhook push → A2A peer: posts webhooks (evidence: `internal/agent/push.go`)
- Local directory → Peer clients: lists peer URLs (evidence: `README.md`)
- Directory service → Local directory: runs daemon (evidence: `README.md`)
- IDE configuration → Config writers: writes IDE settings (evidence: `internal/cli/install.go`)
