Scalekit

Connect MrScraper MCP through Scalekit AgentKit to give your AI agents per-user web fetching, web search, and account usage tools.

Scalekit AgentKit offers a MrScraper MCP connector that lets your agents call the MrScraper MCP server on behalf of each of your users. Each user connects their own MrScraper account once through OAuth 2.1. Scalekit stores the token in an encrypted per-user vault, refreshes it automatically, and runs each tool call with that user's credentials, so tokens never enter the LLM context.

Available tools

ToolDescription
mrscrapermcp_scraperapiFetches a known page as HTML, Markdown, a screenshot, or a combination.
mrscrapermcp_websearchSearches the web and returns result URLs, titles, and descriptions.
mrscrapermcp_statusReports the account's subscription status, token limit, usage, remaining tokens, and rate limit.

All tools are read-only. To limit what an agent can do, expose only the tools it needs, for example only mrscrapermcp_websearch.

Prerequisites

Before you start, make sure you have:

  • A MrScraper account for each user who will connect.
  • A Scalekit account with AgentKit enabled.
  • Your Scalekit API credentials from Developers > API Credentials in the Scalekit dashboard.

Integration Steps

Install the Scalekit SDK

pip install scalekit-sdk-python python-dotenv
npm install @scalekit-sdk/node dotenv

Set Your Credentials

Add your Scalekit credentials to a .env file:

.env
SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
SCALEKIT_CLIENT_ID=<your-client-id>
SCALEKIT_CLIENT_SECRET=<your-client-secret>

Create the MrScraper MCP Connection

  1. In the Scalekit dashboard, open AgentKit > Connections.
  2. Create a MrScraper MCP connection and copy its redirect URI.
  3. Register an OAuth app with the MrScraper MCP server using that redirect URI, then enter the app's Client ID and Client Secret on the connection.

The connection name you choose is the name your code passes. The examples below use mrscrapermcp.

Authorize a User and Make a First Call

Generate an authorization link for a user, have them sign in to MrScraper, then call a tool with their identifier.

quickstart.py
import os
from scalekit import ScalekitClient
from dotenv import load_dotenv

load_dotenv()

scalekit_client = ScalekitClient(
    env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),
    client_id=os.getenv("SCALEKIT_CLIENT_ID"),
    client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),
)
actions = scalekit_client.actions

connection_name = "mrscrapermcp"
identifier = "user_123"

# Generate an authorization link for the user
link_response = actions.get_authorization_link(
    connection_name=connection_name,
    identifier=identifier,
)
print("Authorize MrScraper MCP:", link_response.link)
input("Press Enter after authorizing...")

# Check the user's MrScraper account
result = actions.execute_tool(
    tool_input={},
    tool_name="mrscrapermcp_status",
    connection_name=connection_name,
    identifier=identifier,
)
print(result)
quickstart.mts
import { ScalekitClient } from '@scalekit-sdk/node';
import 'dotenv/config';
import { createInterface } from 'node:readline/promises';

const scalekit = new ScalekitClient(
  process.env.SCALEKIT_ENVIRONMENT_URL,
  process.env.SCALEKIT_CLIENT_ID,
  process.env.SCALEKIT_CLIENT_SECRET,
);
const actions = scalekit.actions;

const connector = 'mrscrapermcp';
const identifier = 'user_123';

// Generate an authorization link for the user
const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier });
console.log('Authorize MrScraper MCP:', link);
const rl = createInterface({ input: process.stdin, output: process.stdout });
await rl.question('Press Enter after authorizing...');
rl.close();

// Check the user's MrScraper account
const result = await actions.executeTool({
  connector,
  identifier,
  toolName: 'mrscrapermcp_status',
  toolInput: {},
});
console.log(result);

Run it with npx tsx quickstart.mts.

Fetching a Page

Call mrscrapermcp_scraperapi with the page URL and the formats you want:

result = actions.execute_tool(
    tool_name="mrscrapermcp_scraperapi",
    tool_input={
        "url": "https://example.com",
        "markdown": True,
    },
    connection_name="mrscrapermcp",
    identifier="user_123",
)
const result = await actions.executeTool({
  toolName: 'mrscrapermcp_scraperapi',
  toolInput: {
    url: 'https://example.com',
    markdown: true,
  },
  connector: 'mrscrapermcp',
  identifier: 'user_123',
});

Tool Reference

mrscrapermcp_scraperapi

Retrieves a known page through the Scraper API. Only url is required.

FieldRequiredDescription
urlYesAbsolute HTTP or HTTPS URL of the page to fetch.
htmlNoReturns the page's HTML. Defaults to true.
markdownNoReturns the page as Markdown. Defaults to false.
screenshotNoCaptures a screenshot. Forces browser rendering. Defaults to false.
browser_renderingNotrue forces browser rendering, false disables it, and auto lets the service decide.
superNoRoutes the request through a real device.
wait_for_selectorNoCSS selector to wait for before returning the page. Requires browser rendering.
block_resourcesNoBlocks images, CSS, and fonts.
use_proxyNoAllows the service's configured proxy. Defaults to true.
proxyNoCustom proxy as username:password@host:port.
geo_codeNoTwo-letter country code for proxy routing. Defaults to US. See Country Codes.
proxy_countryNoCompatibility country option.
bypass_proxyNoLoads static assets such as images, fonts and stylesheets outside the residential proxy to save bandwidth.
cookie_jarNoCookie configuration.
headersNoRequest headers to send to the target page.
home_pageNoVisits the site's home page before the target URL.
max_retriesNoMaximum number of retries. Defaults to 3.
timeoutNoPage timeout in seconds, from 1 to 300. Defaults to 120.
token_capNoRunning token total that stops further retries.

The tool returns the status code, page data, and sanitized response headers.

mrscrapermcp_websearch

FieldRequiredDescription
urlYesSearch query text. A search results URL also works.
regionNoTwo-letter country code for the search. Defaults to us.
num_resultsNoNumber of results, from 10 to 100. Defaults to 10.
timeoutNoLocal deadline in seconds. Defaults to 600.

mrscrapermcp_status

Takes no input. Returns the account identity, subscription status, token limit, usage, remaining tokens, and rate limit. It reports account usage, not the progress of a request.

Using the Tools in an Agent Framework

Scalekit can return the MrScraper tools in a format ready for LangChain, OpenAI, Anthropic, and Google ADK agents. Fetch the tools scoped to a user, filtered to the mrscrapermcp connection and optionally to specific tool names, then pass them to your agent and run each tool call through Scalekit. See the Scalekit connector docs for framework-specific examples.

Revoking Access

When a user revokes their MrScraper connection in Scalekit, their later tool calls fail. Other users' connections are not affected.

Resources

On this page