
Ethan Collins
Pattern Recognition Specialist

capsolver-core fits Playwright scripts, capsolver-agent fits tool-calling agents, and capsolver-mcp fits MCP-compatible clients.Public procurement data for AI agents needs repeatable collection code, not a vague promise that an agent can browse. CapSolver should be wired as a documented agent capability: the browser or model detects a verification challenge, the approved tool handles it, and the agent resumes only when the original user-authorized task is still valid. The official CapSolver AI documentation describes three practical layers: CapSolver for AI Agents for architecture, Core SDK browser mode for Playwright flows, agent tool schemas for model-controlled calls, and MCP service tools for clients that discover tools over the Model Context Protocol. This article turns those docs into a production-minded public procurement data for ai agents workflow with code, stop rules, and logging fields.
The CapSolver AI docs describe three layers. Use the lowest layer that matches your ownership model: core SDK when your code controls the browser, agent tools when a model decides when to call a tool, and MCP service when your AI client should discover solving tools automatically.
pip install "capsolver-core[playwright] @ git+https://github.com/capsolver-ai/capsolver-core.git"
pip install git+https://github.com/capsolver-ai/capsolver-agent.git
pip install "capsolver-mcp[browser] @ git+https://github.com/capsolver-ai/capsolver-mcp.git"
playwright install chromium
export CAPSOLVER_API_KEY="your-capsolver-api-key"
The Introduction and Quick Start explains the package roles: capsolver-core exposes the engine, capsolver-agent wraps it as tools, and capsolver-mcp exposes the same capability to MCP clients. Keep the API key in environment configuration and avoid putting it in prompts, logs, screenshots, or article examples.
Procurement portals often expose search pages, notice detail pages, attachments, and award updates. An AI agent should normalize those steps into a source contract before it handles any verification challenge.
source_contract = {
"portal": "city-procurement",
"allowed_paths": ["/bids", "/awards", "/notices"],
"public_records_only": True,
"max_challenge_attempts": 1,
}
def in_public_procurement_scope(url):
return any(path in url for path in source_contract["allowed_paths"])
This contract keeps public procurement data for ai agents focused on public records and stops the run when the target changes to account-only or restricted content.
Use capsolver-core when your public procurement data for ai agents flow already owns a Playwright page. The official Core SDK path is detect, read CAPTCHA info, solve, and fill the token back into the page. The all-in-one browser call is useful when the page structure is dynamic.
import asyncio
from capsolver_core import create_capsolver
from playwright.async_api import async_playwright
TARGET_URL = "https://example.gov/procurement/notices"
async def run_agent_step():
async with async_playwright() as pw:
browser = await pw.chromium.launch()
page = await browser.new_page()
await page.goto(TARGET_URL, wait_until="domcontentloaded")
async with create_capsolver(api_key="YOUR_CAPSOLVER_KEY") as cap:
captcha_types = await cap.detect(page)
if not captcha_types:
return "continue_without_challenge"
results = await cap.solve_on_page(page)
solved = [r for r in results if r.solution and not r.error]
if not solved:
return "stop_for_review"
return "resume_original_authorized_task"
asyncio.run(run_agent_step())
The important engineering detail is the return value, not only the token. Your agent should continue only when the original task is still lawful, reasonable, and user-authorized. It should stop when the page asks for private, restricted, sensitive, or unauthorized data.
Use capsolver-mcp when the agent runs inside an MCP-compatible client. The MCP Service guide documents stdio, SSE, and streamable HTTP transports and lists tools such as solve_captcha, detect_captchas, solve_on_page, get_balance, and get_supported_captchas.
capsolver-mcp --transport streamable-http --host 127.0.0.1 --port 8000
{
"mcpServers": {
"capsolver": {
"command": "capsolver-mcp",
"env": {
"CAPSOLVER_API_KEY": "YOUR_CAPSOLVER_KEY"
}
}
}
}
For public procurement data for ai agents, MCP is strongest when several developers use different clients but need one reviewed tool surface. Keep the service name stable, store keys outside prompts, and log tool calls with request id, target URL, challenge type, attempt count, and final state.
Redeem Your CapSolver Bonus Code
Boost your automation budget instantly!
Use bonus code CAP26 when topping up your CapSolver account to get an extra 5% bonus on every recharge — with no limits.
Redeem it now in your CapSolver Dashboard
Before calling any challenge tool, confirm that the user authorized the task, the target is within the approved domain list, and the data being accessed is public or otherwise permitted. A public procurement data for ai agents workflow should never treat technical capability as permission.
Use a small retry budget. One browser-state retry and one cooldown retry are usually enough. Repeated challenge events should create a review ticket instead of continuing silently.
Capture URL, timestamp, challenge type, CapSolver package path, attempt number, result state, and final page state. Do not store unrelated page content, credentials, session secrets, or personal data unless your policy explicitly allows it.
For public procurement data for ai agents, keep the run lawful and evidence-based: respect HTTP status code behavior, accessibility requirements, privacy risk management, and public data stewardship.
A strong public procurement data for ai agents article should show real implementation paths, and a strong production workflow should do the same. The practical choice is simple: use capsolver-core for code-owned browser automation, capsolver-agent for tool-calling agents, and capsolver-mcp for MCP-compatible clients. Keep challenge handling bounded, logged, and tied to lawful user-authorized work. When your team is ready to add that recovery layer to an agent workflow, start with CapSolver and the official AI agent docs.
Use capsolver-core when your application owns the browser code, capsolver-agent when a model should call a tool, and capsolver-mcp when the AI client should discover tools through MCP.
No. The model can request a tool call, but the application should enforce scope, retry limits, and stop conditions.
No. CAPTCHA handling does not grant permission. Use it only for lawful, reasonable, user-authorized workflows that respect site terms and data rights.
Log the source URL, challenge type, tool path, attempt count, result state, and final page state. Keep credentials and unrelated page content out of logs.
Learn scalable Rust web scraping architecture with reqwest, scraper, async scraping, headless browser scraping, proxy rotation, and compliant CAPTCHA handling.

Learn the best techniques to scrape job listings without getting blocked. Master Indeed scraping, Google Jobs API, and web scraping API with CapSolver.
