Schemaguard

io.github.sethclawd-prog由 GitHub 帳號 sethclawd-prog 發布v0.1.2更新於 Oct 24, 2026

API Schema Drift Monitor — detect breaking changes in OpenAPI specs

已驗證STDIO僅桌面開發者工具資料與分析

概覽

AI 產生的概覽

比較兩份 OpenAPI 規格以標記破壞性 API 變更並檢查規格品質,支援 CI 結束碼與 JSON 輸出。

可以做什麼
SchemGuard 是一套 API 結構描述漂移監控工具,會將 OpenAPI 規格與基準版本進行差異比對並回報變更。它會把發現的問題分類為破壞性變更(例如 endpoint-removed、field-type-changed、enum-value-removed、auth-requirement-changed)與非破壞性變更(例如 endpoint-added、description-changed、deprecated)。它也能檢查規格中的問題,例如缺少 operationId、缺少描述以及缺少安全機制,並可輸出結構化 JSON 供程式使用。
適用情境
當助理需要在部署前判斷某項 API 變更是否會破壞下游使用方,或需要審查規格品質時適用。它適合 CI 流程,以及將目前規格與已知良好基準進行比較的代理工作流程。
執行需求
以本機程序透過 stdio 執行,從 npm 套件 @sethclawd/schemaguard 安裝,因此需要 Node.js 與 npm。未宣告任何驗證、環境變數或標頭。它會讀取本機規格檔案。
安裝前請注意
ci 模式以結束碼表示結果:0 表示沒有破壞性變更,1 表示有破壞性變更,2 表示錯誤,這可能會阻擋流程。它會從本機檔案系統讀取規格檔案;未宣告任何憑證或網路存取。

安裝

在 SourceWeft 中

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

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

SchemGuard

API Schema Drift Monitor — detect breaking changes in OpenAPI specs before they break your consumers.

[npm version] [License: MIT]

Why

APIs break silently. A field gets renamed, an endpoint gets removed, an enum value disappears — and downstream consumers break in production. SchemGuard catches these before deploy.

Install

bash
npm install -g schemaguard

Usage

Diff two specs

bash
schemaguard diff old-api.yaml new-api.yaml

Output:

Found 11 change(s):
❌ BREAKING CHANGES (9):──────────────────────────────────────────────────  ⛔ [endpoint-removed]     Endpoint removed: DELETE /pets/{petId}     at: DELETE /pets/{petId}
  ⛔ [field-type-changed]     Parameter type changed: petId (string → integer)     at: GET /pets/{petId} > param petId  ...
🚨 9 breaking change(s) detected — deployment blocked.

CI mode

bash
schemaguard ci --spec ./openapi.yaml --baseline ./main-openapi.yaml
  • Exit 0 = no breaking changes, safe to deploy
  • Exit 1 = breaking changes detected, blocks the pipeline
  • Exit 2 = error (invalid spec, file not found)

Lint a spec

bash
schemaguard lint ./openapi.yaml

Checks for missing operationId, missing descriptions, no security schemes, etc.

JSON output

bash
schemaguard diff old.yaml new.yaml --format json

Returns structured JSON for programmatic consumption by agents and CI tools.

What it detects

Breaking changes (exit code 1)

RuleDescription
endpoint-removedAn endpoint was deleted
method-removedAn HTTP method was removed from a path
required-param-addedA new required parameter was added
param-removedAn existing parameter was removed
request-field-made-requiredA request field became required
field-type-changedA field's type was changed
response-field-removedA response field was removed
enum-value-removedAn enum value was narrowed
auth-requirement-changedSecurity schemes were modified
response-code-removedA response status code was removed

Non-breaking changes (info only)

RuleDescription
endpoint-addedA new endpoint was added
optional-param-addedA new optional parameter was added
response-field-addedA new response field was added
enum-value-addedAn enum value was widened
description-changedDescription or summary text changed
deprecatedAn endpoint was marked as deprecated

GitHub Actions

yaml
- name: Check API compatibility  run: npx schemaguard ci --spec ./openapi.yaml --baseline ./baseline.yaml

Programmatic API

typescript
import { parseSpec, diffSpecs, formatDiff } from 'schemaguard';
const oldSpec = parseSpec('./v1.yaml');const newSpec = parseSpec('./v2.yaml');const result = diffSpecs(oldSpec, newSpec);
if (result.hasBreakingChanges) {  console.log(`${result.breaking.length} breaking changes found`);}

License

MIT

來源:README.md,提交 3a87ea8

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

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

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分