Skip to main content

Overview

Making your web app ABP-compatible involves:
  1. Implementing window.abp — A JavaScript object with required methods
  2. Creating a manifest — A JSON file describing your app and capabilities
  3. Adding a manifest link — A <link> tag in your HTML head
  4. Testing — Verify everything works with the MCP Bridge
Effort estimate: 100-150 lines for initial ABP wrapper, 10-20 lines per capability.
For a comprehensive, step-by-step implementation process, see the ABP Implementation Guide. Read Common Pitfalls before shipping. Developers who skip these consistently produce implementations that fail silently when called by agents.

Prerequisites

  • Basic JavaScript/TypeScript knowledge
  • A web application you want to expose to AI agents
  • Node.js (for testing with the MCP Bridge)

Step-by-Step Implementation

1

Add Manifest Link to HTML

In your index.html (or template), add this to the <head>:
Key points:
  • Use rel="abp-manifest" exactly (case-sensitive)
  • href can be relative (/abp.json) or absolute (https://cdn.example.com/abp.json)
  • Place it in <head>, before or after other <link> tags
  • Framework users: The link must be in the server-rendered HTML. ABP clients discover the manifest via raw HTTP fetch (no JS execution), so a link injected via useEffect, onMounted, or similar hooks will never be found. Use your framework’s server-side metadata API instead. See the ABP Implementation Guide — Framework Environments for a framework-by-framework table.
2

Create the Manifest File

Create public/abp.json (or wherever your static files are served):
Key points:
  • abp: Protocol version (currently "1.0")
  • app.id: Reverse-domain notation (e.g., com.yourcompany.appname)
  • app.version: Semantic versioning
  • capabilities: Array of capabilities you expose
  • inputSchema: JSON Schema defining parameters
3

Implement window.abp

Create abp-runtime.js:
4

Load the Runtime

In your index.html, load the ABP runtime:
Important: Load abp-runtime.js early so window.abp is available when agents connect.
Framework users: window.abp must be assigned at module scope (top-level code that runs when the JS bundle executes), not inside lifecycle hooks like useEffect or onMounted. Lifecycle hooks run after framework hydration, which may be too late for ABP clients. Guard with typeof window !== 'undefined' for SSR safety. See the ABP Implementation Guide — Framework Environments for details.

Complete Example

Here’s a complete minimal ABP app:

File: public/index.html

File: public/abp.json

File: public/abp-runtime.js

(Use the code from Step 3 above)

Serve it

File: server.js (if using Express):

Testing Your Implementation

1. Manual Test

Open http://localhost:8000 in Chrome and open DevTools Console:

2. Test with MCP Bridge

3. Test Discovery

Common Patterns

Pattern: Multiple Capabilities

Pattern: Parameter Validation

Pattern: Progress Reporting

Pattern: Using Existing Libraries

Best Practices

For comprehensive guidance, see Common Pitfalls. The examples below are a quick overview.

1. Return Actual Data, Not Status Messages

See Common Pitfalls: Status Messages for why this matters.

2. Never Trigger Native UI

See Common Pitfalls: Native Browser UI for complete guidance.

3. Validate Inputs

Always validate against your inputSchema:

4. Handle Errors Gracefully

5. Keep Manifest in Sync

When you add/remove capabilities, update both:
  1. abp.json manifest
  2. window.abp.call() switch statement

Common Pitfalls

Pitfall 1: Manifest Not Served

Symptom: Discovery fails Cause: Manifest file not accessible Fix:

Pitfall 2: CORS Issues

Symptom: Manifest fetch fails from different origin Fix: Add CORS headers if manifest is on a different domain:

Pitfall 3: window.abp Not Available

Symptom: window.abp is undefined Fix:
  1. Vanilla HTML: Load abp-runtime.js before other scripts
  2. Framework apps (React, Next.js, Vue, etc.): Assign window.abp at module scope, not inside lifecycle hooks (useEffect, onMounted, etc.) — they run after hydration, which may be too late. See ABP Implementation Guide — Framework Environments for details.

Pitfall 4: Returning Promises Instead of Results

Pitfall 5: Not Handling Initialization State

Chrome Extensions

This guide covers web applications served at HTTP URLs. If you want to expose Chrome extension APIs (chrome.tabs, chrome.scripting, chrome.bookmarks, etc.) as ABP capabilities, see the dedicated Chrome Extension Guide. Key differences for extensions:
  • No <link rel="abp-manifest"> or abp.json needed — discovery is runtime-only
  • The ABP entry page is abp-app.html (loaded via chrome-extension://ID/abp-app.html)
  • Capabilities can call chrome.* APIs directly from window.abp.call()
  • Connect via abp_connect({ extensionPath: "/path/to/extension" }) instead of a URL

Next Steps

Implementation Guide

Self-contained guide with feature analysis, capability mapping, and validation checklist

Common Pitfalls

Critical implementation mistakes to avoid before shipping

Conformance Requirements

Verify your app is ABP-compliant

MCP Bridge Quick Start

Test with the MCP Bridge

Capability Taxonomy

Explore the capability namespace system

Protocol Overview

Read the full specification

App-Side Implementation

See advanced patterns

Examples & Tutorials

Working code examples

Additional Resources