How to Connect Windsurf IDE to Browser MCP for Agent Browsing
Windsurf (by Codeium) features Cascade, an AI coding agent with deep context awareness. By pairing Windsurf with the Model Context Protocol (MCP) and the 2Captcha Browser MCP server, Cascade gains a full cloud browser engine capable of scraping live websites, testing frontend apps, and bypassing Cloudflare Turnstile barriers.
Why Connect Windsurf Cascade to a Cloud Browser MCP?
While Cascade can write and edit code in your repository, it has no native window into dynamic web content. Standard HTTP fetch tools fail on modern React/Vue SPAs and get blocked instantly by Cloudflare, DataDome, or Akamai firewalls.
Connecting Windsurf to 2Captcha Browser MCP unlocks:
- Dynamic JavaScript Execution: Cascade inspects rendered DOM trees, client-rendered tables, and interactive elements.
- Automated CAPTCHA & WAF Solving: Turnstile and reCAPTCHA challenges are resolved automatically in the cloud before content reaches Cascade.
- Zero Local Chrome Overhead: Browser instances run on high-performance cloud nodes with clean residential IP routing, keeping your developer machine cool and quiet.
Step 1: Locate or Create Windsurf's MCP Config
Windsurf manages external MCP servers through a single configuration file named mcp_config.json located in your user profile:
macOS & Linux: ~/.codeium/windsurf/mcp_config.json
Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json (or C:\Users\<You>\.codeium\windsurf\mcp_config.json)
You can also open this directly from Windsurf by pressing Cmd/Ctrl + Shift + P and selecting Preferences: Open User Settings (JSON) or navigating to Windsurf Settings > Model Context Protocol.
Step 2: Add 2Captcha Browser MCP Server Entry
Add the twocaptcha-browser server definition inside the mcpServers object. If mcp_config.json already has other tools (e.g. Postgres, GitHub), simply append this block:
{
"mcpServers": {
"twocaptcha-browser": {
"command": "npx",
"args": [
"-y",
"@2captcha/browser-mcp"
],
"env": {
"TWOCAPTCHA_API_KEY": "your_2captcha_api_key_here"
}
}
}
}Replace your_2captcha_api_key_here with your active 2Captcha API key from your dashboard.
Step 3: Refresh Cascade & Verify MCP Tools
Save mcp_config.json and restart Windsurf, or press Cmd/Ctrl + Shift + P and run Developer: Reload Window.
Open the Cascade panel. You will now see active browser automation tools registered under MCP:
browser_navigate: Instructs the cloud browser to open any URL with automated WAF solving.browser_snapshot: Captures the rendered DOM tree, text nodes, and computed styles.browser_click: Clicks buttons, dropdowns, and triggers client-side events.browser_screenshot: Returns full-page PNG captures for UI verification.
Step 4: Example Cascade Prompts
In Cascade agent mode, you can now execute end-to-end browser workflows:
Competitor Research: "Navigate to https://example-store.com/new-releases, bypass any Cloudflare challenges, and extract all product titles, SKUs, and prices into a JSON file."
Frontend Verification: "Open http://localhost:3000/dashboard using the cloud browser, verify whether the metrics chart loaded, and take a screenshot."
Documentation Scrape: "Navigate to https://api.docs-vendor.com, expand the Authentication section, and draft a TypeScript API wrapper based on the rendered specs."
#1 Recommended Browser MCP Provider
2Captcha Browser MCP
Rank #1 Best Overall2Captcha Browser MCP is the gold standard for developer AI environments. Built-in Cloudflare Turnstile and reCAPTCHA solving, residential IP pools in 220+ countries, and true pay-as-you-go pricing ($0.05/hour) with zero recurring subscriptions.
Get 2Captcha Browser API Key →