🎯 A customizable, anti-detection cloud browser powered by self-developed Chromium designed for web crawlers and AI Agents.👉Try Now
Back to Blog

Browser Automation Over MCP: Drive a Cloud Browser With Scrapeless

Ethan Brown
Ethan Brown

Advanced Bot Mitigation Engineer

22-Jul-2026

TL;DR:

  • The Scrapeless MCP Server exposes 16 browser_* tools that drive a hosted cloud browser, so a script can click, scroll, navigate, and read rendered pages with no local Chromium.
  • browser_create returns a session id, and every later call, browser_goto, browser_get_text, browser_close, carries that id to act on the same browser.
  • The tools render JavaScript: navigating a client-rendered quotes page and reading it back returns 10 rendered quotes.
  • This is the counterpart to scrape_markdown: use the content tool for a page you can fetch in one call, and the browser tools when the page needs interaction or waiting.
  • No model-provider key is involved, because the browser tools are called directly through the MCP session.
  • Start on the Scrapeless free plan and drive your first cloud browser.

Some pages do not give up their content to a single request. The data appears after a click, a scroll, or a wait for a script to run, and a one-shot fetch returns the shell before any of that happens. The Scrapeless MCP Server answers this with a set of browser tools that drive a real cloud browser over the Model Context Protocol, so your code issues high-level actions and the browser runs on Scrapeless infrastructure.

This guide connects to the server, lists the browser tools, and drives one session from creation to a rendered read to a clean close, all verified against the live server and the live browser. There is no model in the loop, so nothing here is a gap.

Why the Scrapeless Browser Tools

The Scrapeless MCP Server serves 21 tools, and 16 of them are browser controls: creation and teardown, navigation, clicking, typing, scrolling, key presses, screenshots, and waits. They drive a hosted Scrapeless cloud browser, which is the same kind of programmatic control a local automation stack gets from the Chrome DevTools Protocol, except the browser is remote and there is nothing to install. The Scrapeless Scraping Browser post covers that cloud browser and its concurrency model in depth.

These sit alongside the content tools. scrape_markdown returns a page in one call and is the right choice when a fetch is enough. The browser_* tools are for the pages that need a session: interact, wait, then read.

Prerequisites

  • Python 3.10 or later.
  • A Scrapeless API key from the dashboard, exported as SCRAPELESS_API_KEY.
  • No local browser. The tools drive a cloud browser on Scrapeless.

Install

Install the MCP client library.

bash Copy
pip install mcp

Set your Scrapeless key in the shell. Use the real key at run time and keep the placeholder out of your source.

bash Copy
export SCRAPELESS_API_KEY="sk_your_key_here"

Connect and List the Browser Tools

Open a streamable-HTTP connection to the server, initialize the session, and list the tools. Filtering to the browser_ prefix shows the interaction vocabulary the cloud browser offers.

python Copy
import asyncio
import os

from mcp import ClientSession
from mcp.client.streamable_http import streamablehttp_client


async def main() -> None:
    async with streamablehttp_client(
        "https://api.scrapeless.com/mcp", headers={"x-api-token": os.environ["SCRAPELESS_API_KEY"]}
    ) as (read, write, _):
        async with ClientSession(read, write) as session:
            await session.initialize()
            names = sorted(tool.name for tool in (await session.list_tools()).tools)
            browser_tools = [name for name in names if name.startswith("browser_")]
            print("total tools:", len(names))
            print("browser tools:", len(browser_tools))
            print(", ".join(browser_tools))


asyncio.run(main())

The server reports 21 tools, 16 of them browser controls.

text Copy
total tools: 21
browser tools: 16
browser_click, browser_close, browser_create, browser_get_html, browser_get_text, browser_go_back, browser_go_forward, browser_goto, browser_press_key, browser_screenshot, browser_scroll, browser_scroll_to, browser_snapshot, browser_type, browser_wait, browser_wait_for

The transport and message layer follow the Model Context Protocol specification, which rides on the JSON-RPC 2.0 specification.

Drive a Browser Session

The browser tools are stateful, so the pattern is create, act, read, close. browser_create returns a session id in its text; capture it and pass it to every later call. The example navigates to a JavaScript-rendered quotes page and reads the rendered text back.

