Working implementation of a bridge that lets MCP tools work with ACP's REST API.
📖 Read the Vision - Protocol interoperability with identity support
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
# 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
MCP Tools → Bridge → ACP REST API
The bridge translates MCP tool calls to ACP endpoints:
GET /agents
- List available toolsPOST /runs/stateless
- Execute a tool
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
.
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.
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.
- any-agent PR #757: MCP-to-A2A bridge
- any-agent PR #774: MCP-to-ACP bridge
- mcpd PR #154: Identity key generation (headers not implemented)
- agent-factory PR #310: MCPStdio to mcpd migration
- any-agent PR #763: Reasoning tokens support
- any-agent PR #762: Tool error schemas
- any-llm PR #254: httpx client support (rejected, now in bridges)
📖 Full Contribution List - See all 22+ PRs across Mozilla AI and AGNTCY
MIT EOF < /dev/null