MCP server
The webclaw MCP (Model Context Protocol) server exposes the full extraction engine as tools that AI agents can call directly. Works with Claude Desktop, Claude Code, Cursor, Windsurf, OpenCode, Codex, Antigravity, and any MCP-compatible client.
What is MCP
Model Context Protocol is an open standard for connecting AI models to external tools and data sources. Instead of making HTTP calls manually, an AI agent discovers available tools through the MCP server and calls them natively. The webclaw MCP server communicates over stdio transport and exposes 12 tools covering scraping, crawling, extraction, and more.
Setup
Claude Desktop
Add webclaw to your Claude Desktop config file:
{
"mcpServers": {
"webclaw": {
"command": "npx",
"args": ["-y", "@webclaw/mcp"],
"env": {
"WEBCLAW_API_KEY": "<YOUR_API_KEY>"
}
}
}
}npx fetches the launcher automatically — no build or PATH setup. The WEBCLAW_API_KEY enables automatic cloud fallback for bot-protected pages and JavaScript-heavy sites. Without it, extraction uses local HTTP; success depends on the target page.
Claude Code
claude mcp add webclaw -- npx -y @webclaw/mcpUse the CLI command above to register the server in Claude Code. Check the client's MCP settings to confirm the server is connected.
Cursor
Add webclaw to your Cursor MCP config:
{
"mcpServers": {
"webclaw": {
"command": "npx",
"args": ["-y", "@webclaw/mcp"],
"env": {
"WEBCLAW_API_KEY": "<YOUR_API_KEY>"
}
}
}
}Windsurf
Add webclaw to your Windsurf MCP config:
{
"mcpServers": {
"webclaw": {
"command": "npx",
"args": ["-y", "@webclaw/mcp"],
"env": {
"WEBCLAW_API_KEY": "<YOUR_API_KEY>"
}
}
}
}OpenCode
Add webclaw to your OpenCode config:
{
"mcp": {
"webclaw": {
"type": "local",
"command": ["npx", "-y", "@webclaw/mcp"],
"enabled": true
}
}
}Codex
Add webclaw to your Codex config. Codex supports both a CLI and desktop app:
[mcp_servers.webclaw]
command = "npx"
args = ["-y", "@webclaw/mcp"]
enabled = trueAntigravity
Antigravity uses the same mcpServers JSON format as Claude Desktop:
{
"mcpServers": {
"webclaw": {
"command": "npx",
"args": ["-y", "@webclaw/mcp"],
"env": {
"WEBCLAW_API_KEY": "<YOUR_API_KEY>"
}
}
}
}Other MCP clients
Any MCP client that supports stdio transport can connect to webclaw-mcp. Point the client at the binary and it will discover all available tools through the standard MCP handshake.
Smart Fetch
The MCP server uses a local-first architecture. Most scrapes happen locally over HTTP (free, no API credits). When a page is bot-protected or JavaScript-heavy, it automatically falls back to the webclaw cloud API when a key is configured. The fallback may still fail; inspect the result.
Local HTTP fetch (no Webclaw API credits)
Detect bot-protected or JavaScript-heavy pages
Automatic cloud API fallback (requires WEBCLAW_API_KEY)
Environment variables
| Variable | Description |
|---|---|
WEBCLAW_API_KEY | Enables cloud fallback for bot-protected and JS-rendered sites |
OPENAI_API_KEY | Enables extract and summarize tools (OpenAI provider) |
OPENAI_BASE_URL | OpenAI-compatible endpoint for local or hosted compatible backends |
OPENAI_RESPONSE_FORMAT_TYPE | Response mode for OpenAI-compatible backends: json_object, json_schema, or text. Defaults to json_object. |
ANTHROPIC_API_KEY | Enables extract and summarize tools (Anthropic provider) |
ANTHROPIC_BASE_URL | Anthropic-compatible endpoint. Defaults to the official Anthropic API. |
OLLAMA_HOST | Custom Ollama URL (default: localhost:11434) |
OPENAI_RESPONSE_FORMAT_TYPE to text or json_schema if the backend rejects OpenAI's default JSON object mode.rmcp crate (the official Rust MCP SDK) and communicates over stdio. No network ports are opened.Tools
The MCP server exposes 12 tools. Their parameters and text results differ from hosted REST requests and responses.
1. scrape
Extract content from a single URL.
| Param | Type | Required | Description |
|---|---|---|---|
url | string | Yes | URL to scrape. |
format | string | No | Output format: markdown (default), llm, text, or json. |
include_selectors | string[] | No | CSS selectors to include exclusively. |
exclude_selectors | string[] | No | CSS selectors to remove. |
only_main_content | boolean | No | Extract only the main content element. |
browser | string | No | Browser profile: chrome, firefox, or random. |
cookies | string[] | No | Cookie name=value pairs for local HTTP requests. Not forwarded to cloud fallback. |
2. crawl
Crawl a website with BFS traversal.
| Param | Type | Required | Description |
|---|---|---|---|
url | string | Yes | Starting URL. |
depth | number | No | Max crawl depth. Default: 2. |
max_pages | number | No | Max pages to extract. Default: 50. |
concurrency | number | No | Concurrent requests. Default: 5. |
use_sitemap | boolean | No | Seed queue with sitemap URLs. |
format | string | No | Output format for each page. |
3. map
Discover URLs through sitemap parsing.
| Param | Type | Required | Description |
|---|---|---|---|
url | string | Yes | Base URL of the site to map. |
4. batch
Extract content from multiple URLs concurrently.
| Param | Type | Required | Description |
|---|---|---|---|
urls | string[] | Yes | Array of URLs to extract. |
format | string | No | Output format for each URL. |
concurrency | number | No | Max concurrent requests. Default: 5. |
5. extract
Extract structured JSON data using an LLM. Supports prompt-to-schema generation -- when only a prompt is provided (no schema), the LLM generates a JSON schema first, then extracts data matching it.
| Param | Type | Required | Description |
|---|---|---|---|
url | string | Yes | URL to extract data from. |
prompt | string | No* | Natural language extraction prompt. When provided without a schema, the LLM auto-generates a schema first. |
schema | object | No* | JSON schema object guiding the output structure. Provide schema, prompt, or both. |
6. summarize
Generate a concise summary of a web page.
| Param | Type | Required | Description |
|---|---|---|---|
url | string | Yes | URL to summarize. |
max_sentences | number | No | Requested sentence count. Default: 3. Model output may vary. |
7. diff
Track content changes between snapshots.
| Param | Type | Required | Description |
|---|---|---|---|
url | string | Yes | URL to scrape for current version. |
previous_snapshot | string | Yes | JSON string of a previous extraction result. |
8. brand
Extract brand identity (colors, fonts, logos) from a site.
| Param | Type | Required | Description |
|---|---|---|---|
url | string | Yes | URL of the site to analyze. |
9. list_extractors
Return the available vertical extractor catalog with names, labels, and URL patterns. Takes no parameters. See the vertical extractors reference for the full list.
10. vertical_scrape
Run a specific vertical extractor on a URL. Returns typed JSON with fields specific to the target site (Reddit, GitHub, Amazon, YouTube, and more).
| Param | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Extractor name, e.g. github_pr, reddit, amazon_product. |
url | string | Yes | URL that matches the extractor's claimed pattern. |
11. search
Search uses your configured local search provider when available, or the hosted API with a Webclaw key. Local-only options below are not forwarded on the hosted path. Results are returned as readable text.
| Param | Type | Required | Description |
|---|---|---|---|
query | string | Yes | Search query. |
num_results | integer | No | Number of results to return (default 5, max 10). |
scrape | boolean | No | Local search only: fetch each result page. Default: false. |
country | string | No | Local search only: country code, e.g. us, gb, it. |
lang | string | No | Local search only: language code, e.g. en, it. |
12. research
Run a deep, multi-source research investigation. Requires WEBCLAW_API_KEY.
| Param | Type | Required | Description |
|---|---|---|---|
query | string | Yes | Research query or question to investigate. |
topic | string | No | Topic hint to focus research, e.g. technology, finance. |
deep | boolean | No | Legacy option; the hosted API always runs deep research and ignores this flag. |
Example conversations
Here is how an AI agent might use the webclaw MCP tools in practice.
User
Scrape the Stripe pricing page and pull out all the plan names and prices.
Claude (using webclaw MCP)
I will use the extract tool to pull structured pricing data from the page.
{
"url": "https://stripe.com/pricing",
"prompt": "Extract all plan names, monthly prices, and included features"
}User
Crawl the Next.js docs and summarize the top 5 pages.
Claude (using webclaw MCP)
I will first map the site to discover pages, then crawl and summarize the most important ones.
{
"url": "https://nextjs.org/docs"
}{
"urls": [
"https://nextjs.org/docs",
"https://nextjs.org/docs/getting-started",
"https://nextjs.org/docs/routing",
"https://nextjs.org/docs/rendering",
"https://nextjs.org/docs/data-fetching"
],
"format": "llm"
}