DOCUMENTATION

Developer Documentation

Setup guides and reference manual

Welcome to the MiraiLens developer documentation. MiraiLens is a local browser control layer mapping AI workflows (via the Model Context Protocol) to your real Chrome browser. Follow this guide to set up the MCP server and browser connector on your local machine.

System Requirements

Before running MiraiLens, ensure your local environment meets the following specifications:

  • Node.js: Node.js version 18.x or greater is required to run the local package daemon.
  • Browser: Google Chrome browser to install the MiraiLens Connector extension.
  • Port Availability: The local port 8080 must be available for local WebSocket loopback requests.

Setup & Installation Path

01Install & Start the MCP Server

Start the local MiraiLens MCP server daemon using standard Node toolchain commands. In your terminal, run:

$ npx mirailens@latest

* This initiates the local WebSocket server listening on port 8080.

02Install the MiraiLens Connector

Add the extension directly from the Chrome Web Store to establish the browser control interface:

* Developers building from source can load the unpacked extension in Chrome by enabling Developer Mode at chrome://extensions and selecting the unpacked extension directory.

03Connect the Extension to the Local MCP Server

Launch Google Chrome and click the MiraiLens Connector icon in your toolbar. Enter the local WebSocket address (default is ws://localhost:8080) and click Connect. The status indicator will glow green when connected.

04Connect an MCP-Compatible AI Client

Configure your preferred Model Context Protocol client (like Claude Desktop) to invoke the local server registry:

Claude Desktop config file (claude_desktop_config.json):
{
  "mcpServers": {
    "mirailens": {
      "command": "npx",
      "args": ["-y", "mirailens@latest"]
    }
  }
}

05Start a Browser-Control Session

Ask your AI agent to perform browser actions. The agent will formulate intent and request access. The local MCP server hands off instructions to the Chrome extension, which displays state changes in the browser dashboard interface.

06Human Takeover & Control Authority

Execution remains visible and interruptible. The human maintains final authority:

  • Takeover: Interacting with the browser immediately pauses/halts active AI operations.
  • Emergency Stop: Instantly aborts any active sequence and locks control states until a human-authorized reset is performed.