nonecap /nonecap-js
Official TypeScript client for NoneCap, the hCaptcha solver API.
★ 330⑂ 2👁 0⑃ 20● 0▤ 0
+5
Daily
330
stars
2
forks
0
watchers
20
prs
0
issues
0
releases
README
nonecap
Official TypeScript client for the NoneCap hCaptcha solver API.
Submit a captcha, get back a token. The client handles the polling, the timeouts, and the error cases so you do not have to write the fetch loop yourself.
Install
sh
npm install nonecap
Works on Node 18+, Bun, Deno, and edge runtimes. No dependencies.
Quick start
Grab an API key from dashboard.nonecap.com, then:
ts
import { NoneCap } from "nonecap";
const nc = new NoneCap({ apiKey: process.env.NONECAP_KEY! });
const solve = await nc.solve({
type: "hcaptcha",
sitekey: "10000000-ffff-ffff-ffff-000000000001",
url: "https://example.com/login",
});
console.log(solve.token); // the hCaptcha token, ready to submit
console.log(solve.resp_key); // hcaptcha.getRespKey() equivalent, for sites that verify the pair
console.log(solve.user_agent); // submit the token with this User-Agent: some sites check the browser version
console.log(solve.warnings); // e.g. proxy_session_refused: tokens you reported through this proxy session or its exit IP were refused; a different exit IP is more likely to pass (or, when your proxy changed its exit IP during the solve, use a sticky session per solve)
solve() submits the captcha and waits until it is done, using the API's long-poll so you are not hammering it with requests. It returns the solved solve, or throws if the solve fails or your timeout runs out.
MCP server (Claude Code, Cursor, and other MCP clients)
The package also ships nonecap-mcp, a stdio MCP server, so an AI agent can solve hCaptcha through your NoneCap account.
Claude Code:
sh
claude mcp add nonecap --env NONECAP_API_KEY= -- npx -y -p nonecap@latest nonecap-mcp
Cursor (~/.cursor/mcp.json), Claude Desktop (claude_desktop_config.json), and most other clients take the same JSON:
json
{
"mcpServers": {
"nonecap": {
"command": "npx",
"args": ["-y", "-p", "nonecap@latest", "nonecap-mcp"],
"env": { "NONECAP_API_KEY": "" }
}
}
}
Tools:
| Tool | What it does |
| --- | --- |
| solve_hcaptcha | Solve an hCaptcha (sitekey, url; optional type, rqdata, user_agent, proxy, wait_seconds) and return the solve with its token. If the solve is still running after wait_seconds (default 45, at most 50, inside the 60 s that clients built on the official MCP SDK allow by default), it returns the solve id and status so the agent polls get_solve instead of solving again. |
| get_solve | Get a solve by id, optionally waiting up to 50 seconds for it to finish. |
| cancel_solve | Cancel a pending or running solve. |
| list_solves | List your recent solves. |
| get_account | Your credit balance and your plan's solves left today. |
| report_solve_outcome | Tell NoneCap whether the site accepted a token. |
A failed call comes back as a tool error whose JSON carries the API's error code (insufficient_credits, sitekey_rate_limited, a failed solve's proxy_error, …), plus retry_after when the API sent one. Set NONECAP_BASE_URL to point the server