The ScraperAPI MCP server enables LLM clients to retrieve and process web scraping requests using the ScraperAPI services.
- Full implementation of the Model Context Protocol specification
- Seamless integration with ScraperAPI for web scraping
- Simple setup with Python
┌───────────────┐ ┌───────────────────────┐ ┌───────────────┐
│ LLM Client │────▶│ Scraper MCP Server │────▶│ AI Model │
└───────────────┘ └───────────────────────┘ └───────────────┘
│
▼
┌──────────────────┐
│ ScraperAPI API │
└──────────────────┘
The ScraperAPI MCP Server is designed to run as a local server on your machine, your LLM client will launch it automatically when configured.
- Python 3.11+
Add this to your client configuration file:
{
"mcpServers": {
"ScraperAPI": {
"command": "python",
"args": ["-m", "scraperapi_mcp_server"],
"env": {
"API_KEY": "<YOUR_SCRAPERAPI_API_KEY>"
}
}
}
}Tip
If your command is not working (for example, you see a package not found error when trying to start the server), double-check the path you are using. To find the correct path, activate your virtual environment first, then run:
which <YOUR_COMMAND>scrape- Scrape a URL from the internet using ScraperAPI
- Parameters:
url(string, required): URL to scraperender(boolean, optional): Whether to render the page using JavaScript. Defaults toFalse. Set toTrueonly if the page requires JavaScript rendering to display its content.country_code(string, optional): Activate country geotargeting (ISO 2-letter code)premium(boolean, optional): Activate premium residential and mobile IPsultra_premium(boolean, optional): Activate advanced bypass mechanisms. Can not combine withpremiumdevice_type(string, optional): Set request to usemobileordesktopuser agents
- Returns: The scraped content as a string
- Please scrape this URL
<URL>. If you receive a 500 server error identify the website's geo-targeting and add the corresponding country_code to overcome geo-restrictions. If errors continues, upgrade the request to use premium proxies by adding premium=true. For persistent failures, activate ultra_premium=true to use enhanced anti-blocking measures. - Can you scrape URL
<URL>to extract<SPECIFIC_DATA>? If the request returns missing/incomplete<SPECIFIC_DATA>, set render=true to enable JS Rendering.
API_KEY: Your ScraperAPI API key.
- Open Claude Desktop Application
- Access the Settings Menu
- Click on the settings icon (typically a gear or three dots in the upper right corner)
- Select the "Developer" tab
- Click on "Edit Config" and paste the JSON configuration file.
-
Clone the repository:
git clone https://github.com/scraperapi/scraperapi-mcp cd scraperapi-mcp -
Install dependencies and run the package locally:
- Using Python:
# Create virtual environment and activate it python -m venv .venv source .venv/bin/activate # MacOS/Linux # OR .venv/Scripts/activate # Windows # Install the local package in editable mode pip install -e .
- Using Python:
- Using Python:
python -m scraperapi_mcp_server
python3 -m scraperapi_mcp_server --debugThis project uses pytest for testing.
# Install the package with test dependencies
pip install -e ".[test]"# Run All Tests
pytest
# Run Specific Test
pytest <TEST_FILE_PATH>