Docs
Agents and SDKs

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/mcp

It 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@latest

In the inspector:

  1. Select Streamable HTTP.
  2. Enter https://api.berrycrawl.com/api/v1/mcp.
  3. Set the bearer token to your Berrycrawl API key.
  4. 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:

SettingValue
TransportStreamable HTTP
Server URLhttps://api.berrycrawl.com/api/v1/mcp
Header nameAuthorization
Header valueBearer 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

ToolWhat it doesBilling behavior
berrycrawl_scrape_urlScrape one page in one or more formatsOrdinary cache miss; YouTube always 5 credits
berrycrawl_capture_screenshotCapture a clean page, viewport, or element imageSuccessful uncached screenshot
berrycrawl_map_siteDiscover and filter site URLsBased on URLs returned
berrycrawl_search_webFast Turbo search with excerpts, up to 10 results2 credits
berrycrawl_get_brandBuild the complete public brand from a website URL10 credits outside the free demo
berrycrawl_start_crawlStart an asynchronous crawlCharged as pages complete
berrycrawl_start_extractStart structured AI extractionUsage recorded by the extraction job
berrycrawl_get_jobRead any crawl or extraction jobFree status read
berrycrawl_get_credit_balanceRead the active organization balanceFree

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:

  1. Call berrycrawl_map_site with a narrow search filter and a small limit.
  2. Select the best URL from the returned links.
  3. Call berrycrawl_scrape_url with formats: ["markdown"].

Run a background crawl:

  1. Call berrycrawl_start_crawl and save the returned job ID.
  2. Poll berrycrawl_get_job until the status is COMPLETED or FAILED.
  3. Follow the next-page pointer until all result pages have been read.

Extract structured data:

  1. Scrape or search to identify the right source URLs.
  2. Call berrycrawl_start_extract with the URLs, a precise prompt, and an optional JSON schema.
  3. Poll berrycrawl_get_job with 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

  1. Call berrycrawl_browser_open with the following arguments. proxy: "none" works on Free accounts.
  2. Read the returned session_id and snapshot. Use fresh refs with the click/type tools, or call berrycrawl_browser_read to read the current page.
  3. Always call berrycrawl_browser_close with that session_id when 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.