Principle:AIPexStudio AIPex MCP Tool Relay
| Knowledge Sources | |
|---|---|
| Domains | MCP, AI_Agent_Integration |
| Last Updated | 2026-10-24 12:00 GMT |
Overview
A relay architecture that bridges AI agent IDEs to a browser extension's tool registry via a stdio MCP server and a WebSocket daemon, enabling remote tool execution.
Description
The Model Context Protocol (MCP) defines a standard for AI tools but assumes the tool server runs in the same process as the IDE. MCP Tool Relay extends this to a distributed architecture: a stdio MCP server (the bridge) runs in the IDE's process, auto-spawns a shared WebSocket daemon as a background process, and relays tool calls over WebSocket to the browser extension. The daemon supports multiple bridge clients simultaneously. On the extension side, a WebSocket client connects to the daemon, receives tool-call requests, and executes them using the browser's tool registry. This enables IDEs like Cursor, Claude Code, and VS Code Copilot to control a Chrome extension's browser automation tools.
Usage
Use this principle when external AI agents (IDEs, CLI tools) need to invoke browser automation tools running in a Chrome extension. It is the integration layer between MCP-compatible AI clients and browser-side capabilities.
Theoretical Basis
IDE ──stdio──▶ Bridge (MCP Server) ──WS /bridge──▶ Daemon ──WS /extension──▶ Extension
Bridge:
stdio MCP server, auto-spawns daemon if not running
ListTools → static toolSchemas (34 tools)
CallTool → JSON-RPC relay to daemon → response
Daemon:
WebSocket server, two endpoints (/bridge, /extension)
Multi-client, routes messages between bridge and extension
Extension:
WsMcpServer connects as WS client to daemon
findBrowserTool(name) → tool.invoke(result) → buildMcpContent()