Token导航 LogoToken导航TokenDH.com
MCP Crawler (Tai Dt) logo
开发工具stdio官方级别未说明来源级核验

MCP Crawler (Tai Dt)

MCP Server

一个基于Selenium的网页数据爬取和提取服务器,支持多种数据提取方式和REST API接口。

工具数

16

提示词数

0

GitHub Stars

3

资源数

0
网页爬取数据提取PythonClaude自动化测试Claude DesktopClaudeVS Code

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

Tai-DT

提供方

Tai-DT

最后核验

2026/5/17 20:22

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

python3 -m venv venv

详细介绍

🕷️ Selenium MCP Server

MCP server (stdio) sử dụng Selenium để crawl và trích xuất dữ liệu từ web pages bằng CSS/XPath selectors.

✨ Tính Năng

MCP Tools (17 tools)

ToolMô Tả
extractTrích xuất dữ liệu cơ bản với CSS/XPath selectors
analyze_pagePhân tích cấu trúc trang trước khi extract
smart_extractTự động detect loại trang và extract (products, article, all)
crawl_all_pagesCrawl nhiều trang với pagination
crawl_infinite_scrollXử lý lazy loading/infinite scroll
discover_siteKhám phá sitemap, categories, navigation
crawl_category_listCrawl nhiều category URLs
deep_crawlCrawl listing + chi tiết từng sản phẩm
extract_product_detailsExtract chi tiết từ danh sách URLs
export_resultsXuất CSV/JSON
take_screenshotChụp full-page screenshot
take_element_screenshotChụp screenshot của element cụ thể
manage_cookiesGet/Set/Clear browser cookies
login_and_extractĐăng nhập và extract từ trang protected
execute_javascriptThực thi JavaScript tùy chỉnh
get_page_metricsLấy performance metrics của trang

REST API Endpoints

Server cũng cung cấp REST API đầy đủ qua FastAPI:

  • POST /extract - Basic extraction
  • POST /smart-extract - Smart extraction
  • POST /analyze - Analyze page
  • POST /crawl/pages - Crawl with pagination
  • POST /crawl/infinite-scroll - Handle infinite scroll
  • POST /crawl/categories - Crawl categories
  • POST /crawl/deep - Deep crawl
  • POST /discover - Discover site
  • POST /products/details - Product details
  • POST /screenshot - Capture screenshot
  • POST /export - Export data
  • GET /jobs - List jobs
  • GET /outputs - List output files

🚀 Cài Đặt

# Clone repo
git clone https://github.com/Tai-DT/mcp-crawler.git
cd mcp-crawler

# Tạo virtual environment
python3 -m venv venv
source venv/bin/activate  # Linux/Mac
# hoặc: venv\Scripts\activate  # Windows

# Cài đặt dependencies
pip install -r requirements.txt

📦 Chạy Server

MCP Server (cho AI clients)

# Stdio mode (mặc định, cho MCP clients)
python3 selenium_mcp_server.py

# HTTP mode (cho debugging)
python3 selenium_mcp_server.py --transport streamable-http --host 127.0.0.1 --port 8000

REST API Server

python3 server_api.py
# API sẽ chạy tại http://localhost:8000

Docker

docker-compose up -d
# API: http://localhost:8000

⚙️ Cấu Hình MCP Client

VS Code (mcp.json)

{
  "servers": {
    "local/selenium-crawler": {
      "type": "stdio",
      "command": "/path/to/mcp-crawler/venv/bin/python",
      "args": ["/path/to/mcp-crawler/selenium_mcp_server.py"],
      "env": {}
    }
  }
}

Claude Desktop

{
  "mcpServers": {
    "selenium-crawler": {
      "command": "python3",
      "args": ["/path/to/mcp-crawler/selenium_mcp_server.py"]
    }
  }
}

📖 Ví Dụ Sử Dụng

Basic Extract

{
  "url": "https://example.com",
  "fields": {
    "title": "css:h1",
    "description": "css:p",
    "links": {"selector": "css:a", "attribute": "href", "multiple": true}
  }
}

Smart Extract Products

{
  "url": "https://shop.example.com/category",
  "extract_type": "products",
  "limit": 50,
  "normalize_prices": true
}

Deep Crawl

{
  "url": "https://shop.example.com/products",
  "follow_links": "products",
  "max_links": 20,
  "normalize_prices": true
}

Screenshot

{
  "url": "https://example.com",
  "full_page": true,
  "width": 1920,
  "height": 1080
}

Login and Extract

{
  "login_url": "https://example.com/login",
  "target_url": "https://example.com/dashboard",
  "username_selector": "css:#email",
  "password_selector": "css:#password",
  "submit_selector": "css:button[type='submit']",
  "username": "user@example.com",
  "password": "password123",
  "fields": {
    "welcome_message": "css:.welcome",
    "account_name": "css:.account-name"
  }
}

🔄 Retry & Error Handling

Server có built-in retry với exponential backoff:

  • Max Retries: 3 lần
  • Initial Delay: 1 giây
  • Backoff Factor: 2x
  • Rate Limiting: 30 requests/phút

📁 Cấu Trúc Dự Án

mcp-crawler/
├── selenium_mcp_server.py  # MCP Server chính (17 tools)
├── server_api.py           # REST API (FastAPI)
├── crawler_engine.py       # Crawler engine core
├── extraction_utils.py     # Tiện ích xử lý dữ liệu
├── config.py               # Configuration management
├── retry_handler.py        # Retry & rate limiting
├── job_manager.py          # Job tracking & persistence
├── requirements.txt        # Python dependencies
├── Dockerfile              # Docker image
├── docker-compose.yml      # Docker Compose
├── outputs/                # Extracted data
│   └── screenshots/        # Captured screenshots
├── jobs/                   # Job history
└── scripts/                # Test scripts

🧪 Testing

# Test crawler engine
python3 test_mcp.py

# Smoke test MCP server
python3 scripts/smoke_test_stdio.py

📝 License

MIT

目录标签

目录标签

网页爬取数据提取PythonClaude自动化测试本地部署RESTAPISelenium

支持客户端

Claude DesktopClaudeVS Code

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

session

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

16

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiosession部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP