scrape and every other tool), or Fetch with response_type=markdown and mode=auto as a function tool
How it works
- The model plans. Given a question, the LLM decides which URL to read first.
- Zenrows reads the page. The model calls a Zenrows tool: the MCP
scrapetool, or your own function that calls Fetch withmode=autoandresponse_type=markdown. The page comes back as markdown. - The loop repeats. The model reads the result, follows up with more pages if it needs them, and stops when it can answer.
- The model answers with sources. The final answer cites the URLs it read.
Ask your AI agent
With the Zenrows MCP server connected to Claude, Cursor or any MCP client, paste this prompt. Your agent picks the right Zenrows tools and settings on its own.No code: Claude or Cursor with the MCP server
Connect the Zenrows MCP server to your AI app once, then research in plain language.1
Connect the server
In Claude, add a custom connector with the URL
https://mcp.zenrows.com/mcp and sign in, see Claude. In Cursor, Claude Code, VS Code, Windsurf and other clients, follow the clientβs page in MCP overview.2
Ask a research question
Paste the prompt from Ask your AI agent, or your own. Name Zenrows in the prompt (βUse Zenrows toβ¦β) so the app picks its tools.
3
Go deeper with more tools
The same server gives the agent
extract for structured data, crawl_* to discover a siteβs pages, batch_* for many URLs at once, and browser_* for pages that need a login or clicks. See the tool reference.Connect the MCP server to the LLM API
The Anthropic and OpenAI APIs connect to remote MCP servers on their side: you pass the server URL and your Zenrows API key, and the model calls the tools directly. Check the connection first. This request lists the serverβs tools, with your key as a Bearer token:cURL
scrape, extract, batch_create, batch_status and the crawl_* and browser_* families. Then give the server to the model:
scrape as many times as the model needs, and returns the final answer. To limit which tools the model can call, configure the toolset, see the Anthropic MCP connector and OpenAI remote MCP docs. More setups: Anthropic Claude API, OpenAI, OpenAI Agents SDK.
Add a function tool that calls Fetch
For full control, give the model one function of your own. It calls Fetch withmode=auto and response_type=markdown, so the model reads clean markdown from any page. This example uses the Anthropic SDKβs tool runner, which runs the loop for you (pip install anthropic requests):
Python
response.text[:50_000] keeps very long pages within a sensible context budget.
With another framework, keep read_web_page as it is and register it the way your framework expects. Its JSON schema, which @beta_tool builds from the signature and docstring, is:
Example output
Thetools/list check returns every tool. Trimmed to the start of the first one:
read_web_page returns to the model for the hoodie page, trimmed to the product section:
Customize it
Troubleshooting
- The
tools/listcheck returns401: the key is missing or wrong. Send it exactly asAuthorization: Bearer YOUR_ZENROWS_API_KEY, with your key from the dashboard. - The agent answers without reading any page: the model didnβt see a reason to call the tool. Name it in the prompt (βUse Zenrows to readβ¦β) or make the tool description say when to call it.
- Tool calls time out in your function: keep the HTTP timeout at 180 seconds so
mode=autohas time to escalate on protected pages. - The modelβs context fills up: long pages add up over many calls. Truncate each result, or return only the fields you need with
extract=autoorcss_extractor.
Related recipes
Connect your AI agent to Zenrows
Set up the MCP server in every major client.
Fetch first, open a Browser when a task needs interaction
Give the agent a browser for logins and clicks.
Prompts that put Zenrows MCP to work
Ready prompts for every Zenrows tool.
Build a RAG knowledge base from a website
Index a site ahead of time instead of reading on demand.