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.Key Features:
Native integration with Claude Desktop and Cline
Six powerful tools for browser automation
Automatic session management
Streaming support for long tasks
Built-in error handling
This is the full reference for the MCP server. For a quickstart guide, see MCP Quickstart.
User: "Use WebRun to search Google for 'Anthropic Claude' and summarize the first result."Claude uses browser_task:{ "taskDetails": "Go to google.com, search for 'Anthropic Claude', and summarize the first result", "startingUrl": "https://google.com", "maxDuration": 120000}
Response:
Copy
{ "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
taskDetails
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
Example Usage:
Copy
User: "Create a browser session and go to amazon.com"Claude uses create_session:{ "taskDetails": "Go to amazon.com", "startingUrl": "https://amazon.com", "maxDuration": 300000}
Response:
Copy
{ "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
taskDetails
string
Yes
-
Task description
terminateOnCompletion
boolean
No
false
Auto-close session after this task
Example Usage:
Copy
User: "Now search for wireless keyboards"Claude uses send_task_to_session:{ "sessionId": "a1b2c3d4e5f6", "taskDetails": "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: { "taskDetails": "Go to amazon.com", "startingUrl": "https://amazon.com" } → Gets sessionId: "abc123"2. Uses send_task_to_session: { "sessionId": "abc123", "taskDetails": "Search for wireless keyboards" } → Gets search results3. Uses send_task_to_session: { "sessionId": "abc123", "taskDetails": "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
Copy
User: "Log in to example.com and extract my dashboard data"Claude's execution:1. Uses create_session: { "taskDetails": "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", "taskDetails": "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: { "taskDetails": "Go to example.com and extract all links" } → Fails with timeout error2. Claude analyzes error and retries with adjusted parameters: Uses browser_task: { "taskDetails": "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:
Copy
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", "taskDetails": "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" }
User: “Use WebRun to search for ‘Claude AI features’ on Google and tell me what you find.”Claude’s Response:
Copy
I'll search Google for Claude AI features using the browser automation tool.[Uses browser_task with taskDetails: "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:
Copy
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 taskDetails: "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:
Copy
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 taskDetails: "Extract the account balance from the dashboard"]Your account balance is $1,234.56