mcp-captcha-solver
An MCP server for AI agents that handles captcha bypass workflows through dedicated tools instead of prompt hacks. Includes session-based browser automation, reCAPTCHA v2 solving, Selenium workflows, and a clean agent-to-tool architecture for verification-heavy web flows.
Install / Use
claude mcp add 2captcha -- npx -y github:2captcha/mcp-captcha-solverIf the server publishes to npm under a different name, use that package instead — check the repo README.
MCP Server
Model Context Protocol server
Quality Score
Category
AutomationSupported Platforms
Our assessment of mcp-captcha-solver
mcp-captcha-solver scores 78/100 on our quality scale, 2536th of 2,886 Automation skills we index.
Its MCP Server is 9.5 KB long, well organised into 28 sections with 11 code examples: a thorough specification that gives an agent plenty to work with.
It has 10 GitHub stars, so there is little community track record yet; judge it on its content.
Maintenance, license and trust
- The repository was last updated about 6 months ago. That is recent enough to be usable, but agent tooling moves fast, so check the instructions against your agent's current version.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 91/100, with 1 caution from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
mcp-captcha-solver compared with similar skills
All 4 of these similar skills score higher than mcp-captcha-solver; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| mcp-captcha-solver (this skill)by 2captcha | 78 | 10 | 6mo ago | MCP Server |
| headroomby headroomlabs-ai | 100 | 78.0k | today | CLAUDE.md |
| Agent-Reachby Panniantong | 100 | 104.6k | 2d ago | MCP Server |
| Scraplingby D4Vinci | 100 | 90.0k | today | MCP Server |
| crawl4aiby unclecode | 100 | 86.4k | 1d ago | MCP Server |
Frequently asked questions
- How do I install mcp-captcha-solver?
- Run
claude mcp add 2captcha -- npx -y github:2captcha/mcp-captcha-solver. The install tabs above show the steps for each supported agent. - Which AI agents does mcp-captcha-solver work with?
- It is written for Claude Code and Claude Desktop, as a MCP Server file. Other agents that read the same format can often use it too.
- Is mcp-captcha-solver safe to use?
- It is MIT-licensed and scores 91/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is mcp-captcha-solver still maintained?
- The repository was last updated about 6 months ago. That is recent enough to be usable, but agent tooling moves fast, so check the instructions against your agent's current version.
Skill content
View source on GitHubMCP captcha solver for AI agents
Minimal local demo project for showing the architecture:
Agent -> browser/captcha MCP tools -> Selenium helpers -> structured result
The demo page is used as a convenient test stand, while the core idea is a generic reCAPTCHA v2 capability plus browser tools orchestrated by the agent.
Purpose
This repository is a demo for an article and local experiments with MCP plus Selenium. The key idea is:
- the agent performs a higher-level web task
- browser tools handle generic page interaction
- captcha tools remove a
reCAPTCHA v2obstacle when it appears - tools use Selenium internally and return normalized results
The agent does not execute low-level browser steps itself.
Current Scope
Current implementation is structured as two capability groups:
- browser capabilities for the agent's main task flow
- captcha capabilities for removing
reCAPTCHA v2on the current page
Reference test page:
https://2captcha.com/demo/recaptcha-v2
The structure is designed so additional workflows such as Turnstile can be added later without changing the overall architecture.
Project Structure
app/
browser/
driver_factory.py
page_utils.py
services/
config.py
result_models.py
session_store.py
solver_client.py
workflow_catalog.py
workflows/
_common.py
browser.py
recaptcha_v2.py
mcp_server/
server.py
How It Works
Responsibilities are split by layer:
app/browser/: Selenium driver lifecycle, waits, screenshots, and small browser helpersapp/services/: config loading, normalized result models, and external solver adaptersapp/workflows/: workflow layer split into generic browser tools andreCAPTCHA v2capabilitymcp_server/server.py: MCP tools that expose workflows to the agent
This keeps the MCP layer thin and keeps Selenium details out of the agent prompt.
Requirements
- Python 3.11+
- Google Chrome installed locally
- a compatible ChromeDriver available to Selenium
- 2Captcha API key for the demo workflow
What Needs To Be Installed And Prepared
Before the project can run on another machine, prepare the following:
1. Python
Install Python 3.11+.
Check:
python3 --version
2. Google Chrome
Install a local Chrome browser.
Check on macOS:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --version
3. Compatible ChromeDriver
Selenium must be able to start a Chrome instance that matches the installed browser version.
Check:
chromedriver --version
If the browser and driver major versions do not match, Selenium may fail with
SessionNotCreatedException.
4. Python Dependencies
Create a virtual environment and install dependencies from
requirements.txt.
5. Environment Variables
Create a local .env file from .env.example.
At minimum, set:
APIKEY_2CAPTCHABROWSER_NAMEBROWSER_HEADLESSSCREENSHOT_DIRRESULT_DIRCAPTURE_STEP_SCREENSHOTSif you want intermediate screenshots
6. 2Captcha API Key
The captcha_solve_recaptcha_v2 tool depends on a valid 2Captcha API key.
Without it the browser tools will still work, but captcha-solving will return an error.
7. Optional: Claude Desktop Or Another MCP Client
If someone wants to test the full agent-driven scenario rather than only start the MCP server manually, they also need:
- an MCP-capable client
- for example Claude Desktop
- local MCP server configuration pointing to this project
Without an MCP client, the server can still be launched, but there will be no agent connected to call tools.
Installation
Create and activate a virtual environment, then install dependencies:
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
Then copy and fill the environment file:
cp .env.example .env
Configuration
Copy the example env file and fill in your values:
cp .env.example .env
Environment variables:
APIKEY_2CAPTCHA: API key for 2CaptchaBROWSER_NAME: currentlychromeBROWSER_HEADLESS:trueorfalseSCREENSHOT_DIR: where screenshots are storedRESULT_DIR: where extracted verification JSON artifacts are storedCAPTURE_STEP_SCREENSHOTS:trueorfalse; whenfalse, screenshots are captured mainly for errors and final extraction steps
Quick Start Checklist
Before the first run, make sure all of the following are true:
- Python is installed
- Chrome is installed
- ChromeDriver is compatible with the installed Chrome version
- dependencies from
requirements.txtare installed .envexists and contains a validAPIKEY_2CAPTCHA- the machine can open a local Chrome browser
- if using an agent, the MCP client is configured to launch this server
Running The MCP Server
Start the server locally over stdio:
python -m mcp_server.server
Connecting In Claude Desktop
If you want to test the full agent-driven flow in Claude Desktop, the local MCP server must also be registered in Claude's config.
1. Find Claude Desktop config
On macOS the config file is typically:
2. Add this MCP server
Add an entry like this to the mcpServers section:
{
"mcpServers": {
"mcp-captcha-demo": {
"command": "/usr/bin/env",
"args": [
"python3",
"/Users/Maksim/Desktop/Работа/projects/example_for_mcp/mcp_server/server.py"
],
"env": {
"PYTHONPATH": "/Users/Maksim/Desktop/Работа/projects/example_for_mcp",
"APIKEY_2CAPTCHA": "YOUR_2CAPTCHA_API_KEY",
"BROWSER_NAME": "chrome",
"BROWSER_HEADLESS": "true",
"SCREENSHOT_DIR": "/Users/Maksim/Desktop/Работа/projects/example_for_mcp/artifacts/screenshots",
"RESULT_DIR": "/Users/Maksim/Desktop/Работа/projects/example_for_mcp/artifacts/results",
"CAPTURE_STEP_SCREENSHOTS": "false"
}
}
}
}
Notes:
- use absolute paths
- if the project lives in a different directory, update all paths accordingly
- if you already store
APIKEY_2CAPTCHAin.env, you can omit it here PYTHONPATHshould point to the project root so imports likeapp.*work
3. Restart Claude Desktop
After editing the config:
- fully quit Claude Desktop
- open it again
- go to
Settings -> Developer -> Local MCP servers - confirm that
mcp-captcha-demois visible and connected
4. Verify tool loading
In a new Claude chat, ask something like:
Call healthcheck and list_available_workflows.
If the server is connected correctly, Claude should see the exposed browser and captcha tools.
5. Recommended permission behavior
Claude Desktop may ask for permission before tool calls.
For smoother testing:
- allow tool usage for
mcp-captcha-demo - prefer
Always allowduring local demo sessions
Otherwise Claude may pause before almost every browser or captcha action, which makes the agent flow look much less autonomous.
Available Tools
healthchecklist_available_workflowsbrowser_open_pagebrowser_get_page_statebrowser_find_elementsbrowser_clickbrowser_extract_textbrowser_extract_jsonbrowser_click_verifybrowser_extract_verification_jsonbrowser_close_pagebrowser_close_page_on_errorcaptcha_solve_recaptcha_v2
Agent Flow
The preferred agent scenario is:
- Call
browser_open_pagewith the target URL - Call
browser_get_page_state - If a challenge blocks the task, call
captcha_solve_recaptcha_v2 - Continue the main task through generic browser tools such as
browser_find_elements,browser_click,browser_extract_text, orbrowser_extract_json - Optionally use
browser_click_verifyandbrowser_extract_verification_jsonfor the current 2captcha demo page - Call
browser_close_page
The target page URL should come from the user task or agent prompt rather than from server-side default configuration.
Tool Result Format
Tools return a normalized shape like:
{
"status": "success",
"workflow": "browser_recaptcha_tools",
"challenge_type": "recaptcha_v2",
"page_url": "https://2captcha.com/demo/recaptcha-v2",
"message": "Verification JSON extracted from the page.",
"session_id": "18d22b7f3f13485f8f5e3d4f7c9db201",
"screenshot_path": "artifacts/screenshots/browser_recaptcha_tools-verification-json-20260402-120000.png",
"verification_payload": {
"success": true,
"challenge_ts": "2026-04-06T13:28:26.925Z",
"hostname": "2captcha.com"
},
"verification_result_path": "artifacts/results/browser_recaptcha_tools-verification-20260402-120000.json",
"details": {
"verification_payload_present": true
}
}
On failure, status becomes error, message contains a readable explanation, and screenshot_path is included when available.
Extending The Project
To add a new supported challenge type:
- Add more generic browser tools when the agent needs richer continuation actions
- Keep generic Selenium primitives in
app/browser/ - Add provider-specific solving logic to
app/services/only if needed - Expose a new
captcha_*tool inmcp_server/server.pyonly if a new captcha type is needed - Let the agent continue orchestrating browser tools and captcha tools together
The intended model is agent orchestration over two capability sets: generic browser steps and a specialized reCAPTCHA v2 solving capability.
Related Skills
headroom
78.0kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
Agent-Reach
104.6kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
Scrapling
90.0k🕷️ The BEST Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scrapling_dev
crawl4ai
86.4kOpen-source web crawler and scraper for LLMs and AI agents: any website into clean, LLM-ready Markdown. Run it yourself, or use Crawl4AI Cloud with one key. Join our Discord https://discord.gg/VuxzM8mtf
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
