DEV Community

NSLSolver Team
NSLSolver Team

Posted on Originally published at nslsolver.com

Give Your AI Agent a Captcha Solver: an MCP Server for Claude, Cursor and VS Code

AI agents can now browse, fill forms, scrape and run end-to-end tests on their own. Then they hit a Cloudflare "Just a moment..." page or a Turnstile widget, and the run stops. The agent cannot click a checkbox that is designed to detect automation, and it has no way to buy its way past one.

The NSLSolver MCP server fixes that. It plugs a captcha-solving API into any Model Context Protocol client, so the agent can call a solver the same way it calls a file-system or browser tool. This guide covers the setup, what the agent receives, and the few rules that make the tokens and cookies actually work.

Short version: install the server with one npx command, add your API key, and your agent gets six tools for Turnstile, Cloudflare Challenge, reCAPTCHA v3, Kasada, Akamai and your balance. Copy-paste configs for every client are on the MCP setup page.

Why agents get stuck on captchas

Bot walls are built to stop exactly what an agent is: software driving a browser or an HTTP client. Turnstile scores the browser environment, Cloudflare Challenge issues a cf_clearance cookie only to clients that pass its checks, Kasada and Akamai require signed sensor payloads, and reCAPTCHA v3 grades the session silently.

An agent can recognise these pages, but it cannot pass them by itself. What it can do is call a tool. Once a solver is available as an MCP tool, the agent detects the wall, sends the site key and URL to the solver, and gets back a token, cookies or headers to continue with.

What the MCP server is

The Model Context Protocol (MCP) is the open standard that AI clients such as Claude Code, Claude Desktop, Cursor, VS Code and Windsurf use to talk to external tools. A server describes its tools, their inputs and what they do; the client shows them to the model, and the model decides when to call them.

nslsolver-mcp is open source (MIT), published on npm and in the official MCP Registry, runs locally over stdio, and only talks to the NSLSolver API with your key. No state, no telemetry, no other network access.

Install it in Claude Code, Claude Desktop or Cursor

You need Node.js 18+ and an API key. The key is active as soon as you sign up, and signing up with Google, Gmail or Proton adds free credit. In Claude Code, one command registers the server:

# Claude Code: one command, available in every project
claude mcp add nslsolver -e NSLSOLVER_API_KEY=YOUR_API_KEY -- npx -y nslsolver-mcp

# check it is connected
claude mcp list
Enter fullscreen mode Exit fullscreen mode

JSON config for other clients

Claude Desktop (claude_desktop_config.json), Cursor (~/.cursor/mcp.json) and Windsurf (~/.codeium/windsurf/mcp_config.json) all accept the same block:

{
  "mcpServers": {
    "nslsolver": {
      "command": "npx",
      "args": ["-y", "nslsolver-mcp"],
      "env": { "NSLSOLVER_API_KEY": "YOUR_API_KEY" }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

VS Code uses a servers key and can prompt for the key so it is never written to disk; that variant is on the setup page.

The tools your agent gets

Tool Returns Avg. time Per 1,000
solve_turnstile token ~250 ms $0.80
solve_cloudflare_challenge cf_clearance + user_agent ~3.3 s $1.00
solve_recaptcha_v3 token ~13 s $1.00
solve_kasada x-kpsdk-* headers 3–10 s $1.50
solve_akamai _abck + session cookies ~15 s $2.00
get_balance balance, CPM limits instant free

Only successful solves are billed. Validation errors, 429 and 503 responses cost nothing.

What a call looks like

Ask in plain language, for example: "Get a Turnstile token for https://example.com/login, the sitekey is 0x4AAAAAAA..." or "This page shows Just a moment..., get a cf_clearance through my proxy http://user:pass@1.2.3.4:8080". The agent picks the tool and gets JSON back:

// solve_turnstile
{ "success": true, "type": "turnstile", "token": "0.AkBr7...", "cost": 0.0008 }

// solve_cloudflare_challenge
{ "success": true, "type": "challenge", "cookies": { "cf_clearance": "abc123..." }, "user_agent": "Mozilla/5.0 ...", "cost": 0.001 }
Enter fullscreen mode Exit fullscreen mode

Three rules that make the results work

  • Replay cookies with the same proxy and User-Agent. cf_clearance and the Akamai cookies are bound to the exit IP and browser identity they were minted with. The challenge tool returns the user_agent to reuse.
  • Use tokens quickly, and only once. A Turnstile token expires after about 300 seconds and is single-use, so solve right before you submit.
  • Match the widget exactly. If the widget sets data-action/data-cdata, or the site calls grecaptcha.execute with an action, pass the same value.

Keep costs under control

Every solve is a paid call, so treat the tools like any other side effect. The tools are marked non-idempotent, and clients such as Claude Code ask for approval before running them unless you allow them. get_balance is free. Rate-limited and temporarily failing calls are retried with backoff, and timeouts are never retried, so one prompt never pays twice for the same solve.

Use the solver only where you are allowed to automate: your own sites, QA environments, and sites whose terms permit it.


Try it: create a free account, paste one config block, and your agent can solve Turnstile, Cloudflare Challenge, reCAPTCHA v3, Kasada and Akamai. Source: github.com/NSLSolver/NSLSolver-MCP.

Top comments (0)