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
| Tool | Description |
|---|---|
mrscrapermcp_scraperapi | Fetches a known page as HTML, Markdown, a screenshot, or a combination. |
mrscrapermcp_websearch | Searches the web and returns result URLs, titles, and descriptions. |
mrscrapermcp_status | Reports 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-dotenvnpm install @scalekit-sdk/node dotenvSet Your Credentials
Add your Scalekit credentials to a .env file:
SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
SCALEKIT_CLIENT_ID=<your-client-id>
SCALEKIT_CLIENT_SECRET=<your-client-secret>Create the MrScraper MCP Connection
- In the Scalekit dashboard, open AgentKit > Connections.
- Create a MrScraper MCP connection and copy its redirect URI.
- 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.
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)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.
| Field | Required | Description |
|---|---|---|
url | Yes | Absolute HTTP or HTTPS URL of the page to fetch. |
html | No | Returns the page's HTML. Defaults to true. |
markdown | No | Returns the page as Markdown. Defaults to false. |
screenshot | No | Captures a screenshot. Forces browser rendering. Defaults to false. |
browser_rendering | No | true forces browser rendering, false disables it, and auto lets the service decide. |
super | No | Routes the request through a real device. |
wait_for_selector | No | CSS selector to wait for before returning the page. Requires browser rendering. |
block_resources | No | Blocks images, CSS, and fonts. |
use_proxy | No | Allows the service's configured proxy. Defaults to true. |
proxy | No | Custom proxy as username:password@host:port. |
geo_code | No | Two-letter country code for proxy routing. Defaults to US. See Country Codes. |
proxy_country | No | Compatibility country option. |
bypass_proxy | No | Loads static assets such as images, fonts and stylesheets outside the residential proxy to save bandwidth. |
cookie_jar | No | Cookie configuration. |
headers | No | Request headers to send to the target page. |
home_page | No | Visits the site's home page before the target URL. |
max_retries | No | Maximum number of retries. Defaults to 3. |
timeout | No | Page timeout in seconds, from 1 to 300. Defaults to 120. |
token_cap | No | Running token total that stops further retries. |
The tool returns the status code, page data, and sanitized response headers.
mrscrapermcp_websearch
| Field | Required | Description |
|---|---|---|
url | Yes | Search query text. A search results URL also works. |
region | No | Two-letter country code for the search. Defaults to us. |
num_results | No | Number of results, from 10 to 100. Defaults to 10. |
timeout | No | Local 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
Dify
Connect MrScraper to Dify to fetch web pages, search the web, and check account usage from agents, chatflows, and workflows.
Python SDK
Install and use mrscraper-sdk, the typed async Python client for the MrScraper API, to fetch page content with the Scraper API and get real-time web search results with asyncio.