AI agents (MCP)
Mirage has an MCP server: an AI agent can open a profile, read pages, click and type, within rules you set for each profile. Every step is checked against the profile’s policy and written to the journal.
1. Prepare Mirage
- Agents → Connect: choose Connect agent apps. Mirage creates a key for AI agents on this computer and keeps it in its own data folder, readable by your user only. The key never goes into an agent’s settings. Disconnect revokes it at once.
- Agents → Policies: assign a policy to every profile the agent may use. A profile without a policy is closed to agents. That includes starting and stopping it: an agent’s key gets
403from the Local API (/profiles/{id}/start,/stop) and a refusal fromclose_profilewithstopuntil the profile has a policy. Keys for scripts are not affected.
Nothing else to install: Mirage itself is the MCP server.
2. Add Mirage to your client
The client starts Mirage’s own executable with --mcp. Agents → Connect shows the exact text with the path on your computer; copy it from there. If Mirage is not running, the agent starts it.
Typical paths: macOS /Applications/Mirage Browser.app/Contents/MacOS/Mirage Browser, Windows C:\Users\<you>\AppData\Local\Programs\Mirage Browser\Mirage Browser.exe, Linux the AppImage or /opt/Mirage Browser/mirage-browser.
Claude Desktop: in claude_desktop_config.json (Settings → Developer → Edit config):
{ "mcpServers": { "mirage": { "command": "/Applications/Mirage Browser.app/Contents/MacOS/Mirage Browser", "args": ["--mcp"] } }}Claude Code:
claude mcp add mirage -- "/Applications/Mirage Browser.app/Contents/MacOS/Mirage Browser" --mcpCursor: the same JSON as Claude Desktop, in ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (one project).
Codex: in ~/.codex/config.toml:
[mcp_servers.mirage]command = "/Applications/Mirage Browser.app/Contents/MacOS/Mirage Browser"args = ["--mcp"]Developers with the command line can use mirage mcp instead of the app’s path: it uses the same key for agent apps, or MIRAGE_API_KEY, or the key saved by mirage login.
Other clients with streamable HTTP can connect directly to http://127.0.0.1:<port>/mcp with the header Authorization: Bearer <key>, using a key for AI agents from Automation → API keys. Agents → Connect shows the address.
Restart the client. The first time it calls Mirage, the app asks “Cursor wants to connect to Mirage”: choose Allow or Block. The name is what the client says about itself. Until you answer, the agent waits up to 5 minutes and cannot use any tools. You can change your answer later in Agents → Connect.
What the agent can do
| Tool | Does |
|---|---|
list_profiles |
Profiles the key and policies allow |
open_profile, close_profile |
Open or close a profile |
tabs, navigate |
List, open and switch tabs, go to a page, back or forward |
snapshot, extract, screenshot |
Read the page |
scroll, wait_for |
Scroll by screens or to an element; wait until text appears or disappears (up to 30 s). Allowed under read-only policies too |
click, fill, press_key, select_option, hover |
Act on the page, if the policy lets the agent click and type. select_option picks dropdown options by value or label |
Clicks and typing move like a person: the cursor travels to each element along a curved path and keys come at uneven intervals, instead of jumping and typing at a machine-steady pace.
The agent keeps working in its own tab when you open or close other tabs. When a click opens a new tab, the agent is told about it and can switch to it; a tab on a site the policy does not allow is listed without its address.
Text from pages reaches the agent marked as untrusted content, so the agent can tell it apart from your instructions.
Policies
A policy is set per profile. Templates are copied, so editing one profile’s policy changes only that profile.
| Template | Clicks and typing | Risky actions | Protected mode |
|---|---|---|---|
| Careful | Yes | Ask, except downloads (allowed) and uploads and deletion (denied) | On |
| Read only | No | Denied | On |
| Full access | Yes | Allowed | Off |
In a policy you can also set:
- Allowed domains, one per line;
*.example.comincludes subdomains. Empty means every domain. Other domains: ask or deny. - Actions: allow, ask or deny for each kind of risky step: payment, credentials, sending messages, session export, app authorization, access grants, upload, download, delete.
- Limits for one agent session: Actions per minute, Session, minutes and Tabs.
Confirmations
When a step needs your answer, a card appears in Agents → Approvals with the action, the site and the agent’s stated goal. A allows and D declines the focused card; you can add a reason the agent will see. Allow such steps for 10 min skips the next similar cards.
Payments, credentials and access grants are confirmed one by one: there is no 10‑minute pass, and the button has to be held for a second. If nobody answers within 5 minutes, the step is declined.
Protected mode
An agent could try to get around the rules by making the page send a request itself. In protected mode, while an agent is attached, every request of the page that changes something (anything but GET) waits for you, unless you allowed it before.
The card shows the method, the host, the path without ids and, for known sites, the operation. On the ad and social platforms Mirage knows, reads pass without a card, while launching a campaign or changing a budget is always held. Always allow this request adds it to the profile’s Allowed requests, which you can clear in the policy editor.
Journal
Agents → Journal records every tool call of every agent: time, client, profile, tool, arguments and the decision, including steps the policy denied or the limit stopped.
If something goes wrong
| The agent says | Do |
|---|---|
| Mirage is not running | Open the app and turn on the Local API |
| The key lacks the mcp scope | Create a key for AI agent (MCP) and run mirage login again |
| The profile has no policy | Assign a policy in Agents → Policies |
| The user has not allowed this client | Allow it in Agents → Approvals or Agents → Connect |
| The user blocked the client | Allow it in Agents → Connect |