python Copy
import asyncio
import os
import re

from mcp import ClientSession
from mcp.client.streamable_http import streamablehttp_client


def text_of(result) -> str:
    return "\n".join(block.text for block in result.content if getattr(block, "type", None) == "text")


async def main() -> None:
    async with streamablehttp_client(
        "https://api.scrapeless.com/mcp", headers={"x-api-token": os.environ["SCRAPELESS_API_KEY"]}
    ) as (read, write, _):
        async with ClientSession(read, write) as session:
            await session.initialize()

            created = text_of(await session.call_tool("browser_create", {}))
            session_id = re.search(r"ID:\s*([a-z0-9-]+)", created).group(1)
            print("session created:", bool(session_id))

            await session.call_tool("browser_goto", {"sessionId": session_id, "url": "https://quotes.toscrape.com/js/"})
            text = text_of(await session.call_tool("browser_get_text", {"sessionId": session_id}))
            print("quotes rendered:", text.count("Tags:"))
            print("contains a quote:", "The world as we have created it" in text)

            await session.call_tool("browser_close", {"sessionId": session_id})
            print("session closed: True")


asyncio.run(main())

The quotes page draws its content with JavaScript, and the cloud browser runs it, so browser_get_text returns the rendered quotes rather than an empty shell.

text Copy
session created: True
quotes rendered: 10
contains a quote: True
session closed: True

The 10 rendered quotes are the proof that the browser executed the page's JavaScript; a plain fetch of the same URL returns zero. From here, browser_click, browser_type, and browser_scroll extend the session to pages that need interaction before the content appears, and browser_close releases the cloud browser when the work is done.

Conclusion

The Scrapeless MCP browser tools turn a cloud browser into a set of high-level actions any MCP client can call. Connect, list the 16 browser tools, create a session, navigate, read the rendered text, and close, all with no local browser and no model in the loop. Reach for scrape_markdown when one call gets the page, and for the browser tools when the page needs a session to give up its content. Start from the scripts above and add the clicks, types, and scrolls your target requires.

Create a free Scrapeless account to get an API key, and check Scrapeless pricing when you plan a recurring job.

FAQ

Q: Do the Scrapeless MCP browser tools need a local browser?

No. The browser_* tools drive a hosted cloud browser on Scrapeless, so a script controls a real browser without a local Chromium install. That is the difference from a local automation stack: the browser runs remotely and you issue actions over the MCP session.

Q: How do the browser tools keep state between calls?

browser_create returns a session id, and every subsequent call passes that id in its sessionId argument. The id ties browser_goto, browser_get_text, and the interaction tools to the same browser, which is how a multi-step flow acts on one page rather than starting over each call.

Q: How is this different from scrape_markdown?

scrape_markdown fetches and returns a page in a single call, which is ideal when the content is there to read. The browser tools open a stateful session for pages that need clicks, typing, scrolling, or a wait before the content exists, and they return the rendered result the content tool cannot reach on those pages.

Q: Do the browser tools render JavaScript?

Yes. The cloud browser executes the page's scripts, so navigating a client-rendered page and calling browser_get_text returns the rendered content, which in the verified run was 10 quotes from a JavaScript quotes page. A plain fetch of the same page returns none of them.

Q: Which browser tools are available?

The server exposes 16: browser_create, browser_close, browser_goto, browser_go_back, browser_go_forward, browser_get_text, browser_get_html, browser_click, browser_type, browser_press_key, browser_scroll, browser_scroll_to, browser_screenshot, browser_snapshot, browser_wait, and browser_wait_for. Together they cover navigation, interaction, waiting, and reading.

Q: Do I need a model-provider key to use the browser tools?

No. The browser tools are called directly through the MCP session with only the Scrapeless API key, since there is no model deciding which tool to call. A model-provider key would only matter if you handed these tools to an agent framework and let a model drive them.

At Scrapeless, we only access publicly available data while strictly complying with applicable laws, regulations, and website privacy policies. The content in this blog is for demonstration purposes only and does not involve any illegal or infringing activities. We make no guarantees and disclaim all liability for the use of information from this blog or third-party links. Before engaging in any scraping activities, consult your legal advisor and review the target website's terms of service or obtain the necessary permissions.

Most Popular Articles

Catalogue