Playwright MCP (30K+ stars) gives AI agents browser control through the Model Context Protocol. But when the agent hits a Cloudflare Turnstile or reCAPTCHA challenge, Playwright alone cannot solve it. Here is how to add CAPTCHA solving by registering one additional MCP server — zero code changes, two minutes of setup.
The Problem: Playwright MCP Stops at CAPTCHAs
Microsoft's Playwright MCP server is excellent for browser automation. It gives agents the ability to navigate pages, click buttons, fill forms, and take screenshots — all through standardized MCP tool calls.
But Playwright MCP has no CAPTCHA-solving capability. When the agent navigates to a page protected by Cloudflare Turnstile, it sees the challenge in the accessibility snapshot and has no tool to handle it. The automation stops.
The standard workarounds — stealth plugins, residential proxies, waiting for auto-pass — don't work reliably. Cloudflare detects CDP connections, browser fingerprinting catches automated browsers, and Turnstile challenges from datacenter IPs rarely auto-pass.
The Fix: Add GateSolve MCP Server
MCP is designed for composability. You register multiple MCP servers and the agent discovers all their tools. By adding GateSolve's MCP server alongside Playwright MCP, the agent gains a solve_captcha tool it can call whenever it encounters a CAPTCHA.
Step 1: Register Both MCP Servers
// claude_desktop_config.json or mcp.json
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["@playwright/mcp@latest"]
},
"gatesolve": {
"command": "npx",
"args": ["@gatesolve/mcp-server"],
"env": {
"GATESOLVE_API_KEY": "gs_your_key"
}
}
}
}That is the entire setup. No npm install, no code imports, no plugin configuration. The MCP client (Claude Desktop, Cursor, or your custom agent) discovers both servers and makes their tools available.
Step 2: The Agent Figures Out the Rest
// The agent's mental model when both MCP servers are registered:
//
// 1. Playwright MCP: navigate, click, fill, screenshot — browser control
// 2. GateSolve MCP: solve_captcha — CAPTCHA solving
//
// When the agent hits a CAPTCHA:
// Step 1: Playwright takes a snapshot, agent sees the CAPTCHA
// Step 2: Agent extracts sitekey from the page source
// Step 3: Agent calls GateSolve solve_captcha with URL + sitekey
// Step 4: GateSolve returns the token (solved in a separate browser)
// Step 5: Agent uses Playwright to inject the token and submit the form
{
"tool": "solve_captcha",
"arguments": {
"url": "https://example.com/signup",
"type": "turnstile",
"sitekey": "0x4AAAA..."
}
}
// Returns: { "token": "0.Abc123...", "solve_time_ms": 9200 }When the agent encounters a CAPTCHA, it has the tools to handle it. It uses Playwright to read the page and extract the sitekey, calls GateSolve to solve the CAPTCHA in a separate browser (clean IP, no CDP detection), and uses Playwright to inject the token and continue.
How Token Injection Works
After GateSolve returns the solved token, the agent needs to inject it into the page. This is where Playwright MCP's evaluate tool comes in:
// After GateSolve returns the token, the agent uses Playwright MCP
// to inject it into the page:
// Option 1: Fill the hidden input directly
await page.evaluate((token) => {
const input = document.querySelector('[name="cf-turnstile-response"]');
if (input) input.value = token;
// Also set the callback if the site uses one
if (window.turnstile) {
window.turnstile.getResponse = () => token;
}
}, solvedToken);
// Option 2: For reCAPTCHA, set the textarea
await page.evaluate((token) => {
document.querySelector('#g-recaptcha-response').value = token;
// Trigger the callback
if (window.___grecaptcha_cfg) {
const clients = window.___grecaptcha_cfg.clients;
// Find and call the callback function
}
}, solvedToken);Why MCP Beats Traditional Plugins
// Comparison: Playwright MCP + GateSolve vs. traditional plugin approach
// Traditional: puppeteer-extra-plugin-recaptcha
// - Requires: puppeteer-extra, specific plugin, 2captcha API key
// - Code changes: import plugin, .use() it, call page.solveRecaptchas()
// - Tightly coupled to puppeteer-extra ecosystem
// - Agent can't reason about the solve process
// MCP approach: Playwright MCP + GateSolve MCP
// - Requires: two MCP server configs (JSON, no code)
// - Code changes: zero — the agent discovers tools dynamically
// - Works with any MCP-compatible client (Claude, Cursor, custom)
// - Agent can reason about when/how to solve
// - Agent can choose to skip CAPTCHAs that aren't blocking progressThe key difference: with MCP, the CAPTCHA solving capability is discovered, not hardcoded. The agent sees solve_captcha in its tool list and decides when to use it. With traditional plugins, you write imperative code that always runs at a specific point. The MCP approach is more resilient — the agent can adapt when page layouts change or CAPTCHAs appear in unexpected places.
Supported CAPTCHA Types
| Type | Parameter | Avg Solve Time | Price/1K |
|---|---|---|---|
| Cloudflare Turnstile | turnstile | ~12s | $0.02 |
| reCAPTCHA v2/v3 | recaptcha | ~15s | $0.03 |
| hCaptcha | hcaptcha | ~15s | $0.03 |
Free tier: 100 solves, no credit card required. Get your API key in 30 seconds.
Works With Any MCP Client
This setup is not specific to Claude Desktop. Any MCP-compatible client can use both servers together:
- Claude Desktop — native MCP support
- Cursor — MCP server configuration in settings
- Windsurf — MCP integration
- Custom agents — any SDK supporting MCP (Python, TypeScript)
- browser-use — register via
register_mcp_tools()
Get Started
- Sign up at gatesolve.dev — free API key, 100 solves included
- Add both MCP server configs (copy the JSON above)
- Navigate to a CAPTCHA-protected page — the agent handles the rest
Questions? Check the docs or view the source.