Skip to content

Automation overview

Everything you can automate in Mirage goes through the Local API: a small HTTP server the app runs on 127.0.0.1 while it is open. Scripts, the mirage command line and AI agents all use it. Nothing is reachable from other computers or from web pages.

You want to Use
Write a script that opens profiles and works with Playwright SDK for TypeScript or Python
Start, stop and list profiles from a terminal or a shell script Command line mirage
Let Claude, Cursor, Codex or your own agent work in a profile AI agents (MCP)
Repeat a task in a profile without writing code Scenarios without code
Send events to n8n, Make, Zapier or your server Webhooks
Build a workflow in n8n, Make or Zapier around Mirage n8n, Make and Zapier
Get a Telegram message and decide an agent’s step from the chat Telegram bot
Say in plain words what to do in a profile, with your own Anthropic key Assistant
Work with cloud profiles from a server while the app is closed Cloud access for scripts
Run profiles on a Linux server or in Docker, without the app Headless runner and Docker
Keep a script written for Dolphin Anty Move a script from Dolphin Anty
Call the HTTP API yourself Local API reference

1. Turn on the Local API

Open Automation in Mirage. The Local API card shows whether it is on and its address, for example http://127.0.0.1:52817.

By default the port is random and changes when the app restarts. The SDKs and the CLI find it on their own: the app writes the address to a file only your user can read. If another tool needs a fixed address, set Fixed port (1024–65535).

2. Create an API key

Under API keys, choose Create key:

  • For: Scripts and SDK for code and the CLI, AI agent (MCP) for agents.
  • Permissions: only what the key needs.
  • Profiles: all profiles or only the ones you pick. A key never sees other profiles.
Permission Allows
See profiles List and read profiles
Create and edit profiles Create, rename and delete profiles, change notes, status, proxy, folder and tags, import and export cookies
Start and stop profiles Open and close profiles, connect Playwright
See proxies List proxies (passwords are never returned)
Change proxies Add, import, check and delete proxies
AI agent tools (MCP) Connect an AI agent

The key is shown once; Mirage keeps only its hash. Pass it as the MIRAGE_API_KEY environment variable or save it with mirage login. Revoke stops every script and agent using it at once.

Playwright version

A profile accepts one minor version of Playwright, the one shown in the quick start (currently 1.63). The SDKs check it before connecting, and mirage playwright install installs the right one.

Limits

How many profiles can run under automation at the same time depends on your plan. When the limit is reached, starting another profile with automation fails with automation_limit_reached; stop a profile or wait.