What is the MCP Bridge?
The ABP MCP Bridge is a generic MCP server that:- Connects to any ABP-compliant web application
- Discovers and exposes its capabilities as MCP tools
- Manages browser lifecycle automatically
- Routes data efficiently (large outputs to files)
- Handles all ABP protocol complexity
Prerequisites
- Node.js 18+ and npm
- Claude Code or another MCP-compatible agent
- Chrome/Chromium (installed automatically by Puppeteer if missing)
Installation
Configuration
Option 1: Per-Project Configuration (Recommended)
Create.mcp.json in your project root:
/absolute/path/to/abp-mcp-bridge with the actual path.
Example:
Option 2: Global Configuration
Edit~/.claude/config.json:
Option 3: Environment-Specific Path
Use an environment variable:First Connection
Connect to an ABP App
- Discover the app’s ABP manifest
- Launch a browser (headless by default — set
ABP_HEADLESS=falseto see the window) - Load the app
- Initialize an ABP session
- Expose the app’s capabilities as MCP tools
See New Tools
After connection, you’ll see dynamic tools:Naming convention:
- ABP capability:
convert.markdownToHtml - MCP tool:
abp_convert_markdownToHtml
abp_)Not all MCP clients support dynamic tool registration reliably. Claude Code, for instance, may not expose dynamically registered tools to the LLM. If dynamic tools don’t appear, use
abp_call instead — it can invoke any capability and is always available. See Limitations and Known Issues for details.Using ABP Capabilities
Using abp_call (Recommended)
abp_call is the primary tool for executing any capability. It works regardless of whether dynamic tools are available.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
capability | string | Yes | ABP capability name in dot notation exactly as listed by abp_connect or abp_status (e.g., convert.markdownToHtml) |
params | object | No | Parameters for the capability. Defaults to {}. Check abp_connect or abp_status output for required params and types. |
Example: Convert Markdown to HTML
- Claude Code calls
abp_call - Bridge calls
window.abp.call('convert.markdownToHtml', { markdown: "..." }) - App processes the markdown
- Bridge returns the HTML result
- Claude Code sees the output
Example: Generate PDF
- Bridge calls the PDF capability
- App generates PDF (may take a few seconds)
- Bridge saves PDF to a file (automatically, because it’s binary)
- Claude Code receives a file path like
/tmp/abp-mcp-bridge/export_pdf_1707234567890.pdf
Example: Check Status
Example: Disconnect
- Bridge calls
window.abp.shutdown() - Browser closes
- Dynamic tools disappear
- Back to static tools only
Configuration Options
Headful Mode
By default, the bridge uses headless mode. SetABP_HEADLESS=false for headful (visible browser) when you need:
- User sessions (needs user’s profile)
- GPU/WebGL (requires hardware access)
- Permission prompts (needs a user to click “Allow”)
- Visual debugging
abp_render_to_pdf which works in both modes.
Environment Variables
The bridge supports these environment variables:| Variable | Default | Description |
|---|---|---|
ABP_OUTPUT_DIR | <os.tmpdir()>/abp-mcp-bridge | Directory where output files (PDFs, images, JSON results) are saved. Created automatically. |
ABP_HEADLESS | true | Set to false for headful (visible) mode. Headful is needed for capabilities requiring a visible browser window (authenticated sessions, GPU, permissions). |
ABP_BROWSER_TIMEOUT | 30000 | Timeout in milliseconds for browser launch and page navigation. |
ABP_CALL_TIMEOUT | 60000 | Default timeout in milliseconds for individual capability calls. |
ABP_DOWNLOAD_TIMEOUT | 30000 | Maximum time in milliseconds to wait for browser-initiated downloads. |
ABP_LOG_LEVEL | info | Minimum log level. One of: debug, info, warn, error. All logs go to stderr. |
Troubleshooting
Browser Doesn’t Launch
Symptom:abp_connect fails with “Failed to launch browser”
Solutions:
- Check Chrome/Chromium is installed:
- Puppeteer should auto-install Chrome. If not:
- Check permissions (macOS may block automated browsers):
- System Settings -> Privacy & Security -> Automation
- Allow Terminal/your IDE to control Chrome
Connection Fails
Symptom:abp_connect returns “No ABP manifest found”
Cause: The app doesn’t support ABP or the manifest link is missing.
Solutions:
- Verify the URL is correct
- Check the app’s HTML has:
- Manually fetch the manifest:
Tools Don’t Appear After Connection
Symptom:abp_connect succeeds but no dynamic tools appear
Cause: Session initialization failed or no capabilities are available.
Solutions:
- Check
abp_status()— isconnected: true? - Look at the terminal running Claude Code for error messages
- Enable debug logging:
- Check browser console (in the visible Chrome window)
Large Outputs Not Saved
Symptom: Binary data returned inline instead of as a file Cause: Output routing rules may need adjustment. Solutions:- Check output directory exists and is writable:
- Set custom output directory:
- Check file was created:
Capabilities Fail with Permission Errors
Symptom: A capability returns “Permission denied” Cause: Browser lacks necessary permissions (usually in headless mode). Solutions:- Use headful mode (default)
- Ensure the browser window has focus
- Check browser permissions:
- Chrome -> Settings -> Privacy and security -> Site Settings -> Permissions
Browser Crashes or Freezes
Symptom: Browser window becomes unresponsive Solutions:- Disconnect and reconnect:
- Restart Claude Code
- Check system resources (RAM, CPU)
- Reduce concurrent operations
Logs Not Visible
Symptom: Can’t see what the bridge is doing Solutions:- Check stderr (where MCP servers log):
- In Claude Code, logs appear in the debug console
- Enable debug logging:
- Run the bridge manually for testing:
Next Steps
Building ABP Web Apps
Build your own ABP-compatible app
MCP Bridge Architecture
Understand the bridge internals
Data Flow
Understand the data routing logic
Protocol Overview
Full ABP specification