Skip to content

Releases: guanyuyan/scrape-mcp

v0.4.0

Choose a tag to compare

@github-actions github-actions released this 20 Oct 07:38

Full Changelog: v0.3.0...v0.4.0

v0.3.0:结构化抽取深化、web_crawl、稳定错误码

Choose a tag to compare

@guanyuyan guanyuyan released this 20 Oct 06:11

亮点

  • web_crawl:从起始页按 depth 分层发现站内链接并逐页抓取,limit 控制总量,静态资源自动跳过;单页失败不影响整次
  • 结构化抽取深化:新增 object 类型与 list + fields 对象数组;支持 regex/group 正则提取、abs_url 相对链接转绝对、strip 开关
  • 输出格式:web_fetch / web_batch 支持 format=markdown|text|json
  • 稳定错误码:失败统一返回 error_code(timeout / dns / tls / connection / blocked / login_required / http_4xx / http_5xx / empty / denied / robots_disallowed / invalid_argument)
  • 同域并发闸门:同一主机默认最多 2 并发(HOST_MAX_CONCURRENCY),跨主机仍并行
  • 运维:GET /healthz 健康检查;提供 Dockerfile(--build-arg INSTALL_BROWSER=1 可打包 L2 浏览器)

修复

  • 4xx(如 404/410)错误页不再被当作有效内容返回,统一返回 error_code=http_4xx
  • 嵌套 schema 中的非法选择器会把对应字段置空,并在提示中带上完整字段路径

安装

pip install -U mcp-scrape==0.3.0
scrape-mcp --version

完整变更见 CHANGELOG.md。

v0.2.1

Choose a tag to compare

@guanyuyan guanyuyan released this 20 Oct 03:00

安装

pip install mcp-scrape
scrape-mcp --version   # 0.2.1

Added

  • CLI 零配置入口:scrape-mcp 默认以 stdio 运行,任意目录可用;支持 --transport / --port / --version / --help

Fixed

  • 修复全新安装时 selectolax>=1.0 废弃 modest 后端导致 ImportError、命令无法启动的问题;改用官方推荐的 lexbor 后端(LexborHTMLParser / LexborNode),依赖下限改为 selectolax>=0.4.11

Changed

  • PyPI 发行包名调整为 mcp-scrape(scrape-mcp 与已有项目 scrapemcp 归一化后同名,被 PyPI 拒绝);命令行工具名仍为 scrape-mcp

验证

  • ruff 检查通过,61 项单元测试全部通过
  • 全新虚拟环境实测:pip install mcp-scrape → scrape-mcp --version 输出 0.2.1;web_fetch / web_extract 核心链路正常

PyPI: https://pypi.org/project/mcp-scrape/0.2.1/

v0.2.0

Choose a tag to compare

@guanyuyan guanyuyan released this 18 Sep 09:28

Added

  • web_extract :按字段 schema 从 HTML 抽取结构化 JSON(text /attr /count /list 类型、简写选择器、default 兜底、missing 如实上报)
  • 阶段 0 合规:respect_robots (robots.txt 遵循)、allowed_hosts /denied_hosts 白黑名单、max_qps 全局限流
  • scripts/demo.py 、scripts/smoke_extract.py :一键演示与 HTTP 冒烟
  • README 增加 60 秒入门、MCP 客户端接入教程、真实站点实测用例集

Changed

  • 抓取逻辑提取为_fetch_html ,供web_fetch /web_extract 共用,避免重复抓取

Engineering

  • ruff + pre-commit 工程化配置,pyproject.toml 增加 dev 依赖与 lint 规则
  • CI 增加 ruff 检查步骤
  • CONTRIBUTING.md 、CODE_OF_CONDUCT.md ;README 增补发版流程

scrape-mcp v0.1.0

Choose a tag to compare

@guanyuyan guanyuyan released this 16 Sep 08:19

首个稳定发布:M1–M5 全链路落地。

特性:

  • web_fetch:反爬感知抓取,L1 curl_cffi -> L2 Playwright+Stealth 梯度升级
  • 极省 token 精简:密度选根 + DOM 剪枝,MDN 214KB -> 数百 token
  • 登录态持久化:login 手动登录落盘,自动带 Cookie/LocalStorage
  • 拦截如实上报:挑战页/登录墙/骨架页绝不伪装成成功
  • web_batch 并发抓取 + 磁盘缓存
  • stdio / streamable-http 双传输
  • 全配置化(.env / SCRAPE_MCP_*)