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 | Successful uncached scrape |
berrycrawl_capture_screenshot | Capture a page or selector to the Berrycrawl CDN | Successful uncached screenshot |
berrycrawl_map_site | Discover and filter site URLs | Based on URLs returned |
berrycrawl_search_web | Turbo search (up to 10 results), with optional result scraping | 2 credits plus any uncached scrapes |
berrycrawl_get_brand | Return the full brand profile and mirrored assets | 10 credits outside the free demo |
berrycrawl_start_crawl | Start an asynchronous crawl | Charged as pages complete |
berrycrawl_get_crawl | Read crawl progress and one result page | Free status read |
berrycrawl_start_extract | Start structured AI extraction | Usage recorded by the extraction job |
berrycrawl_get_extract | Read extraction status and result | Free status read |
berrycrawl_get_credit_balance | Read the active organization balance | Free |
Every data tool accepts response_format. Use markdown for a model conversation and json when the client will inspect structuredContent.
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_crawluntil 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_extractwith 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.