The WebRun MCP (Model Context Protocol) server allows AI assistants like Claude Desktop and Cline to access browser automation capabilities directly through their native tool interfaces.It exposes six tools — task execution, session management, status checks, session control, and manual takeover — with built-in 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.
To connect to a specific environment, append the environment ID to your API key. An environment is a complete persistent remote machine — it maintains its own Chrome browser, file manager, and desktop state across sessions. This means browser profiles, downloaded files, cookies, and any other local state are preserved between tasks, allowing you to pick up exactly where you left off.
Without an environment ID, each MCP session starts with a fresh machine. Use environments when you need persistent state — such as staying logged into websites, keeping downloaded files, or maintaining browser bookmarks and extensions.
After editing, restart Claude Desktop completely (quit and reopen).
To connect to a specific environment, append the environment ID to your API key. An environment is a complete persistent remote machine — it maintains its own Chrome browser, file manager, and desktop state across sessions. This means browser profiles, downloaded files, cookies, and any other local state are preserved between tasks, allowing you to pick up exactly where you left off.
Without an environment ID, each MCP session starts with a fresh machine. Use environments when you need persistent state — such as staying logged into websites, keeping downloaded files, or maintaining browser bookmarks and extensions.
Reload: Restart VS Code or reload the Cline extension.
Controls proactive chat messages to a user (Telegram/WhatsApp/Slack/Discord/Teams) connected to the same environment. One of "off", "guardrail_only", or "full". Use "off" for sessions handling private data
Example Usage:
User: "Use WebRun to search Google for 'Anthropic Claude' and summarize the first result."Claude uses browser_task:{ "prompt": "Go to google.com, search for 'Anthropic Claude', and summarize the first result", "startingUrl": "https://google.com", "maxDuration": 120000}
Response:
{ "success": true, "sessionId": "a1b2c3d4e5f6", "taskId": "x9y8z7w6v5u4", "result": "Anthropic is an AI safety company that created Claude, a next-generation AI assistant...", "usage": { "prompt_tokens": 12450, "completion_tokens": 3200, "total_tokens": 15650, "cost": 0.0124 }}
Create a persistent browser session for multi-step workflows.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:
Parameter
Type
Required
Default
Description
prompt
string
No
""
Initial task (can be empty to just create session)
startingUrl
string
No
null
Starting URL
maxDuration
number
No
300000
Max task duration in ms
reach_out_mode
string
No
"guardrail_only"
Controls proactive chat messages to a user (Telegram/WhatsApp/Slack/Discord/Teams) connected to the same environment. One of "off", "guardrail_only", or "full". Locked at session creation
Example Usage:
User: "Create a browser session and go to amazon.com"Claude uses create_session:{ "prompt": "Go to amazon.com", "startingUrl": "https://amazon.com", "maxDuration": 300000}
Response:
{ "success": true, "sessionId": "a1b2c3d4e5f6", "message": "Session created successfully. You can now send tasks to this session.", "expiresIn": 300000, "streamingUrl": "https://74.235.190.31:8889/a1b2c3d4e5f6"}
Save the sessionId to send follow-up tasks with send_task_to_session.
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:
Parameter
Type
Required
Default
Description
sessionId
string
Yes
-
ID from create_session
prompt
string
Yes
-
Task description
terminateOnCompletion
boolean
No
false
Auto-close session after this task
Example Usage:
User: "Now search for wireless keyboards"Claude uses send_task_to_session:{ "sessionId": "a1b2c3d4e5f6", "prompt": "Search for wireless keyboards and list the top 3 results with prices", "terminateOnCompletion": false}
User: "Research wireless keyboards on Amazon. First go to Amazon, search for wireless keyboards, then tell me about the top 3 results."Claude's execution:1. Uses create_session: { "prompt": "Go to amazon.com", "startingUrl": "https://amazon.com" } → Gets sessionId: "abc123"2. Uses send_task_to_session: { "sessionId": "abc123", "prompt": "Search for wireless keyboards" } → Gets search results3. Uses send_task_to_session: { "sessionId": "abc123", "prompt": "Extract the names, prices, and ratings of the top 3 results", "terminateOnCompletion": true } → Gets structured data and auto-terminates
Pattern 2: Guardrail Handling with Manual Takeover
User: "Log in to example.com and extract my dashboard data"Claude's execution:1. Uses create_session: { "prompt": "Go to example.com and attempt to log in", "startingUrl": "https://example.com" } → Encounters login form2. Detects guardrail (needs credentials)3. Claude asks: "I need login credentials for example.com. Would you like to enter them manually?"4. User says: "Yes"5. Uses take_over_session: { "sessionId": "abc123", "action": "takeover" } → User manually enters credentials6. User says: "Done, credentials entered"7. Uses take_over_session: { "sessionId": "abc123", "action": "release" } → Control returns to agent8. Uses send_task_to_session: { "sessionId": "abc123", "prompt": "Extract all dashboard data", "terminateOnCompletion": true } → Completes task
User: "Scrape all product listings from this marketplace (might take a while)"Claude's execution:1. Uses create_session and send_task_to_session2. While task is running, uses get_task_status every 30 seconds: { "sessionId": "abc123", "taskId": "task456" }3. Reports progress to user: "Task is still running. So far used 15,000 tokens, cost: $0.012"4. When status changes to "completed", retrieves final result
User: "Go to example.com and extract all links"Claude's execution:1. Uses browser_task: { "prompt": "Go to example.com and extract all links" } → Fails with timeout error2. Claude analyzes error and retries with adjusted parameters: Uses browser_task: { "prompt": "Go to example.com, wait for page to fully load, then extract all links", "maxDuration": 120000 } → Succeeds
For tasks that might take longer than the MCP timeout, Claude can use streaming:
User: "Research the top 10 AI companies and compile detailed information about each"Claude's execution:1. Uses create_session2. For each company (1-10): Uses send_task_to_session: { "sessionId": "abc123", "prompt": "Search for [Company Name] and extract: founded date, CEO, main products, revenue" } → Streams results back as each completes3. Uses control_session to terminate when done: { "sessionId": "abc123", "action": "terminate" }
✅ “Search Google for ‘Anthropic’ and summarize the first result”
✅ “Extract all product names and prices from this page”
❌ “Search” (too vague)
startingUrl (string)
Must be valid HTTP/HTTPS URL
Optional but speeds up navigation
Examples:
"https://google.com"
"https://amazon.com"
"https://example.com/products"
maxDuration (number)
Maximum task duration in milliseconds
Default: 300000 (5 minutes)
Maximum: 300000 (5 minutes)
Examples:
60000 = 1 minute max task duration
120000 = 2 minutes max task duration
300000 = 5 minutes max task duration (default)
sessionId (string)
Returned from create_session
Format: 12-character alphanumeric
Example: "a1b2c3d4e5f6"
taskId (string)
Returned from task execution
Format: 12-character alphanumeric
Example: "x9y8z7w6v5u4"
action (string)
For control_session: "pause", "resume", "stop", "terminate"
For take_over_session: "takeover", "release"
terminateOnCompletion (boolean)
true: Auto-close session after task completes
false: Keep session alive for follow-up tasks
Default: false
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
One of:
"off": No proactive messages — guardrails and results stay on the MCP channel only. Useful for sessions handling private data.
"guardrail_only": Bot pings the chat user only on guardrails (CAPTCHA, 2FA, verification, login, etc.).
"full": Bot pings on guardrails and delivers the task result to chat when the task completes.
Default: "guardrail_only"
Available on browser_task and create_session only; locked at session creation
User: “Use WebRun to search for ‘Claude AI features’ on Google and tell me what you find.”Claude’s Response:
I'll search Google for Claude AI features using the browser automation tool.[Uses browser_task with prompt: "Go to google.com, search for 'Claude AI features', and summarize the top 3 results"]Based on the search results, here are the key features of Claude AI:1. **Long Context Window**: Claude can handle up to 200K tokens...2. **Vision Capabilities**: Can analyze images and documents...3. **Code Generation**: Strong capabilities in writing and debugging code...[Full summary based on actual search results]
User: “Create a browser session, go to Amazon, search for wireless keyboards under $50, and tell me the top 3 results with prices.”Claude’s Response:
I'll create a browser session and research wireless keyboards on Amazon for you.[Uses create_session with startingUrl: "https://amazon.com"]Session created.[Uses send_task_to_session with prompt: "Search for wireless keyboards under $50 and extract the top 3 results with names, prices, and ratings"]Here are the top 3 wireless keyboards under $50:1. **Logitech K380** - $29.99 - Rating: 4.5/5 stars - Features: Multi-device connectivity, compact design2. **Keychron K2** - $49.00 - Rating: 4.7/5 stars - Features: Mechanical switches, Mac/Windows compatible3. **Microsoft Wireless Desktop** - $39.99 - Rating: 4.3/5 stars - Features: Full keyboard with numeric padWould you like me to get more details on any of these?
User: “Log in to my dashboard at example.com and show me my account balance.”Claude’s Response:
I'll navigate to example.com and attempt to access the dashboard.[Uses create_session with startingUrl: "https://example.com"]I've reached the login page, but I need your credentials to proceed. Would you prefer to:1. Provide me with your username and password2. Take manual control to enter them yourselfUser: "I'll enter them manually"[Uses take_over_session with action: "takeover"]I've enabled manual control. You can now view and control the browser at this URL:https://74.235.190.31:8889/abc123Please log in, then let me know when you're done.User: "Done, I'm logged in"[Uses take_over_session with action: "release"][Uses send_task_to_session with prompt: "Extract the account balance from the dashboard"]Your account balance is $1,234.56