> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zenrows.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ZenRows MCP Server

> Give any MCP-compatible AI tool, agent, or application real-time access to the live web. One integration combines fast scraping and full browser automation, with anti-bot bypass on every tool.

The [ZenRows MCP (Model Context Protocol) server](https://github.com/ZenRows/zenrows-mcp) is the standard way AI systems use ZenRows. A single connection gives your AI assistant, agent, or application real-time access to any website.

<Card title="View on GitHub" icon="github" href="https://github.com/ZenRows/zenrows-mcp">
  ZenRows MCP is open source. Star the repository, file issues, or contribute.
</Card>

## Why ZenRows MCP

* **Reach sites that normally block bots:** Get access to any website at scale without getting blocked by anti-bot systems.
* **Managed scraping infrastructure:** Proxy rotation, headless browser orchestration, anti-bot evasion, and session management run on ZenRows infrastructure.
* **Plug into any AI you already use:** Works with any MCP client, including AI assistants, agent frameworks, AI SDKs, IDE plugins, and custom applications.
* **Plain English, no scraping code:** Describe the task naturally and the AI picks the right tool. No selectors, no proxy management, no anti-bot tuning.

## What you can do

Once connected, your AI assistant can:

* Scrape any webpage by describing the task in plain English
* Extract structured data from e-commerce sites, news pages, job boards, and more
* Render pages as Markdown, plain text, HTML, or PDF
* Take above-the-fold or full-page screenshots
* Access geo-restricted, JavaScript-heavy, or bot-protected pages
* Automate multi-step browser workflows: navigate, click, fill forms, scroll, drag, and extract across pages
* Run JavaScript in a live browser context
* Manage cookies, local storage, multiple tabs, and persistent sessions

## Before you start

<CardGroup cols={2}>
  <Card icon="user" href="https://app.zenrows.com/register" title="ZenRows Account">
    A **ZenRows account**
  </Card>

  <Card icon="key" href="https://app.zenrows.com/dashboard" title="ZenRows API Key">
    Your **ZenRows API key**
  </Card>
</CardGroup>

## Connection options

The ZenRows MCP server supports two transport options. Pick the one that fits your client.

| Option                                      | Transport                | Authentication       |
| ------------------------------------------- | ------------------------ | -------------------- |
| [**Remote MCP server**](#remote-mcp-server) | Streamable HTTP          | OAuth Bearer token   |
| [**Local MCP server**](#local-mcp-server)   | STDIO (local subprocess) | Environment variable |

Both options expose the same set of tools and capabilities. The choice is purely about how your client connects to the server.

### Remote MCP server

The hosted ZenRows MCP server is the recommended path for any AI application that calls an LLM API directly. The server runs on ZenRows' infrastructure, so there is nothing to install, configure, or update.

* **Server URL:** <br /> `https://mcp.zenrows.com/mcp`
* **Transport:** <br /> Streamable HTTP
* **Authentication:** <br /> OAuth-based. Pass your ZenRows API key as a Bearer token. See [Authentication](#authentication) for details.

**Example: OpenAI Responses API**

Most modern AI SDKs accept the connection details through a single MCP tool definition. Here is the complete configuration for the OpenAI Responses API:

```python Python theme={null}
import os
from openai import OpenAI

ZENROWS_API_KEY = os.environ["ZENROWS_API_KEY"]

client = OpenAI(api_key=os.environ["OPENAI_API_KEY"])

response = client.responses.create(
    model="gpt-5",
    tools=[
        {
            "type": "mcp",
            "server_label": "zenrows",
            "server_description": "Web scraping MCP server for accessing live web content.",
            "server_url": "https://mcp.zenrows.com/mcp",
            "authorization": ZENROWS_API_KEY,
            "require_approval": "never",
        }
    ],
    input="Visit https://news.ycombinator.com/ and summarize the three most recent posts.",
)

print(response.output_text)
```

**Generic configuration**

| Field       | Value                                        |
| ----------- | -------------------------------------------- |
| Endpoint    | `https://mcp.zenrows.com/mcp`                |
| Transport   | Streamable HTTP                              |
| Auth header | `Authorization: Bearer YOUR_ZENROWS_API_KEY` |

Most MCP clients accept either an `authorization` shorthand field that automatically wraps the value as a Bearer token, or a free-form `headers` field where you set the `Authorization` header yourself. Either approach works with ZenRows MCP.

### Local MCP server

If your AI client runs the MCP server as a local subprocess instead of calling a remote URL, use the [`@zenrows/mcp`](https://www.npmjs.com/package/@zenrows/mcp) npm package. This is the standard configuration for desktop AI clients.

<Warning>
  You need [Node.js](https://nodejs.org/) installed for `npx` to work.
</Warning>

The exact location of the configuration file varies by client, but every supported client uses a similar MCP server config shape. Replace `YOUR_ZENROWS_API_KEY` with your actual key:

```json JSON theme={null}
{
  "mcpServers": {
    "zenrows": {
      "command": "npx",
      "args": ["-y", "@zenrows/mcp"],
      "env": {
        "ZENROWS_API_KEY": "YOUR_ZENROWS_API_KEY"
      }
    }
  }
}
```

#### Per-client setup guides

For step-by-step instructions including the exact config file path and restart steps for each client:

| Client                                             | Type                |
| -------------------------------------------------- | ------------------- |
| [Claude Desktop](/integrations/mcp/claude-desktop) | AI assistant        |
| [Claude Code](/integrations/mcp/claude-code)       | AI coding assistant |
| [Cursor](/integrations/mcp/cursor)                 | AI code editor      |
| [Windsurf](/integrations/mcp/windsurf)             | AI code editor      |
| [VS Code](/integrations/mcp/vscode)                | AI code editor      |
| [Zed](/integrations/mcp/zed)                       | AI code editor      |
| [JetBrains IDEs](/integrations/mcp/jetbrains)      | AI code editor      |

## Authentication

The ZenRows MCP server uses OAuth-based Bearer token authentication. Your ZenRows API key acts as the access token.

<Tabs>
  <Tab title="Remote MCP server">
    Send the key in the HTTP `Authorization` header on every request:

    ```text theme={null}
    Authorization: Bearer YOUR_ZENROWS_API_KEY
    ```

    OpenAI's MCP tool, Anthropic's MCP tool, and most other MCP clients expose this through a single `authorization` field on the tool config and forward it as the Bearer token automatically. Some clients use a free-form `headers` field instead. Both approaches are valid.
  </Tab>

  <Tab title="Local STDIO MCP server">
    Pass the API key through the `ZENROWS_API_KEY` environment variable in your client's MCP configuration:

    ```json JSON theme={null}
    {
      "mcpServers": {
        "zenrows": {
          "env": {
            "ZENROWS_API_KEY": "YOUR_ZENROWS_API_KEY"
          }
        }
      }
    }
    ```
  </Tab>
</Tabs>

You can find or rotate your API key in your [ZenRows dashboard](https://app.zenrows.com/account/settings).

<Warning>
  Treat your API key like a password. Do not commit it to source control or share it in client-side code.
</Warning>

## Tools

A tool in MCP terms is a named capability the server exposes. For example, `scrape` or `browser_navigate`.

When you ask your AI to fetch a webpage or fill a form, the AI sees the available tools, picks the one that fits the task, and invokes it. **You don't call tools yourself in code.** You set up the MCP connection once, and the AI handles tool selection and invocation from there.

The ZenRows MCP exposes two families of tools.

### The `scrape` tool

The `scrape` tool fetches a webpage in a single request and returns its content in the format you specify: clean Markdown (default), plain text, raw HTML, a screenshot, a PDF, or structured JSON. It uses the [Universal Scraper API](/universal-scraper-api/api-reference) under the hood.

Best for quick data extraction where the AI doesn't need to interact with the page.

### Browser tools

The `browser_*` tools give your AI assistant control of a cloud-hosted browser session powered by the [ZenRows Scraping Browser](/scraping-browser/introduction). The browser comes with built-in residential proxies and anti-bot bypass.

Browser tools cover tasks that involve:

* Navigation across multiple pages in a single session
* Form fills, button clicks, and other element interactions
* Waiting for dynamically loaded content
* JavaScript execution in the browser context
* Cookies, local storage, and multi-tab management

Every browser workflow starts with `browser_navigate`, which opens a session and returns a `session_id`. All subsequent browser calls use this `session_id`. Call `browser_close` when done.

#### Available browser tools

<AccordionGroup>
  <Accordion title="Session">
    | Tool               | Description                                                                                |
    | ------------------ | ------------------------------------------------------------------------------------------ |
    | `browser_navigate` | Open a browser session and navigate to a URL. Returns a `session_id` for subsequent calls. |
    | `browser_close`    | Close a browser session and free all associated resources.                                 |
  </Accordion>

  <Accordion title="Navigation">
    | Tool                 | Description                          |
    | -------------------- | ------------------------------------ |
    | `browser_go_back`    | Navigate back in browser history.    |
    | `browser_go_forward` | Navigate forward in browser history. |
    | `browser_reload`     | Reload the current page.             |
  </Accordion>

  <Accordion title="Interaction">
    | Tool                    | Description                                                                             |
    | ----------------------- | --------------------------------------------------------------------------------------- |
    | `browser_click`         | Click an element using a CSS selector.                                                  |
    | `browser_hover`         | Hover over an element to trigger hover effects.                                         |
    | `browser_type`          | Type text into an input field. Appends to existing content unless `clear_first` is set. |
    | `browser_fill`          | Clear an input field and set its value.                                                 |
    | `browser_select_option` | Select an option from a `<select>` dropdown.                                            |
    | `browser_check`         | Check a checkbox or radio button.                                                       |
    | `browser_uncheck`       | Uncheck a checkbox.                                                                     |
    | `browser_focus`         | Move focus to an element.                                                               |
    | `browser_press_key`     | Press a keyboard key (e.g. `Enter`, `Tab`, `Escape`, `Control+a`).                      |
    | `browser_scroll`        | Scroll the page in a given direction.                                                   |
    | `browser_drag`          | Drag an element to a target element.                                                    |
  </Accordion>

  <Accordion title="Extraction">
    | Tool                             | Description                                                                                                          |
    | -------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
    | `browser_get_accessibility_tree` | Get the page's accessibility tree as readable text. Call this after `browser_navigate` to understand page structure. |
    | `browser_get_url`                | Get the current URL.                                                                                                 |
    | `browser_get_title`              | Get the page title.                                                                                                  |
    | `browser_get_text`               | Get the visible text of an element or the entire page.                                                               |
    | `browser_get_attribute`          | Get the value of a specific attribute on an element.                                                                 |
    | `browser_get_html`               | Get the HTML source of an element or the full page.                                                                  |
    | `browser_query_selector_all`     | Find all elements matching a CSS selector. Returns text, HTML, and attributes.                                       |
  </Accordion>

  <Accordion title="Visual">
    | Tool                   | Description                                          |
    | ---------------------- | ---------------------------------------------------- |
    | `browser_screenshot`   | Take a screenshot of the page or a specific element. |
    | `browser_generate_pdf` | Render the current page as a PDF.                    |
  </Accordion>

  <Accordion title="Wait">
    | Tool                          | Description                                                                           |
    | ----------------------------- | ------------------------------------------------------------------------------------- |
    | `browser_wait_for_selector`   | Wait until an element is stable in the DOM. Set `visible=true` to require visibility. |
    | `browser_wait_for_navigation` | Wait for a page navigation. Call this before the action that triggers navigation.     |
    | `browser_wait`                | Wait for a fixed duration in milliseconds.                                            |
  </Accordion>

  <Accordion title="JavaScript">
    | Tool               | Description                                                      |
    | ------------------ | ---------------------------------------------------------------- |
    | `browser_evaluate` | Execute JavaScript in the browser context and return the result. |
  </Accordion>

  <Accordion title="Cookies">
    | Tool                    | Description                           |
    | ----------------------- | ------------------------------------- |
    | `browser_get_cookies`   | Get all cookies for the current page. |
    | `browser_set_cookies`   | Set one or more cookies.              |
    | `browser_clear_cookies` | Clear all cookies for the session.    |
  </Accordion>

  <Accordion title="Storage">
    | Tool                    | Description                         |
    | ----------------------- | ----------------------------------- |
    | `browser_local_storage` | Read, write, or clear localStorage. |
  </Accordion>

  <Accordion title="Tabs">
    | Tool                 | Description                         |
    | -------------------- | ----------------------------------- |
    | `browser_new_tab`    | Open a new tab. Returns a `tab_id`. |
    | `browser_switch_tab` | Switch focus to a different tab.    |
  </Accordion>

  <Accordion title="Batch">
    | Tool            | Description                                                                    |
    | --------------- | ------------------------------------------------------------------------------ |
    | `browser_batch` | Execute a sequence of browser actions in a single call for better performance. |
  </Accordion>
</AccordionGroup>

## Pricing

The ZenRows MCP server itself is free. There is no separate fee for connecting, listing tools, or using the integration. Each tool call is billed against your ZenRows subscription using the standard pricing of the underlying product:

* Calls to the `scrape` tool follow [Universal Scraper API pricing](/universal-scraper-api/api-reference#pricing).
* Calls to `browser_*` tools follow [Scraping Browser pricing](/scraping-browser/introduction).

You can monitor real-time usage and remaining quota on your [Analytics page](https://app.zenrows.com/analytics).

## Troubleshooting

### Connection issues

| Issue                                                               | Cause                                            | Solution                                                                                                                                                                                                                                               |
| ------------------------------------------------------------------- | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `424 Failed Dependency` or `401 Unauthorized`                       | Missing or invalid Bearer token                  | Confirm `Authorization: Bearer YOUR_ZENROWS_API_KEY` is set on every request. For OpenAI/Anthropic SDKs, use the `authorization` field on the MCP tool config. Verify your key is active in your [dashboard](https://app.zenrows.com/account/settings) |
| Tool list is empty when connecting to the remote URL                | Authentication failed silently or wrong endpoint | Confirm the URL is exactly `https://mcp.zenrows.com/mcp` and the Bearer token is present and valid                                                                                                                                                     |
| The `scrape` tool is unavailable in your AI assistant (local STDIO) | Configuration not loaded yet                     | Restart your AI tool after saving the configuration file. For Claude Desktop, fully quit and reopen the application                                                                                                                                    |
| API key is not recognized (local STDIO)                             | Key not replaced in configuration                | Confirm `YOUR_ZENROWS_API_KEY` has been replaced with your actual key from the [ZenRows dashboard](https://app.zenrows.com). The value must have no extra spaces or surrounding quotation marks                                                        |

### Scraped content issues

If your AI is connecting and invoking tools correctly but the scraped content comes back missing, blocked, or incomplete, the issue is with the target page rather than the MCP connection.

Common causes include JavaScript-loaded content, anti-bot protection, geo-restrictions, and dynamic loading. See the [Universal Scraper API troubleshooting guide](/universal-scraper-api/troubleshooting/troubleshooting-guide) for fixes you can ask your AI to apply. For example, "scrape with JavaScript rendering enabled" or "use Premium Proxies."

## Example prompts

Once ZenRows MCP is connected, describe the task to your AI assistant in plain English and it handles the scraping automatically.

<Tabs>
  <Tab title="Scrape tool">
    ```text wrap theme={null}
    Fetch https://www.scrapingcourse.com/javascript-rendering/. It uses React, so enable JavaScript rendering.
    ```

    ```text wrap theme={null}
    Get the top 5 products from https://www.scrapingcourse.com/ecommerce/ and extract just the names and prices.
    ```

    ```text wrap theme={null}
    Take a full-page screenshot of https://news.ycombinator.com.
    ```

    ```text wrap theme={null}
    Scrape https://www.scrapingcourse.com/antibot-challenge. It's blocking requests. Use Adaptive Stealth Mode.
    ```
  </Tab>

  <Tab title="Browser tools">
    ```text wrap theme={null}
    Open https://www.scrapingcourse.com/ecommerce/ in a browser, type "hoodie" into the search field, press Enter, wait for the results to load, then extract all matching product names and prices.
    ```

    ```text wrap theme={null}
    Navigate to https://scrapingcourse.com/ecommerce/, click on the first product, extract its full description and price, then go back and do the same for the second product.
    ```

    ```text wrap theme={null}
    Open https://news.ycombinator.com in a browser, scroll down to load more stories, then extract all the headlines and links.
    ```
  </Tab>
</Tabs>

## Related resources

<CardGroup cols={2}>
  <Card title="Universal Scraper API Reference" icon={<svg xmlns="http://www.w3.org/2000/svg"  width="24"  height="24"  viewBox="0 0 24 24"  fill="none"  stroke="#064E3B"  strokeWidth="2"  strokeLinecap="round"  strokeLinejoin="round"  className="icon icon-tabler icons-tabler-outline icon-tabler-chisel"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M14 14l1.5 1.5" /><path d="M18.347 15.575l2.08 2.079a1.96 1.96 0 0 1 -2.773 2.772l-2.08 -2.079a1.96 1.96 0 0 1 2.773 -2.772z" /><path d="M3 6l3 -3l7.414 7.414a2 2 0 0 1 .586 1.414v2.172h-2.172a2 2 0 0 1 -1.414 -.586l-7.414 -7.414z" /></svg>} href="/universal-scraper-api/api-reference">
    Full parameter reference for the `scrape` tool's underlying API.
  </Card>

  <Card title="Scraping Browser Introduction" icon={<svg xmlns="http://www.w3.org/2000/svg"  width="24"  height="24"  viewBox="0 0 24 24"  fill="none"  stroke="#064E3B"  strokeWidth="2"  strokeLinecap="round"  strokeLinejoin="round"  className="icon icon-tabler icons-tabler-outline icon-tabler-click"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M3 12l3 0" /><path d="M12 3l0 3" /><path d="M7.8 7.8l-2.2 -2.2" /><path d="M16.2 7.8l2.2 -2.2" /><path d="M7.8 16.2l-2.2 2.2" /><path d="M12 12l9 3l-4 2l-2 4l-3 -9" /></svg>} href="/scraping-browser/introduction">
    Learn more about the browser powering the `browser_*` tools.
  </Card>

  <Card title="ZenRows Dashboard" icon="chart-bar" href="https://app.zenrows.com">
    Monitor usage, manage your API key, and track quota.
  </Card>

  <Card title="NPM Package" icon="npm" href="https://www.npmjs.com/package/@zenrows/mcp">
    `@zenrows/mcp` on npm for local STDIO deployments.
  </Card>
</CardGroup>

## Contributing

The ZenRows MCP server is open source. If you want to modify the server, fix a bug, or suggest an improvement, clone the [GitHub repository](https://github.com/ZenRows/zenrows-mcp) and run it locally:

```bash Bash theme={null}
git clone https://github.com/ZenRows/zenrows-mcp
cd zenrows-mcp
npm install
cp .env.example .env   # Add your API key
npm run dev            # Run with .env loaded (requires Node.js 20.6+)
npm run build          # Compile to dist/
npm run inspect        # Open the MCP inspector UI
```

Pull requests and issues are welcome on the [GitHub repository](https://github.com/ZenRows/zenrows-mcp).
