Skip to content

System Architecture

Architecture Overview

AAI Protocol Architecture

Core Design Principles

1. Abstract Descriptor

aai.json is a platform-agnostic descriptor that defines capabilities using JSON Schema. See aai.json Descriptor.

2. Two-Layer Authorization

Both layers authorize agent to access app, but protect different parties:

LayerInitiated ByProtects Against
Gateway ConsentGatewayMalicious apps exposing dangerous tools
App AuthorizationApp or OSAgent accessing app data without user knowledge

See Security Model for details.

3. Pluggable Executors

Gateway uses platform-specific executors:

PlatformTransportApp Authorization
macOSJSON over Apple EventsOperating System
LinuxJSON over DBusOperating System
WindowsJSON over COMOperating System
webJSON over HTTPSOAuth 2.1
local adaptersJSON over stdioAdapter-defined

4. Zero-Install Gateway

Gateway runs as a stdio MCP server — no daemon, no background service. It is spawned by the agent client (e.g. Claude Desktop) when needed.

Data Flow

Desktop apps:
1. Gateway startup     → scans /Applications for Bundle aai.json files
2. Agent → resources/list    → Gateway returns discovered desktop apps
3. Agent → resources/read    → Gateway returns app descriptor
4. Agent → tools/call        → Gateway checks consent → Apple Events → returns result

Local adapters:
1. Agent → tools/call        → Gateway checks consent → stdio JSON request → returns result

Web apps:
1. Agent → resources/read("https://notion.so")
           → Gateway fetches notion.so/.well-known/aai.json (cached locally)
           → returns descriptor
2. Agent → tools/call        → Gateway checks consent → OAuth → HTTPS → returns result

Separation of Concerns

LayerConcern
aai.jsonWhat the app can do (abstract, platform-agnostic)
GatewayDiscovery + User consent + How to call (platform-specific)
AppExecute the operation

Back to Protocol

Released under the Apache 2.0 License.