Overview
The WebRun MCP (Model Context Protocol) server gives AI assistants browser automation through their native tool interfaces. It exposes 21 tools covering one-off tasks, persistent sessions, live task control, saved workflows, and scheduled agents, with session lifecycle handling and streaming for long-running tasks.This is the full reference for the MCP server. For a quickstart guide, see MCP Quickstart.
Configuration
Every client uses the same server URL:Connect with OAuth (Claude and ChatGPT)
No API key needed. In Claude or ChatGPT, open Settings → Connectors → Add custom connector, pastehttps://api.webrun.ai/mcp, and authorize from WebRun when prompted.
If you have more than one environment, the one you pick during authorization becomes the connection’s default.
Claude Code
--header is repeatable — that is how both values are passed in one command.
Or, to share the connection with a project, add this to .mcp.json at the repo root:
Environment-Id line to get a fresh disposable machine for every task.
${WEBRUN_API_KEY} is expanded from your environment when the file loads, so the file is safe to commit. The environment ID is not a secret and can stay inline.
Cursor
~/.cursor/mcp.json, or .cursor/mcp.json inside a project:
Environment-Id line to get a fresh disposable machine for every task.
Cursor does not use a type field for remote servers, and its variable syntax is ${env:NAME}.
Claude Desktop
Claude Desktop’s configuration file only supports local (stdio) servers, so connect through Settings → Connectors using the OAuth flow above — no key, no file editing, and you choose the environment during authorization. If you must use the config file, bridge it withmcp-remote:
--header pair to get a fresh disposable machine for every task.
The headers are written without a space after the colon on purpose —
mcp-remote splits --header arguments on spaces.VS Code
.vscode/mcp.json — note the top-level key is servers, not mcpServers:
Environment-Id line to get a fresh disposable machine for every task.
VS Code prompts for the key on first use and stores it securely rather than in the file.
Cline
Open the Cline panel, use the menu in its top-right corner, choose MCP Servers, and editcline_mcp_settings.json:
Environment-Id line to get a fresh disposable machine for every task.
Cline does not expand environment variables in this file, so the key goes in literally — keep the file out of version control.
Environments
An environment is a complete persistent remote machine. It maintains its own Chrome browser, file manager, and desktop state across sessions, so browser profiles, downloaded files, cookies, and any other local state are preserved between tasks and you can pick up exactly where you left off. TheEnvironment-Id header is optional. Both ways of running are fully supported:
Leaving the header out is a normal configuration, not a broken one. Omit it when every task should start from a clean slate, and add an environment when you need the browser to remember something — a logged-in account, a downloaded file, an installed extension.
Where to find the ID: ask the assistant to list your environments, or copy it from the Environment page in the dashboard. It is a 24-character hex string, and it is not a secret — it is safe to commit.
Three ways to choose one:
The per-task argument means you can keep one connection and still send one task to your logged-in shopping profile and the next to a clean machine.
Full Tool Reference
browser_task
Execute a single browser automation task. Creates a session, runs the task, and auto-terminates. When to use:- One-off research tasks
- Quick data extraction
- Simple automations that don’t require follow-up
Example Usage:
create_session
Create a persistent browser session for multi-step workflows. Returns asessionId for subsequent commands.
When to use:
- Multi-step automations (search → click → extract)
- Tasks requiring context from previous steps
- When you need to send multiple commands to the same browser
The nested
task object accepts prompt, startingUrl, maxDuration (minutes), outputType, outputSchema, files, secrets, terminateOnCompletion, and webhook.
Example Usage:
send_task
Send a new task to an existing session. When to use:- Follow-up actions in a multi-step workflow
- Continuing work in an existing browser session
- Chaining related tasks together
Example Usage:
get_task_status
Check the status of a running task. Read-only — it reports on the task without affecting it. When to use:- Monitoring long-running tasks
- Detecting when a guardrail needs an answer
- Checking if a task completed while doing other work
Response (still running):
screenshot
Capture the current browser page of an active session and return it as an inline image. Read-only. When to use:- Seeing what the agent sees before deciding the next step
- Confirming a page loaded as expected
- Debugging a task that is behaving unexpectedly
list_sessions
List all active browser sessions for the account. Read-only. Takes no parameters.terminate_session
End a session and free its resources. Parameters:pause_session_task
Pause the task currently running in a session. Resume it later withresume_session_task.
Parameters: sessionId (string, required).
resume_session_task
Resume a previously paused task. Parameters:sessionId (string, required).
stop_session_task
Cancel the task currently running, keeping the session alive for new tasks. Parameters:sessionId (string, required).
guardrail_response
Respond when the browser agent needs human input — credentials, a CAPTCHA or 2FA prompt, a clarification, or an approval. The response is handed to the live agent, which continues acting on it. Parameters:
Example Usage:
MCP has no manual-takeover tool. For hands-on control of the browser — clicking and typing yourself — use the REST or WebSocket manual interaction actions alongside the video stream.
list_environments
List available persistent environments for the account and show which one the connection is using. Read-only. Takes no parameters. Use it to find theenvironmentId for a persistent session. Workflows and agents use the connection’s environment automatically.
list_workflows
List saved workflows — prompt-templated browser automations — with each one’s title, schedule,{{variables}}, and run stats. Read-only.
Parameters:
get_workflow
Full detail of one workflow: prompt template, variables and defaults, trigger and schedule, run settings, memory state, and any pending logins. Read-only; proxy credentials are masked. Parameters:workflowId (24-hex ID) or title (exact, case-insensitive).
create_workflow
Create a new saved workflow. Parameters:
Presentation and run settings —
model, proxy, timezone, policyId, requiredFiles, shortDescription, triggerPhrase and others — are all optional and default sensibly.
update_workflow
Update an existing workflow. SupplyworkflowId (required) plus only the fields to change. Object and array fields are replaced whole; pass null to clear an optional field. Renaming via title keeps the slug stable.
memoryContract is the exception to whole-replacement: supplying its three fields updates them while platform tracking details are preserved.
trigger_workflow
Run a workflow now in its deployed environment. Returns asessionId — poll get_task_status for the result.
Parameters:
create_agent
Create a scheduled agent — a recurring or one-time automation that runs on a timer. Two modes:
Parameters:
Schedule shapes:
All three accept
timezone (IANA name, default UTC), which drives both the fire times and the browser session.
list_agents
List the account’s scheduled agents: schedule, status, next and last run, and whether each is standalone or deployed from a workflow. Read-only. Parameters:scope — "environment" (default when bound) or "all".
pause_agent
Pause an active scheduled agent — it stops firing until resumed. Parameters:agentId (24-hex, required).
resume_agent
Resume a paused agent, recomputing its next run. A completed work-list agent restarts with a fresh full pass. Parameters:agentId (24-hex, required).
resume_agent refuses if the agent’s expiry has already passed. Extend it on the dashboard first.Advanced Patterns
Pattern 1: Multi-Step Research Workflow
Pattern 2: Guardrail Handling
Pattern 3: Long Task with Status Monitoring
Pattern 4: Inspect, Then Correct
Pattern 5: Run a Saved Workflow on a Schedule
Troubleshooting
Tools Not Appearing
Symptoms: MCP tools don’t show up, or no browser automation options are available. Solutions:-
Claude Code: run
claude mcp get webrun. The most common cause is a missing"type": "http"— without it the entry is treated as a local command. -
Cursor and VS Code: confirm the top-level key. Cursor uses
mcpServers, VS Code usesservers. -
Cline: confirm
"type": "streamableHttp"— camelCase, no hyphen.streamable-httpor a missingtypefalls back to SSE and fails with a 405. -
Claude Desktop: the config file only accepts local (stdio) servers. Use Settings → Connectors, or bridge with
mcp-remoteas shown above. -
Check JSON syntax:
-
Claude Desktop logs:
- macOS:
~/Library/Logs/Claude/mcp*.log - Windows:
%APPDATA%\Claude\logs\mcp*.log
- macOS:
Claude Code, Cursor and VS Code pick up config changes without a restart. Only Claude Desktop needs a full quit and reopen.
It Connects but Every Task Fails
The server lists its tools without a key, so a connection with a missing or wrong key looks perfectly healthy until the first task runs. Solutions:-
Check the header name and value. It is
API-Key, and the value is the key on its own — noBearerprefix. - Confirm the key is active: open the dashboard, check the key exists and has not been revoked, and generate a new one if needed.
- Check the account has balance.
-
Test the key against the REST API:
Authentication Errors
Error:"Invalid API key" or "Unauthorized"
Keys start with wr_ or enig_. Confirm the key is active in the dashboard and that the account has balance. Check for stray spaces or quotes around the header value.
”Environment not found”
TheEnvironment-Id must be a 24-character hex string belonging to your account. Ask the assistant to list your environments, or copy the ID from the Environment page in the dashboard.
If you meant to run on a disposable machine, remove the header entirely rather than leaving it blank.
Session Timeout Errors
Error:"Session not found" or "Session expired"
Cause: sessions expire after 5 minutes of inactivity (fixed, not configurable). Separately, a single task runs for up to 20 minutes by default.
Solutions:
-
Raise the task cap — pass
maxDurationin minutes, up to 60: -
Break long work into chunks:
-
Use
get_task_statusto check progress and detect stalls early.
Task Failures
Error:"Navigation timeout", "Element not found", etc.
Solutions:
-
Make instructions more specific:
-
Use
screenshotto see what the agent sees before guessing at a fix. -
Use
startingUrlfor known websites: -
Check for CAPTCHAs or login requirements — answer with
guardrail_response, or use an environment that is already logged in.
Tool Parameter Reference
Quick Reference Table
Parameter Details
prompt (string)- Natural language description of the task
- Be specific for better results
- Good: “Search Google for ‘Anthropic’ and summarize the first result”
- Good: “Extract all product names and prices from this page”
- Avoid: “Search” (too vague)
- Must be a valid HTTP/HTTPS URL
- Optional, but speeds up navigation compared to “go to amazon.com”
- Optional. 24-character hex ID of a persistent environment
- Overrides the connection’s
Environment-Idheader for this one call - Omit it on a connection with no environment and the task runs on its own temporary browser, discarded when the task ends
- Maximum task duration in minutes
- Default: 20 · Maximum: 60 · On
send_task, minimum 3 - Examples:
10= 10 minutes,45= 45 minutes
- Returned from
create_session,browser_taskandtrigger_workflow
- Returned from task execution, and required by
get_task_status
true: auto-close the session after the task completesfalse(default): keep the session alive for follow-up tasks
guardrail_response)
"resume"(default): provides the requested input and continues the task.responseis required"deny": declines the request.responseis optional
"text"(default),"structured_json", or"structured_csv"outputSchemais required for"structured_json"— see Structured Output
- Controls proactive chat messages to a user (Telegram, WhatsApp, Slack, Discord, Teams) connected to the same environment when no one is watching the session live
"off"(default): no proactive messages — guardrails and results stay on the MCP channel only. Best for sessions handling private data"guardrail_only": pings the chat user on guardrails (CAPTCHA, 2FA, verification, login) when the API caller is offline"full": pings on guardrails and delivers the task result on completion- Available on
browser_taskandcreate_session. Each bot user additionally filters by their own preference - See Routing Guardrails to a Chat User
Best Practices
1. Session Management
Do:- Use
browser_taskfor one-off tasks - Use
create_session+send_taskfor multi-step workflows - Use
trigger_workflow— neverbrowser_task— to run or test a saved workflow - Always set
terminateOnCompletion: trueon your final task - Terminate sessions explicitly with
terminate_sessionwhen done
- Create multiple sessions for related tasks
- Leave sessions running after completion
- Use
create_sessionfor simple one-off tasks
2. Task Instructions
Do:- Be specific and detailed
- Include the expected output format
- Specify wait conditions if needed
- Provide starting URLs when known
- Use vague instructions like “get data”
- Assume the agent knows which element to click
- Skip important context
3. Error Handling
Do:- Monitor long tasks with
get_task_status - Use
screenshotto see the real page state before retrying - Answer CAPTCHAs and 2FA prompts with
guardrail_response - Raise
maxDuration(in minutes) rather than letting a long task be cut off
- Ignore timeout warnings
- Retry indefinitely without changes
- Assume tasks will always succeed
4. Cost Optimization
Do:- Terminate sessions when done
- Use
terminateOnCompletionon final tasks - Break very long tasks into chunks
- Reuse sessions for related tasks
- Leave sessions idle
- Create new sessions for each small task
- Ignore session timeout warnings