Implementation:A9T9 RPA uivision mcp bridge
| Knowledge Sources | |
|---|---|
| Domains | MCP, WebSocket, JSON_RPC |
| Last Updated | 2026-10-22 00:00 GMT |
Overview
Concrete tool for bridging external MCP AI clients to the Ui.Vision extension via a local WebSocket server and JSON-RPC stdio protocol, provided by the Ui.Vision MCP bridge process.
Description
The uivision-mcp-bridge is a Node.js CLI process (`mcp/uivision-mcp-bridge.js`) that runs locally alongside the browser. It speaks two protocols:
- stdio (JSON-RPC 2.0): the MCP client side — Claude Code or Cursor communicates with the bridge via newline-delimited JSON-RPC over stdin/stdout
- WebSocket: the extension side — the bridge runs a local WebSocket server (default port 50888) that the Ui.Vision extension's `McpBridgeClient` connects to
The bridge relays tool calls from the MCP client to the extension and returns results. Key functions:
- `runSetup` / `registerWith`: register the bridge with Claude Code / Cursor config files via `npx uivision-mcp-bridge --setup`
- `callExtensionTool`: send a tool call to the active extension connection via WebSocket
- `executeTool`: validate and execute a tool call, forwarding to the extension
- `handleToolsCall` / `handleRpc`: parse incoming JSON-RPC requests and dispatch
The bridge supports tool-call cancellation, timeouts (per-tool), and multiple simultaneous browser connections.
Usage
Run `npx uivision-mcp-bridge --setup` to register the bridge with your MCP client config. The bridge process is started automatically by the MCP client (Claude Code / Cursor) when needed.
Code Reference
Source Location
- Repository: A9T9/RPA
- File: mcp/uivision-mcp-bridge.js
- Lines: L251-L290 (SETUP_TARGETS, serverEntry), L296-L338 (registerWith), L339-L396 (runSetup), L1195-L1228 (callExtensionTool), L1314-L1348 (executeTool), L1349-L1361 (handleToolsCall), L1380-L1450 (handleRpc)
Signature
// Setup
const runSetup = () => void
const registerWith = (target: SetupTarget) => { ok: boolean, text: string }
const serverEntry = () => { command: 'npx', args: string[] }
// Tool relay
const callExtensionTool = async (wsId, tool, args, who) => Promise<ToolResult>
const executeTool = async (name, args, cancelKey, who) => Promise<ToolResult>
const handleToolsCall = async (rpcId, params) => Promise<void>
const handleRpc = (msg) => void
Import
# CLI — no import; run via npx
npx uivision-mcp-bridge --setup
npx uivision-mcp-bridge --port 50888
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| --setup | flag | No | Register the bridge with detected MCP client configs |
| --port | number | No | WebSocket server port (default 50888) |
| tool | string | Yes | Tool name (run_macro, set_macro, browser_snapshot, etc.) |
| args | object | Yes | Tool arguments |
| JSON-RPC messages | string | Yes | Newline-delimited JSON-RPC 2.0 over stdio |
Outputs
| Name | Type | Description |
|---|---|---|
| ToolResult | object | Tool execution result (content array with text, isError flag) |
| JSON-RPC response | string | Newline-delimited JSON-RPC 2.0 response over stdio |
Usage Examples
Setup and Register
# Register the bridge with Claude Code and Cursor
npx uivision-mcp-bridge --setup
# Run on a custom port
npx uivision-mcp-bridge --port 50889
Tool Call Relay Flow
// The bridge receives a JSON-RPC tools/call from the MCP client:
// { "jsonrpc": "2.0", "id": 1, "method": "tools/call",
// "params": { "name": "run_macro", "arguments": {} } }
// handleRpc → handleToolsCall → executeTool → callExtensionTool
// The bridge forwards via WebSocket to the extension:
// { "type": "tool_call", "id": wsId, "tool": "run_macro", "args": {} }
// The extension executes and returns a result, which the bridge
// relays back as a JSON-RPC response over stdio.