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 failure returns isError: true with a short cause and a suggested next step. Internal stack traces, credentials, and provider errors are not returned.
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.