validar-semver

io.github.encodiv1.0.1更新於 Sep 30, 2026

Resolves real semver range satisfaction (^1.2.3, ~2.0) against a version. Paid via x402/USDC.

已驗證Streamable HTTP可網頁執行Developer ToolsFinance

概覽

AI 產生的概覽

一個遠端 MCP 工具,使用 npm 所用的同一套 semver 引擎判斷版本是否符合版本範圍,並依每次呼叫以 USDC 收費。

功能
只提供一個工具 validate_semver,用來把某個版本(例如 1.2.3)與一組範圍(例如 ^1.2.3、~2.0、2.x、>=1.0.0 <2.0.0)進行比對判斷。它採用 npm 所用的 semver 引擎,而不是讓模型猜測是否相符。每次呼叫都是獨立的,呼叫之間沒有資料庫或持久狀態。
適用情境
適合需要可靠、確定性 semver 範圍判斷的情境,例如檢查相依套件更新、驗證版本限制,或回答某個發行版本是否符合某個範圍。如果只是偶爾做一次自己能判斷的檢查,就不一定要加入。
執行需求
透過 streamable HTTP 連線的遠端 MCP 端點,不需要本機執行環境或安裝套件。每次呼叫都需付費:透過 x402 在 Base 主網支付 0.01 USDC,付款資訊放在 MCP JSON-RPC 的 _meta 中,而非 HTTP 標頭。未付款的呼叫會回傳錯誤,並附上付款與重試所需的網路、金額與 payTo 資訊。
安裝前請注意
呼叫會產生真實費用:在 Base 主網上每次 0.01 USDC,重複或自動化使用會累積支出。付款透過 JSON-RPC 請求內的 x402 流程處理,且此伺服器是第三方遠端端點,因此版本與範圍參數會傳送給該營運方。README 提到,切換到測試網需要修改原始碼中的 NETWORK 設定。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 validar-semver,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "validar-semver": {
      "type": "http",
      "url": "https://validar-semver.encodari.workers.dev/mcp"
    }
  }
}

README

validar-semver

[validar-semver MCP server]

Remote MCP server (Cloudflare Workers) with one tool that resolves real semver range satisfaction:

  • validate_semver — evaluates a version (e.g. 1.2.3) against a list of ranges (^1.2.3, ~2.0, 2.x, >=1.0.0 <2.0.0, ...) using the same semver engine npm uses (semver), not a model guess about what should match.

No database, no persistent state: each call builds a fresh McpServer (see createServer() in src/index.ts) and is self-contained.

Billing (x402)

Charges per call via x402 — real USDC payment on Base mainnet, against the Coinbase Developer Platform (CDP) facilitator. The payment travels inside the MCP JSON-RPC itself (_meta), not as an HTTP header; see src/payments.ts.

ToolPrice
validate_semver$0.01 USDC

An unpaid tools/call returns isError: true with the accepts (network, amount, payTo) the client needs to pay and retry — not an unexplained exception.

Structure

src/  index.ts        # registers the tool in the McpServer and exposes the MCP HTTP handler  payments.ts     # x402 billing on Base mainnet via the CDP facilitator  tools/    semver.ts       # pure logic for validate_semver (testable without Workers)    semver.test.tsscripts/  dev-node.ts     # dev server that runs the handler in plain Node, no wrangler

Running it locally

⚠️ Note on wrangler dev: the real Cloudflare Workers runtime (workerd) requires macOS 13.5+. If your Mac has an older version, wrangler dev (and npm run dev) will fail. This project includes a plain-Node shim that runs the exact same fetch() handler without needing workerd.

1. Install dependencies

bash
npm install

2. Run the unit tests

bash
npm test

3a. If your wrangler dev works (macOS 13.5+, Linux, Windows)

bash
npm run dev

3b. If wrangler dev fails because of the macOS version

bash
npm run dev:node

Starts at http://localhost:8787/mcp, reading CDP credentials from ~/.mcp-tools-factory-credentials.env (shared across all tools in this factory).

4. Test with curl

bash
# 1) initializecurl -s -X POST http://localhost:8787/mcp \  -H "Content-Type: application/json" \  -H "Accept: application/json, text/event-stream" \  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"curl-test","version":"0.0.1"}}}'
# 2) tools/listcurl -s -X POST http://localhost:8787/mcp \  -H "Content-Type: application/json" \  -H "Accept: application/json, text/event-stream" \  -d '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}'
# 3) tools/call — validate_semvercurl -s -X POST http://localhost:8787/mcp \  -H "Content-Type: application/json" \  -H "Accept: application/json, text/event-stream" \  -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"validate_semver","arguments":{"version":"1.2.3","ranges":["^1.2.3","^1.3.0","~1.2.0","2.x"]}}}'

Responses come as Server-Sent Events (event: message + data: {...}); the data: line is the usual JSON-RPC response.

Deploy and listings

Deployed at https://validar-semver.encodari.workers.dev/mcp (Cloudflare Workers). Published on the official MCP registry, Smithery, mcp.so, and with an open PR to awesome-mcp-servers.

What it doesn't do (yet)

  • Charges on Base mainnet with real money. To switch back to testnet (Base Sepolia, eip155:84532) during development, change NETWORK in src/payments.ts.
  • No database or persistent state between calls (beyond the billing config, cached in memory per isolate — see src/payments.ts).

來源:README.md,提交 cba3724

工具

0
工具後設資料尚未被收錄。

版本歷史

1
  1. v1.0.1最新Sep 16, 2026