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 分