ScrapeGraph MCP Server is a production-ready implementation of the Model Context Protocol that connects language models to ScrapeGraph AI's web scraping API. It enables AI assistants to extract data from websites, convert webpages to markdown, perform multi-page crawling, and execute complex scraping workflows with minimal configuration.
First, you'll need to obtain an API key from the ScrapeGraph Dashboard.
The easiest way to install the server is using Smithery:
npx -y @smithery/cli install @ScrapeGraphAI/scrapegraph-mcp --client claude
After installing with Smithery, update your Claude Desktop configuration:
{
"mcpServers": {
"@ScrapeGraphAI-scrapegraph-mcp": {
"command": "npx",
"args": [
"-y",
"@smithery/cli@latest",
"run",
"@ScrapeGraphAI/scrapegraph-mcp",
"--config",
"\"{\\\"scrapegraphApiKey\\\":\\\"YOUR-SGAI-API-KEY\\\"}\""
]
}
}
}
The configuration file is located at:
%APPDATA%/Claude/claude_desktop_config.json~/Library/Application\ Support/Claude/claude_desktop_config.jsonFor manual installation:
git clone https://github.com/ScrapeGraphAI/scrapegraph-mcp
cd scrapegraph-mcp
pip install -e .
# macOS/Linux
export SGAI_API_KEY=your-api-key-here
# Windows (PowerShell)
$env:SGAI_API_KEY="your-api-key-here"
markdownifyTransform any webpage into clean markdown:
markdownify(website_url: str)
smartscraperExtract structured data with AI:
smartscraper(
user_prompt: str,
website_url: str,
number_of_scrolls: int = None,
markdown_only: bool = None
)
searchscraperExecute AI-powered web searches:
searchscraper(
user_prompt: str,
num_results: int = None,
number_of_scrolls: int = None
)
scrapeBasic page content fetching:
scrape(website_url: str, render_heavy_js: bool = None)
sitemapExtract website structure:
sitemap(website_url: str)
smartcrawler_initiateStart multi-page crawling:
smartcrawler_initiate(
url: str,
prompt: str = None,
extraction_mode: str = "ai",
depth: int = None,
max_pages: int = None,
same_domain_only: bool = None
)
smartcrawler_fetch_resultsRetrieve crawling results:
smartcrawler_fetch_results(request_id: str)
agentic_scrapperRun complex scraping workflows:
agentic_scrapper(
url: str,
user_prompt: str = None,
output_schema: dict = None,
steps: list = None,
ai_extraction: bool = None,
persistent_session: bool = None,
timeout_seconds: float = None
)
You can integrate the ScrapeGraph MCP server with Google's Agent Development Kit:
import os
from google.adk.agents import LlmAgent
from google.adk.tools.mcp_tool.mcp_toolset import MCPToolset
from google.adk.tools.mcp_tool.mcp_session_manager import StdioConnectionParams
from mcp import StdioServerParameters
# Path to the server script
SERVER_SCRIPT_PATH = "/path/to/scrapegraph-mcp/src/scrapegraph_mcp/server.py"
root_agent = LlmAgent(
model='gemini-2.0-flash',
name='scrapegraph_assistant_agent',
instruction='Help the user with web scraping using ScrapeGraph AI.',
tools=[
MCPToolset(
connection_params=StdioConnectionParams(
server_params=StdioServerParameters(
command='python3',
args=[SERVER_SCRIPT_PATH],
env={'SGAI_API_KEY': os.getenv('SGAI_API_KEY')},
),
timeout=300.0,)
)
)
],
)
"ScrapeGraph client not initialized"
"Error 401: Unauthorized"
"Error 402: Payment Required"
SmartCrawler not returning results
smartcrawler_fetch_results() until status is "completed"On Windows systems, you may need to use:
C:\Windows\System32\cmd.exe /c npx -y @smithery/cli@latest run @ScrapeGraphAI/scrapegraph-mcp --config "{\"scrapegraphApiKey\":\"YOUR-SGAI-API-KEY\"}"
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "ScrapeGraphAI-scrapegraph-mcp" '{"command":"npx","args":["-y","@smithery/cli@latest","run","@ScrapeGraphAI/scrapegraph-mcp","--config","\"{\\\"scrapegraphApiKey\\\":\\\"YOUR-SGAI-API-KEY\\\"}\""]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:
{
"mcpServers": {
"@ScrapeGraphAI-scrapegraph-mcp": {
"command": "npx",
"args": [
"-y",
"@smithery/cli@latest",
"run",
"@ScrapeGraphAI/scrapegraph-mcp",
"--config",
"\"{\\\"scrapegraphApiKey\\\":\\\"YOUR-SGAI-API-KEY\\\"}\""
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.json2. Add this to your configuration file:
{
"mcpServers": {
"@ScrapeGraphAI-scrapegraph-mcp": {
"command": "npx",
"args": [
"-y",
"@smithery/cli@latest",
"run",
"@ScrapeGraphAI/scrapegraph-mcp",
"--config",
"\"{\\\"scrapegraphApiKey\\\":\\\"YOUR-SGAI-API-KEY\\\"}\""
]
}
}
}
3. Restart Claude Desktop for the changes to take effect