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.abpto 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
- Use headless mode by default — switch to headful only when specific capabilities require a visible window (GPU, OAuth, etc.)
- Cache manifests to reduce network requests
- Route large data to files to prevent context bloat
- Handle errors gracefully with exponential backoff
- Clean up resources on disconnect