
Fresh402
io.github.kirillradchenko96v1.1.1更新於 Oct 8, 2026
Detect webpage and API changes. Free baseline; $0.005 USDC per check via x402 on Base.
概覽
讓助理註冊網頁或 API 端點,並在進行昂貴的抓取或推理前,以低成本檢查內容是否已變更。
- 功能
- Fresh402 是一個遠端新鮮度判定服務。免費的 fresh402_register 工具會為某個 URL 建立或取回持久基準並回傳 watch_id;付費的 fresh402_check 工具會回報該資源是否出現實質變更,可選擇附上確定性的差異摘要。它支援 HTML 選擇器範圍限定、忽略選擇器、正規化 JSON 與萬用字元 JSON Pointer 忽略路徑、ETag 與 Last-Modified 重新驗證,以及有界的快照歷史。REST 介面涵蓋註冊、檢查、歷史、差異與統計。
- 適用情境
- 適合助理需要反覆監控頁面或 API 回應,並希望在花費瀏覽器工作階段、爬蟲、API 呼叫或 LLM 上下文之前,先做一次低成本判斷的情境。最適合能處理 x402 付款、並希望取得降噪變更偵測而非完整內容抓取的代理。
- 執行需求
- 遠端 Streamable HTTP 端點 API 金鑰。檢查工具每次呼叫在 Base 主網上透過 x402 付款協定花費 0.005 USDC,因此付費檢查需要相容於 x402 的用戶端與已儲值的 USDC 錢包。需要能連線至該端點及被監控的目標。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Fresh402,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。
其他 MCP 客戶端
把它新增到你客戶端的 mcpServers 設定中。
{
"mcpServers": {
"fresh402": {
"type": "http",
"url": "https://fresh402.kirilllabs.workers.dev/mcp"
}
}
}README
Fresh402
A low-cost freshness oracle for AI agents, powered by x402.
Fresh402 lets an AI agent register a web resource once, then cheaply check whether it has materially changed before spending money on a browser session, scraper, API call, or LLM context.
- Free baseline registration
- $0.005 USDC per freshness check
- REST API
- MCP support
- x402 payments on Base mainnet
- Persistent watch IDs
- HTML, JSON, and text monitoring
- Noise filtering and deterministic diffs
Why Fresh402?
AI agents often need to answer a simple question:
Has this resource changed since the last time I looked at it?
Fetching, rendering, parsing, and sending an entire page through an LLM can cost much more than answering that question.
Fresh402 acts as a cheap first step:
- Register a resource for free.
- Receive a persistent
watch_id. - Ask Fresh402 whether it changed.
- Only perform expensive downstream work when necessary.
Live API
Production:
Health and service metadata:
Pricing
Quick start
1. Register a baseline
Registration is free.
Example response:
Registering the same resource again returns the existing baseline without refetching it.
That prevents the free registration endpoint from being used as a free repeated freshness check.
2. Check the resource
Without payment, Fresh402 returns an x402 payment requirement.
The current price is $0.005 USDC on Base mainnet (eip155:8453).
An x402-compatible client can satisfy the payment requirement and retry the request automatically.
REST API
POST /v1/register
Create or retrieve a persistent baseline for free.
Example with HTML scoping:
For JSON resources:
Wildcard * JSON Pointer segments are supported.
POST /v1/check
Paid freshness check.
Supported inputs include:
watch_idurlprevious_hashselectorignore_selectorsignore_json_pathsmax_age_secondsinclude_diff
max_age_seconds lets agents reuse sufficiently fresh shared Fresh402 state instead of forcing another upstream fetch.
GET /v1/history
Retrieve stored snapshot history using a watch_id or URL.
GET /v1/diff
Retrieve change information for a watched resource.
GET /v1/stats
Retrieve public service usage statistics.
MCP
Fresh402 exposes a Streamable HTTP MCP endpoint:
Available tools:
fresh402_register
Free.
Creates or retrieves a persistent baseline and returns a watch_id.
fresh402_check
Costs $0.005 USDC.
Checks whether a registered or caller-supplied resource changed.
The tool exposes x402 payment metadata so compatible agents can discover and pay for the operation programmatically.
Change detection
Fresh402 is designed to reduce false positives from irrelevant page noise.
HTML selector scoping
Monitor only part of a page:
HTML noise filtering
Remove volatile elements before fingerprinting:
Canonical JSON
JSON is canonicalized before hashing, so object key ordering does not cause false changes.
JSON Pointer ignores
Known volatile JSON fields can be removed before fingerprinting.
Conditional HTTP revalidation
Fresh402 can use upstream ETag and Last-Modified metadata when available.
Deterministic diff
When comparable previous content exists, include_diff: true can return a compact deterministic change summary.
Persistent watches
Fresh402 v1.1 introduced persistent agent watches.
A registered resource receives a stable identifier:
Fresh402 stores watch state and bounded snapshot history in Cloudflare D1.
Repeated free registration does not refresh an existing watch. A paid check is required to fetch fresh upstream state.
Architecture
Fresh402 currently uses:
- Cloudflare Workers
- Cloudflare D1
- Coinbase / CDP x402 infrastructure
- Base mainnet
- USDC
- Model Context Protocol (MCP)
- TypeScript
The goal is to keep freshness checks cheap enough that agents can use Fresh402 before more expensive browsing, scraping, or reasoning work.
Security
Fresh402 validates outbound targets and includes protections intended to reduce SSRF risk.
Payment credentials and deployment secrets are supplied through runtime environment configuration and are not stored in this repository.
Resource limits
- New free registrations (REST and MCP combined) are limited to 10 attempts per target hostname and 60 attempts overall per 60 seconds, in each Cloudflare location. Paths, queries, ports and selector/ignore-rule variants share the hostname limit. Failed upstream attempts also consume quota. Existing watches are returned without a fetch or quota charge; paid checks do not use these limits.
- REST returns
429 registration_rate_limitedwithRetry-After: 60when a limit is reached. Missing or unavailable rate limit bindings return503 registration_unavailablefor new registrations. MCP reports these through the existing tool-error path. - Every incoming POST body is capped at 65,536 bytes before JSON parsing, payment handling, MCP dispatch or cloning (
413 request_too_large). Reading an incoming body has a 10-second deadline (408 request_timeout). - Upstream response bodies are streamed with a 5,000,000-byte limit (
413 content_too_large), including whenContent-Lengthis absent or misleading. A single 10-second deadline covers redirects, headers and body reading (504 upstream_timeout). Unused and rejected streams are cancelled. - Concurrent creation of the same watch saves only one baseline and one initial snapshot. A losing free registration returns the stored baseline; overlapping initial requests can still perform separate upstream fetches, subject to the registration limits.
The two rate limit bindings and their thresholds are declared in wrangler.jsonc; keep their namespace IDs unique within the Cloudflare account. These Cloudflare limits are local to each location and eventually consistent. They mitigate bursts but are not a strict worldwide quota or a storage/billing cap. Legitimate users sharing a target hostname also share its allowance. The global_fetch_strictly_public compatibility flag remains enabled to protect against private addresses reached through DNS.
Local verification
Use Node.js 24, then run:
Tests use a local Workers runtime, isolated D1 data and mocked upstream requests. They do not require payment credentials or access production. GitHub Actions runs these same checks on pull requests and pushes to main; the workflow has no deployment step.
Current release
v1.1.1
Highlights:
- Persistent
watch_id - Free baseline registration
- Anti-free-refresh behavior
- HTML selector scoping
- HTML ignore selectors
- Canonical JSON monitoring
- Wildcard JSON Pointer ignore paths
- Shared freshness caching
- Caller-supplied
previous_hash - Deterministic inline diff
- ETag / Last-Modified revalidation
- Bounded snapshot retention
- REST and MCP support
Status
Fresh402 is live and usable today.
The project is still early and the API may evolve as real agent usage patterns become clearer.
Author
Built and maintained by Kirill Radchenko.
Issues, integrations, feedback, and AI-agent use cases are welcome.
來源:README.md,提交 3378225
工具
0版本歷史
1- v1.1.1最新Oct 8, 2026

