Skip to main content

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:
Authentication travels in headers, never in the URL.
A key in a header stays out of browser history, shell history and proxy logs, and can be rotated without editing a URL that may already have been copied elsewhere.

Connect with OAuth (Claude and ChatGPT)

No API key needed. In Claude or ChatGPT, open Settings → Connectors → Add custom connector, paste https://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:
Delete the Environment-Id line to get a fresh disposable machine for every task.
"type": "http" is required. Claude Code reads a url entry with no type as a local command, and the server will not start.
${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:
Delete the 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 with mcp-remote:
Delete the second --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.
After editing, quit Claude Desktop completely and reopen it.

VS Code

.vscode/mcp.json — note the top-level key is servers, not mcpServers:
Delete the 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 edit cline_mcp_settings.json:
Delete the Environment-Id line to get a fresh disposable machine for every task.
"type": "streamableHttp" is camelCase with no hyphen. Writing streamable-http, or leaving type out, makes Cline fall back to SSE and the connection fails with a 405.
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. The Environment-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
Do not use browser_task to run or test a saved workflow — use trigger_workflow. Only a workflow run carries the workflow’s own rules, tracking and memory.
Parameters: Example Usage:
Response:

create_session

Create a persistent browser session for multi-step workflows. Returns a sessionId 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
Parameters: The nested task object accepts prompt, startingUrl, maxDuration (minutes), outputType, outputSchema, files, secrets, terminateOnCompletion, and webhook. Example Usage:
Response:
Save the sessionId to send follow-up tasks with send_task.

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
Parameters: Example Usage:
Response:
Set terminateOnCompletion: true on your final task to avoid idle session charges.

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
Parameters: Response (still running):
Response (completed):
When the status reports that input is awaited, answer with guardrail_response.

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
Parameters:

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:
The session and any task running in it cannot be resumed afterwards.

pause_session_task

Pause the task currently running in a session. Resume it later with resume_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.
See Handling Guardrails for the full flow.

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 the environmentId 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.
A schedule on a workflow is recorded as a setting only. The workflow does not run on a timer until it is deployed as a scheduled agent with create_agent.
Write concrete values (group names, URLs, numbers) directly into promptTemplate. Use {{variables}} only for a reusable template whose inputs genuinely change per run.

update_workflow

Update an existing workflow. Supply workflowId (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 a sessionId — poll get_task_status for the result. Parameters:
This is the only correct way to run or test a saved workflow. A run started with browser_task or create_session does not carry the workflow’s rules, tracking or memory, so it will behave differently.

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

Use an environment for sites you log into repeatedly. The session stays authenticated, so later tasks skip the login entirely.

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:
  1. 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.
  2. Cursor and VS Code: confirm the top-level key. Cursor uses mcpServers, VS Code uses servers.
  3. Cline: confirm "type": "streamableHttp" — camelCase, no hyphen. streamable-http or a missing type falls back to SSE and fails with a 405.
  4. Claude Desktop: the config file only accepts local (stdio) servers. Use Settings → Connectors, or bridge with mcp-remote as shown above.
  5. Check JSON syntax:
  6. Claude Desktop logs:
    • macOS: ~/Library/Logs/Claude/mcp*.log
    • Windows: %APPDATA%\Claude\logs\mcp*.log
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:
  1. Check the header name and value. It is API-Key, and the value is the key on its own — no Bearer prefix.
  2. Confirm the key is active: open the dashboard, check the key exists and has not been revoked, and generate a new one if needed.
  3. Check the account has balance.
  4. 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”

The Environment-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:
  1. Raise the task cap — pass maxDuration in minutes, up to 60:
  2. Break long work into chunks:
  3. Use get_task_status to check progress and detect stalls early.

Task Failures

Error: "Navigation timeout", "Element not found", etc. Solutions:
  1. Make instructions more specific:
  2. Use screenshot to see what the agent sees before guessing at a fix.
  3. Use startingUrl for known websites:
  4. 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)
startingUrl (string)
  • Must be a valid HTTP/HTTPS URL
  • Optional, but speeds up navigation compared to “go to amazon.com”
environmentId (string)
  • Optional. 24-character hex ID of a persistent environment
  • Overrides the connection’s Environment-Id header 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
maxDuration (number)
  • Maximum task duration in minutes
  • Default: 20 · Maximum: 60 · On send_task, minimum 3
  • Examples: 10 = 10 minutes, 45 = 45 minutes
The MCP tools take maxDuration in minutes. The REST API takes the same parameter in milliseconds — do not copy a value from one to the other.
sessionId (string)
  • Returned from create_session, browser_task and trigger_workflow
taskId (string)
  • Returned from task execution, and required by get_task_status
terminateOnCompletion (boolean)
  • true: auto-close the session after the task completes
  • false (default): keep the session alive for follow-up tasks
newState (string, guardrail_response)
  • "resume" (default): provides the requested input and continues the task. response is required
  • "deny": declines the request. response is optional
outputType (string) and outputSchema
  • "text" (default), "structured_json", or "structured_csv"
  • outputSchema is required for "structured_json" — see Structured Output
reach_out_mode (string)
  • 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_task and create_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_task for one-off tasks
  • Use create_session + send_task for multi-step workflows
  • Use trigger_workflow — never browser_task — to run or test a saved workflow
  • Always set terminateOnCompletion: true on your final task
  • Terminate sessions explicitly with terminate_session when done
Don’t:
  • Create multiple sessions for related tasks
  • Leave sessions running after completion
  • Use create_session for 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
Don’t:
  • 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 screenshot to 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
Don’t:
  • Ignore timeout warnings
  • Retry indefinitely without changes
  • Assume tasks will always succeed

4. Cost Optimization

Do:
  • Terminate sessions when done
  • Use terminateOnCompletion on final tasks
  • Break very long tasks into chunks
  • Reuse sessions for related tasks
Don’t:
  • Leave sessions idle
  • Create new sessions for each small task
  • Ignore session timeout warnings