CaptchaSonic is **agent-native**. Any AI agent can solve CAPTCHAs through our **MCP server**, available two ways:

- **Hosted:** `https://mcp.captchasonic.com` with your API key as a bearer token. Nothing to install. Recommended.
- **Local:** `npx -y @captchasonic/mcp-server` over stdio, for clients that only support local servers.

Both expose the same five tools: `solve_token_captcha`, `solve_image_captcha`, `get_task_result`, `get_balance` and `list_captcha_types`. Start with the [MCP Get Started guide](/docs/mcp/get-started) for every client, or read the per-agent notes below. If your agent can't speak MCP, call the [direct SDK](#without-mcp-direct-sdk) instead.

## Golden Path for Agents

Drop this into any agent and it can solve CAPTCHAs in one round trip:

```bash
# Claude Code (or any MCP client): add the hosted server once
claude mcp add --transport http captchasonic https://mcp.captchasonic.com --header "Authorization: Bearer sonic_xxx"
# Or, with no MCP — the same lifecycle via curl (replace TASK_ID after createTask):
curl -s https://api.captchasonic.com/createTask -H 'content-type: application/json' -d '{"apiKey":"sonic_xxx","task":{"type":"AntiTurnstileTaskProxyLess","websiteURL":"https://example.com","websiteKey":"0x4AAAAAAA..."}}'
curl -s https://api.captchasonic.com/getTaskResult -H 'content-type: application/json' -d '{"apiKey":"sonic_xxx","taskId":"TASK_ID"}'
```

> [!TIP]
> Point an agent at [MCP for AI Agents](/docs/mcp/for-agents). It explains how to find sitekeys, pick the right tool and submit the token, so the agent can work without further instructions.

---

## Claude Code

Add the hosted server:

```bash
claude mcp add --transport http captchasonic https://mcp.captchasonic.com --header "Authorization: Bearer sonic_xxx"
```

Prefer running it locally? `claude mcp add captchasonic --env SONIC_API_KEY=sonic_xxx -- npx -y @captchasonic/mcp-server` gives you the same tools over stdio.

### Claude skill plugin (recommended)

For guided workflows install the official **CaptchaSonic skill plugin**. It bundles three Claude skills and connects the hosted MCP server using the `SONIC_API_KEY` environment variable. Export your key, start Claude Code, then run:

```bash
/plugin marketplace add Captcha-Sonic/Agent-skills
/plugin install captchasonic
```

Three skills then walk the agent through the common workflows:

- **`captchasonic-setup`** — first-time MCP setup and verification.
- **`captchasonic-solve`** — solve any CAPTCHA type with step-by-step guidance.
- **`captchasonic-balance`** — check account balance and credit status.

> [!TIP]
> Use `get_balance` (or the `captchasonic-balance` skill) as a guard before a batch of solves so the agent can stop early if credits run low.

---

## Antigravity

Register CaptchaSonic in Antigravity's MCP configuration as a local stdio server:

```json
{
  "mcpServers": {
    "captchasonic": {
      "command": "npx",
      "args": ["-y", "@captchasonic/mcp-server"],
      "env": { "SONIC_API_KEY": "sonic_xxx" }
    }
  }
}
```

Reload Antigravity's MCP servers and the CaptchaSonic tools appear in the agent's tool list.

---

## Cursor

Open **Settings → MCP** (or edit `~/.cursor/mcp.json`) and add the hosted server:

```json
{
  "mcpServers": {
    "captchasonic": {
      "url": "https://mcp.captchasonic.com",
      "headers": { "Authorization": "Bearer sonic_xxx" }
    }
  }
}
```

---

## Windsurf

Open **Settings → Cascade → MCP Servers** (or edit `~/.codeium/windsurf/mcp_config.json`):

```json
{
  "mcpServers": {
    "captchasonic": {
      "serverUrl": "https://mcp.captchasonic.com",
      "headers": { "Authorization": "Bearer sonic_xxx" }
    }
  }
}
```

---

## Generic MCP

Any MCP client that supports remote servers: use `https://mcp.captchasonic.com` with Streamable HTTP transport and an `Authorization: Bearer sonic_xxx` header. VS Code, Codex and Gemini CLI configs are in the [Get Started guide](/docs/mcp/get-started).

Clients that only run local servers take the standard stdio block (see [Run locally](/docs/mcp/run-locally)):

```json
{
  "mcpServers": {
    "captchasonic": {
      "command": "npx",
      "args": ["-y", "@captchasonic/mcp-server"],
      "env": { "SONIC_API_KEY": "sonic_xxx" }
    }
  }
}
```

---

## n8n

CaptchaSonic has a **verified n8n community node** ([n8n.io listing](https://n8n.io/integrations/captchasonic/)) that wraps 20+ captcha types into drag-and-drop workflow nodes. It works both as a standalone node and as a tool for n8n's AI Agent node.

→ **[Full n8n Integration Guide](/docs/integrations/n8n)** — step-by-step installation, credential setup, 4 workflow recipes, per-captcha-type configuration, error handling patterns, and troubleshooting.

**Quick install:** Settings → Community Nodes → install `n8n-nodes-captchasonic` → create CaptchaSonic credential with your API key → done.

---

## Without MCP (direct SDK)

If your agent can't use MCP, call the SDK directly. A token-style CAPTCHA is a single function call.

<LangTabs>
  <LangTabs.Tab label="Python">

<Snippet sdk="python" region="solveTurnstile" />

  </LangTabs.Tab>
  <LangTabs.Tab label="Node">

<Snippet sdk="typescript" region="solveTurnstile" />

  </LangTabs.Tab>
</LangTabs>

See the [Python SDK](/docs/clients-sdks/python) and [Node.js SDK](/docs/clients-sdks/nodejs) pages for the full method list, or the [REST API reference](/docs/api) for the raw three-call lifecycle.
