Controlled browser interaction
for AI agents.
MiraiLens is the control layer between AI agents and the real browser — keeping execution observable, interruptible, and subject to human authority.
AI can request an action. MiraiLens controls whether the action is permitted. The human can take control at any time.
A control layer between AI intent and browser execution.
AI intent passes through MiraiLens before reaching the browser. The extension maintains the authoritative control state, can interrupt active execution, detects human takeover, and prevents an MCP client or AI agent from overriding human-held control.
Control relationship
AI requests control. MiraiLens evaluates and executes permitted actions. The human retains the ability to interrupt and take control.
AI Agent
Issues intent
MCP Client
Model Context Protocol
MiraiLens MCP Server
npx mirailens@latest
MiraiLens Connector
Authoritative control layer
Real Chrome Browser
Live session
Web Page
Execution target
AI Agent
Issues intent
MCP Client
Model Context Protocol
MiraiLens MCP Server
npx mirailens@latest
MiraiLens Connector
Authoritative control layer
Real Chrome Browser
Live session
Web Page
Execution target
node 03 is the authoritative control gate
The extension is authoritative over browser control.
The AI can request control. MiraiLens decides whether the action is permitted. The human always has the final authority.
- A human can explicitly take control.
- Trusted human interaction can trigger implicit takeover.
- Active AI execution is aborted when takeover occurs.
- Emergency stop blocks further AI execution.
- An MCP client cannot spoof human authority through a WebSocket message.
- Human-held control cannot be forcibly overridden by the AI.
- Emergency-stop state persists across extension reloads.
Control state machine
AI Control ↔ Human Takeover ↔ Human Control
Exposes browser automation to MCP-compatible clients.
The MiraiLens MCP server enables AI assistants to control and observe web browsers through high-level browser automation tools.
- Package
- mirailens
- Registry
- npm
- Runtime
- Node.js
- Protocol
- Model Context Protocol
- Browser
- Chrome / Chromium
Capabilities
MiraiLens Connector
Connects the MiraiLens MCP server to an active Chrome browser session. The extension is the authoritative browser-side control layer — presented as infrastructure, not as an AI assistant.
Responsibilities
- 01Connect the browser to the MCP server
- 02Maintain browser-control state
- 03Execute authorized browser actions
- 04Monitor connection health
- 05Detect trusted human interaction
- 06Allow explicit human takeover
- 07Return control to the agent when authorized
- 08Abort active execution
- 09Provide emergency stop
- 10Persist safety-critical control state
- 11Prevent unauthorized agent control transitions
Designed around controlled execution.
Control transitions are extension-authoritative. The MCP server mirrors browser control state but cannot override a state owned by the human.
- A browser navigation API call that has already started cannot always be physically aborted midway.
- Implicit takeover currently focuses on trusted mouse and keyboard interaction.
- Additional interaction types may require future refinement.
Safety mechanisms
Reproducible, state-machine tested.
State machine tests
12/12
passing
- Security before convenience
- Human authority over automation
- Deterministic control transitions
- Explicit state
- Fail-safe behavior
- Observable execution
- Reproducible testing
- Minimal UI
Test coverage
- Normal agent execution
- Emergency stop
- Implicit human takeover
- Unrelated-tab validation
- AI resume spoofing
- Emergency-stop persistence
- AI versus human pause behavior
- Concurrent action protection
- WebSocket disconnect safety
- Connected-tab closure
- Heartbeat behavior
- Control-state transitions
Repository infrastructure
- GitHub Actions CI
- Extension build validation
- Dependency security auditing
- CodeQL analysis
- Dependabot
- Issue templates
- Security reporting workflow
- Pull request template
- CODEOWNERS
- Automated extension packaging
Permissions exist to serve one purpose.
MiraiLens connects AI agents to Chrome through MCP, enabling controlled browser interaction while allowing you to monitor agent activity, take control of the browser, and stop execution when needed. It does not use remote executable JavaScript or WebAssembly — extension code ships packaged with the extension.
- No sale of user data.
- No use of user data for unrelated purposes.
- No use of user data for creditworthiness or lending decisions.
- Browser permissions exist to provide core control functionality — not to independently collect data.
Permission justification
scripting
Enables authorized browser interactions on the active page — interacting with elements and executing supported browser actions.
tabs
Identifies and manages the tab associated with an active session, and safely handles events like tab closure mid-session.
activeTab
Accesses the tab the user is actively controlling or has authorized for a session, required for core control functionality.
storage
Persists configuration and control-state information so control stays safe across extension and browser lifecycle events.
alarms
Runs periodic heartbeat checks between the extension and MCP server to detect stale connections.
host_permissions
Grants access to web pages, required for the MCP-connected agent to perform authorized interactions.
Built in the open. Available under the MiraiLens Community License.
MiraiLens is developed publicly on GitHub. Documentation prioritizes clear installation, transparent architecture, and honest limitations over marketing language.