Diffgrab

io.github.ArkNill由 GitHub 账号 ArkNill 发布v0.1.0更新于 Oct 24, 2026

Web page change tracking with structured diffs. markgrab + snapgrab integration.

概览

AI 生成的概览

跟踪网页内容变化,返回结构化差异、章节级分析和快照历史。

可以做什么
Diffgrab 可登记 URL 进行变更跟踪,抓取并保存基线快照,再通过内容哈希检测变化。它会生成统一差异、标明哪些标题发生变化的章节级分析,以及诸如新增或删除行数的人类可读摘要。五个 MCP 工具分别用于登记 URL、检查变更、获取快照间差异、浏览快照历史和停止跟踪。快照保存在本地 SQLite 数据库中。
适用场景
当助手需要监控页面更新、总结某页面自上次访问以来的变化,或比较同一 URL 的两个版本时使用。适合文档、新闻或政策页面等变化有意义的场景,而单纯抓取无法显示具体改动。
运行要求
作为本地 Python 包运行,从 PyPI 安装(pip install diffgrab,可选附加组件用于 CLI、视觉差异和 MCP)。MCP 服务器通过 diffgrab-mcp 命令或 uvx 启动。需要网络访问以抓取被跟踪的 URL,并将快照写入本地 SQLite 文件,默认位于用户数据目录下。未声明账户、API 密钥或环境变量。
安装前请注意
它会抓取你要求跟踪的 URL,因此这些请求和页面内容会到达目标站点,并保存在本地 SQLite 快照数据库中。跟踪和取消跟踪会改变存储状态,数据库会保留可能包含敏感内容的过往页面版本。可选的视觉差异功能会引入 snapgrab 包。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Diffgrab,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

diffgrab

[PyPI] [Python] [License]

한국어 문서 · llms.txt

Web page change tracking with structured diffs. markgrab + snapgrab integration, MCP native.

python
from diffgrab import DiffTracker
tracker = DiffTracker()await tracker.track("https://example.com")changes = await tracker.check()for c in changes:    if c.changed:        print(c.summary)     # "3 lines added, 1 lines removed in sections: Introduction."        print(c.unified_diff) # Standard unified diff outputawait tracker.close()

Features

  • Change detection — track any URL, detect content changes via content hashing
  • Structured diffs — unified diff + section-level analysis (which headings changed)
  • Human-readable summaries — "5 lines added, 2 removed in sections: Intro, Methods"
  • Snapshot history — SQLite storage, browse past versions of any page
  • markgrab powered — HTML/YouTube/PDF/DOCX extraction via markgrab
  • Visual diff — optional screenshot comparison via snapgrab
  • MCP server — 5 tools for Claude Code / MCP clients
  • CLI included — diffgrab track, check, diff, history, untrack

How It Works

mermaid
flowchart TD    A["diffgrab track URL"] --> B["Fetch initial snapshot\n(markgrab + snapgrab)"]    B --> C["Store baseline"]    C --> D["diffgrab check"]    D --> E["Fetch current page"]    E --> F{"Content\nhash match?"}    F -->|"changed"| G["Compute structured diff\n+ section analysis"]    F -->|"unchanged"| H["No changes"]    G --> I["📊 DiffResult\nadded / removed / modified"]

Install

bash
pip install diffgrab

Optional extras:

bash
pip install 'diffgrab[cli]'      # CLI with click + richpip install 'diffgrab[visual]'   # Visual diff with snapgrabpip install 'diffgrab[mcp]'      # MCP server with fastmcppip install 'diffgrab[all]'      # Everything

Usage

Python API

python
import asynciofrom diffgrab import DiffTracker
async def main():    tracker = DiffTracker()
    # Track a URL (takes initial snapshot)    await tracker.track("https://example.com", interval_hours=12)
    # Check for changes    changes = await tracker.check()    for change in changes:        if change.changed:            print(change.summary)            print(change.unified_diff)
    # Get diff between specific snapshots    result = await tracker.diff("https://example.com", before_id=1, after_id=2)
    # Browse snapshot history    history = await tracker.history("https://example.com", count=20)
    # Stop tracking    await tracker.untrack("https://example.com")
    await tracker.close()
asyncio.run(main())

Convenience Functions

python
from diffgrab import track, check, diff, history, untrack
await track("https://example.com")changes = await check()result = await diff("https://example.com")snaps = await history("https://example.com")await untrack("https://example.com")

CLI

bash
# Track a URLdiffgrab track https://example.com --interval 12
# Check all tracked URLs for changesdiffgrab check
# Check a specific URLdiffgrab check https://example.com
# Show diff between snapshotsdiffgrab diff https://example.comdiffgrab diff https://example.com --before 1 --after 3
# View snapshot historydiffgrab history https://example.com --count 20
# Stop trackingdiffgrab untrack https://example.com

MCP Server

Add to your Claude Code MCP config:

json
{  "mcpServers": {    "diffgrab": {      "command": "diffgrab-mcp",      "args": []    }  }}

Or with uvx:

json
{  "mcpServers": {    "diffgrab": {      "command": "uvx",      "args": ["--from", "diffgrab[mcp]", "diffgrab-mcp"]    }  }}

MCP Tools:

ToolDescription
track_urlRegister a URL for change tracking
check_changesCheck tracked URLs for changes
get_diffGet structured diff between snapshots
get_historyBrowse snapshot history
untrack_urlStop tracking a URL

DiffResult

Every diff operation returns a DiffResult:

python
@dataclassclass DiffResult:    url: str                           # The tracked URL    changed: bool                      # Whether content changed    added_lines: int                   # Lines added    removed_lines: int                 # Lines removed    changed_sections: list[str]        # Markdown headings with changes    unified_diff: str                  # Standard unified diff    summary: str                       # Human-readable summary    before_snapshot_id: int | None     # DB ID of older snapshot    after_snapshot_id: int | None      # DB ID of newer snapshot    before_timestamp: str              # When older snapshot was taken    after_timestamp: str               # When newer snapshot was taken

Storage

Snapshots are stored in SQLite at ~/.local/share/diffgrab/diffgrab.db (auto-created). Custom path:

python
tracker = DiffTracker(db_path="/path/to/custom.db")

QuartzUnit Ecosystem

PackageRolePyPI
markgrabHTML/YouTube/PDF/DOCX to markdownpip install markgrab
snapgrabURL to screenshot + metadatapip install snapgrab
docpickOCR + LLM document extractionpip install docpick
feedkitRSS feed collectionpip install feedkit
diffgrabWeb page change trackingpip install diffgrab
browsegrabBrowser agent for LLMsComing soon

Used in

  • newswatch — RSS news monitoring pipeline (feedkit → markgrab → embgrep → diffgrab)
  • watchdeck — Web page monitoring with visual diffs and safety guards

License

MIT


Part of the QuartzUnit ecosystem — composable Python libraries for data collection, extraction, search, and AI agent safety.

来源:README.md,提交 eb46df9

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.0最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分