Skip to main content
Guide for building ABP clients in any language or environment.
For a reference implementation, see the ABP MCP Bridge Architecture.

Overview

ABP clients connect AI agents to ABP-compliant web applications. They handle:
  • Discovery (fetching manifests)
  • Browser management
  • Session lifecycle
  • Data flow optimization
  • Bidirectional communication

Client Architecture

Implementation Checklist

1. Discovery

  • Fetch HTML head (streaming recommended)
  • Parse <link rel="abp-manifest"> tag
  • Fetch manifest JSON
  • Validate manifest structure
  • Cache manifests (with TTL)

2. Browser Management

  • Launch browser (headless by default; use headful for capabilities needing a visible window)
  • Navigate to app URL
  • Wait for window.abp to be available
  • Set up event handlers (__abp_notification, __abp_progress, __abp_elicitation)
  • Handle browser crashes/disconnects

3. Session Management

  • Call window.abp.initialize()
  • Store session ID
  • Track session state
  • Handle session expiration
  • Call window.abp.shutdown() on disconnect

4. Capability Calls

  • Validate parameters against schemas
  • Call window.abp.call()
  • Handle ABPResponse
  • Retry on retryable errors
  • Support cancellation

5. Data Flow

  • Detect binary data (Base64, MIME types)
  • Route all outputs to files
  • Return file paths to the agent (agent reads on demand)
  • Clean up temporary files

6. Bidirectional Communication

  • Handle notifications
  • Handle progress updates
  • Handle elicitation requests
  • Handle capability changes

Reference: MCP Bridge

The ABP MCP Bridge is a complete reference implementation. Key files:

Example: Python Client (Conceptual)

Best Practices

  1. Use headless mode by default — switch to headful only when specific capabilities require a visible window (GPU, OAuth, etc.)
  2. Cache manifests to reduce network requests
  3. Route large data to files to prevent context bloat
  4. Handle errors gracefully with exponential backoff
  5. Clean up resources on disconnect

Next Steps

MCP Bridge Architecture

Study the reference implementation

Protocol Overview

Complete protocol details