Skip to content

anivar/mozilla-ai-protocol-bridge

Repository files navigation

MCP-ACP Bridge Demo

Working implementation of a bridge that lets MCP tools work with ACP's REST API.

📖 Read the Vision - Protocol interoperability with identity support

What This Is

A proof-of-concept showing:

  • MCP tools accessible via REST endpoints
  • Identity configuration field (stored but not used)
  • Working examples you can run
  • Advanced HTTP features: Connection pooling, custom headers, HTTP/2 support via httpx

Quick Start

# Install
pip install -r requirements.txt

# Run basic demo
python examples/basic_demo.py

# Run with identity simulation
python examples/mcpd_integration_demo.py

# Run mcpd REST API demo (agent-factory approach)
python examples/mcpd_rest_demo.py

How It Works

MCP Tools → Bridge → ACP REST API

The bridge translates MCP tool calls to ACP endpoints:

  • GET /agents - List available tools
  • POST /runs/stateless - Execute a tool

Example Usage

from bridge.config_acp import MCPToACPBridgeConfig
from bridge.server_acp import serve_mcp_as_acp_async

# Configure bridge
config = MCPToACPBridgeConfig(
    mcp_command="uvx",
    mcp_args=["mcp-server-filesystem"],
    port=8090
)

# Start it
await serve_mcp_as_acp_async(config)

Now MCP tools are available at http://localhost:8090.

With Identity

If you're using mcpd with identity:

config = MCPToACPBridgeConfig(
    mcp_command="mcpd",
    mcp_args=["run", "my-server"],
    identity_id="did:agntcy:mcpd:org:server",
    port=8090
)

The identity string is stored in config only.

With Advanced HTTP Client

Configure custom httpx client for connection pooling and performance:

import httpx

# Create custom httpx client
http_client = httpx.AsyncClient(
    limits=httpx.Limits(max_keepalive_connections=20, max_connections=50),
    timeout=httpx.Timeout(connect=10.0, read=30.0),
    http2=True,  # Enable HTTP/2
    headers={"X-Bridge-Version": "1.0.0"}
)

config = MCPToACPBridgeConfig(
    mcp_command="uvx",
    mcp_args=["mcp-server-filesystem"],
    http_client=http_client,  # Pass custom client
    port=8090
)

This enables connection reuse, custom timeouts, and better performance.

Related Work

Core Protocol Bridges

Identity & Infrastructure

Agent Improvements

Performance & HTTP Enhancements

📖 Full Contribution List - See all 22+ PRs across Mozilla AI and AGNTCY

License

MIT EOF < /dev/null

About

MCP-ACP Bridge: Completing the Protocol Triangle for Mozilla AI ecosystem interoperability

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages