web-scrapper-mcp
A portable MCP server that scrapes SPA/JS-rendered webpages and extracts structured API endpoint data. It uses headless Chromium to render JavaScript and provides tools for scraping, endpoint extraction, screenshots, and database seeding.
README
web-scrapper-mcp
A portable MCP server that scrapes SPA/JS-rendered webpages and extracts structured API endpoint data. Registered globally in VS Code — callable from any project without reimplementing scraping.
Why this exists
Most API documentation sites (FMP, Tapetide, etc.) are React SPAs. httpx fetches only an empty shell. This server uses headless Chromium (Playwright) to fully render JavaScript, then extracts structured content.
Tech Stack
- Python 3.14 + uv
- Playwright Python (headless Chromium)
- FastMCP
- markdownify
Installation
git clone <repo>
cd web-scrapper-mcp
uv sync
uv run playwright install chromium
cp .env.example .env
Configuration
Edit .env:
SCRAPER_OUTPUT_DIR=output # where screenshots are saved
SCRAPER_TIMEOUT_MS=30000 # page load timeout
# HTTPS_PROXY=http://proxy:8080 # optional — for Zscaler/corporate proxy
CLI Usage
# Generic scrape → markdown
uv run cli.py --url https://httpbin.org/html
# Scrape → plain text
uv run cli.py --url https://example.com --mode text
# Extract API endpoints (auto-detect site type)
uv run cli.py --url https://site.financialmodelingprep.com/developer/docs --mode endpoints
# Save endpoint JSON to file
uv run cli.py --url https://site.financialmodelingprep.com/developer/docs \
--mode endpoints --out output/fmp_endpoints.json
# Screenshot
uv run cli.py --url https://example.com --mode screenshot
MCP Server Tools
scrape_page(url, wait_for?, selector?, mode?, wait_ms?)
Generic SPA scraper. Returns the rendered page as markdown, HTML, or plain text.
| Param | Default | Description |
|---|---|---|
url |
required | URL to scrape |
wait_for |
networkidle |
Playwright wait state |
selector |
"" |
CSS selector to wait for |
mode |
markdown |
markdown | html | text |
wait_ms |
2000 |
Extra settle delay (ms) |
Returns: {content, page_title, url, word_count, mode}
extract_api_endpoints(url, site_type?)
Extracts structured endpoint data. Auto-detects site type or accepts explicit override.
Site types: swagger | redoc | stoplight | fmp | generic
Returns:
{
"endpoints": [
{
"method": "GET",
"path": "/api/v3/stock/price",
"summary": "Stock Price",
"description": "...",
"tags": ["Stock"],
"parameters": [{"name": "symbol", "in": "query", "required": true, "type": "string"}]
}
],
"count": 247,
"site_type": "fmp",
"url": "..."
}
screenshot_page(url, full_page?)
Takes a full-page screenshot. Returns the saved file path and base64-encoded PNG for inline display.
Returns: {saved_path, base64}
scrape_and_seed(url, db_path, source_name, site_type?)
Power tool: scrapes API docs and seeds a SQLite database directly. The target DB must have an endpoints table (created automatically if absent).
Returns: {seeded, skipped, source, db_path}
Project Structure
web-scrapper-mcp/
main.py ← FastMCP server (4 tools)
scraper.py ← Core Playwright engine
extractors/
__init__.py
generic.py ← Any URL → markdown/html/text
api_docs.py ← Auto-detect swagger/redoc/stoplight/fmp/generic
fmp.py ← FMP developer docs specific extractor
cli.py ← CLI: uv run cli.py --url ...
pyproject.toml
.env.example
.gitignore
README.md
.plan/ ← Architecture notes (gitignored)
output/ ← Screenshots and output files (gitignored)
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。