MCP server
Connect an AI app directly to Berrycrawl's hosted MCP tools.
Berrycrawl has a hosted MCP server at:
https://api.berrycrawl.com/api/v1/mcpIt uses stateless Streamable HTTP. Authenticate with the same bc_ API key you use for the REST API:
Authorization: Bearer bc_...Create a key in Dashboard → API keys. The MCP server uses that key's organization, credit balance, rate limits, and usage history. It never asks for a separate MCP credential.
Test with MCP Inspector
The visual inspector is the quickest first test:
npx @modelcontextprotocol/inspector@latestIn the inspector:
- Select Streamable HTTP.
- Enter
https://api.berrycrawl.com/api/v1/mcp. - Set the bearer token to your Berrycrawl API key.
- Connect, open Tools, and call
berrycrawl_get_credit_balance.
You can also list tools from the terminal:
export BERRYCRAWL_API_KEY="bc_..."
npx @modelcontextprotocol/inspector@latest --cli \
https://api.berrycrawl.com/api/v1/mcp \
--transport http \
--method tools/list \
--header "Authorization: Bearer $BERRYCRAWL_API_KEY"Call the free Berrycrawl demo through the CLI:
npx @modelcontextprotocol/inspector@latest --cli \
https://api.berrycrawl.com/api/v1/mcp \
--transport http \
--method tools/call \
--tool-name berrycrawl_scrape_url \
--tool-arg url=https://berrycrawl.com \
--tool-arg response_format=json \
--header "Authorization: Bearer $BERRYCRAWL_API_KEY"Connect another AI app
Use these values in any app that accepts a remote MCP server:
| Setting | Value |
|---|---|
| Transport | Streamable HTTP |
| Server URL | https://api.berrycrawl.com/api/v1/mcp |
| Header name | Authorization |
| Header value | Bearer bc_... |
If the app accepts an MCP JSON file, the server entry has this shape:
{
"mcpServers": {
"berrycrawl": {
"type": "streamable-http",
"url": "https://api.berrycrawl.com/api/v1/mcp",
"headers": {
"Authorization": "Bearer bc_..."
}
}
}
}Do not commit a file containing the real key. Prefer an app's secret store or environment-variable substitution when it supports one.
TypeScript client
This example uses the official MCP TypeScript SDK:
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
const apiKey = process.env.BERRYCRAWL_API_KEY;
if (!apiKey) throw new Error("BERRYCRAWL_API_KEY is required");
const client = new Client({ name: "my-agent", version: "1.0.0" });
const transport = new StreamableHTTPClientTransport(
new URL("https://api.berrycrawl.com/api/v1/mcp"),
{
requestInit: {
headers: { Authorization: `Bearer ${apiKey}` },
},
},
);
await client.connect(transport);
const tools = await client.listTools();
console.log(tools.tools.map((tool) => tool.name));
const result = await client.callTool({
name: "berrycrawl_scrape_url",
arguments: {
url: "https://berrycrawl.com",
formats: ["markdown"],
response_format: "json",
},
});
console.log(result.structuredContent);
await client.close();Tools
| Tool | What it does | Billing behavior |
|---|---|---|
berrycrawl_scrape_url | Scrape one page in one or more formats | Ordinary cache miss; YouTube always 5 credits |
berrycrawl_capture_screenshot | Capture a clean page, viewport, or element image | Successful uncached screenshot |
berrycrawl_map_site | Discover and filter site URLs | Based on URLs returned |
berrycrawl_search_web | Fast Turbo search with excerpts, up to 10 results | 2 credits |
berrycrawl_get_brand | Build the complete public brand from a website URL | 10 credits outside the free demo |
berrycrawl_start_crawl | Start an asynchronous crawl | Charged as pages complete |
berrycrawl_start_extract | Start structured AI extraction | Usage recorded by the extraction job |
berrycrawl_get_job | Read any crawl or extraction job | Free status read |
berrycrawl_get_credit_balance | Read the active organization balance | Free |
berrycrawl_search_web never bulk-scrapes its result pages. If an agent needs full page content,
it should select only the relevant URLs and call berrycrawl_scrape_url for those pages. This keeps
ordinary searches fast and prevents surprise scrape charges.
Every data tool accepts response_format. Use markdown for a model conversation and json when the client will inspect structuredContent.
Screenshot cleanup
berrycrawl_capture_screenshot removes cookie banners, overlays, and chat widgets by default. The cookie cleanup can be switched off independently when the original consent UI needs to remain:
{
"url": "https://example.com",
"remove_cookie_banners": false,
"response_format": "json"
}The tool also supports device presets, PNG/JPEG/WebP, URL or base64 output, lazy-page scrolling, tall-page stitching, selector capture, hide selectors, and privacy masks. MCP uses snake_case parameter names; the REST API uses camelCase.
Common workflows
Find a page, then read it:
- Call
berrycrawl_map_sitewith a narrowsearchfilter and a smalllimit. - Select the best URL from the returned links.
- Call
berrycrawl_scrape_urlwithformats: ["markdown"].
Run a background crawl:
- Call
berrycrawl_start_crawland save the returned job ID. - Poll
berrycrawl_get_jobuntil the status isCOMPLETEDorFAILED. - Follow the next-page pointer until all result pages have been read.
Extract structured data:
- Scrape or search to identify the right source URLs.
- Call
berrycrawl_start_extractwith the URLs, a precise prompt, and an optional JSON schema. - Poll
berrycrawl_get_jobwith the returned job ID.
Errors and limits
MCP protocol errors are reserved for malformed protocol messages. A tool execution failure returns isError: true with a short cause and a suggested next step.
A final CAPTCHA or anti-bot challenge is a normal tool result. Read structuredContent.data to get success: false, code: "SCRAPE_CHALLENGE_DETECTED", retryable: false, and the message. The tool uses zero credits for this outcome. Follow the guidance in the message and continue with a different source.
Large tool results are capped to protect the model's context window. When truncated is true, lower the tool limit, narrow the URL set, or request the next crawl page.
The server accepts one JSON response per request and does not keep MCP session state. Your crawl and extraction jobs remain available because job state lives in Berrycrawl, not in the MCP connection.
Start with the free test domain
Scrapes and brand lookups for berrycrawl.com do not consume credits. Use it
to confirm your app's connection before testing paid targets.
Persistent browser tools
Use berrycrawl_browser_open to start a browser, then berrycrawl_browser_navigate, snapshot,
click, type, press, scroll, screenshot, read, tabs, files, act, and close
(each name carries the berrycrawl_browser_ prefix). Take a new snapshot after navigation.
Browser time costs 1 credit per started minute; proxied traffic costs 6 credits per decimal MB.
Actions are included. AI tokens are currently recorded without an additional token charge. The human link opens the
authenticated dashboard so a person can watch or take over without exposing connection credentials
to an agent. Free accounts can use direct sessions for up to five minutes.
See Browser sessions for limits, private files, saved logins, and the CDP protocol. Close sessions explicitly when finished; disconnecting a client leaves the browser running.
berrycrawl_browser_run_task starts a hosted browser task and returns a job ID. Poll
berrycrawl_get_job for output, completed steps, files and usage. It uses the normal session
credit holds; partial web actions are never automatically replayed. Logged-in work uses a saved
profile or an existing session_id. See hosted tasks
for limits, origin restrictions and allow_irreversible confirmation behavior.
For repeated checks, berrycrawl_browser_save_recording saves a successful session/task path.
berrycrawl_browser_run_recording replays it without a model and returns run/job IDs for
berrycrawl_get_job. Supply the recording's required variables; use a saved profile for login.
Healing requires heal: true and uses the hosted agent. It offers an updated path without
changing the saved recording. Save a healed source_run_id explicitly to create a new recording.
See recorded runs.
First browser session
- Call
berrycrawl_browser_openwith the following arguments.proxy: "none"works on Free accounts. - Read the returned
session_idand snapshot. Use fresh refs with the click/type tools, or callberrycrawl_browser_readto read the current page. - Always call
berrycrawl_browser_closewith thatsession_idwhen finished. MCP disconnects leave the browser running and time continues to accrue.
{
"url": "https://example.com",
"proxy": "none",
"timeout_seconds": 60,
"max_credits": 5,
"response_format": "json"
}The same MCP URL and API key expose these tools; reconnect or refresh the tool list in clients that cache it. A session can bill time and traffic even when the target page blocks access. Never retry browser writes or an uncertain task submission automatically; read current state first.