costwright — agent budget analysis

io.github.hernaninverso由 GitHub 帳號 hernaninverso 發布v0.1.1更新於 Oct 24, 2026

Static worst-case token-budget analysis for LLM-agent workflows + signed budget certificates.

概覽

AI 產生的概覽

一個本機 MCP 伺服器,對 Python LLM 代理程式儲存庫做靜態最壞情況 token 預算分析,並可簽發已簽章的預算憑證。

可以做什麼
以 AST 靜態分析本機 Python 儲存庫(LangGraph、CrewAI、OpenAI Agents SDK),不執行程式碼,回傳通過/失敗結果以及可認證、依賴預設值、不可認證與失控單元的數量,並指出缺少 token 上限的 LLM 呼叫。為儲存庫簽發已簽章並記錄到公開透明日誌的預算憑證,回傳憑證 ID、簽章與驗證連結。依 ID 驗證憑證,檢查有效性、過期、撤銷與簽章。取得目前的 Ed25519 公鑰以供離線驗證。
適用情境
在部署代理程式工作流程之前使用,像型別檢查找出型別錯誤那樣找出缺少的 token 上限與失控迴圈。當你需要一份可驗證、已簽章的工作流程最壞情況預算上限紀錄時也適用。
執行需求
透過 npx(Node.js)在本機執行。check 與 certify 工具需要 COSTWRIGHT_API_KEY,預設以 X-RapidAPI-Key 標頭送出,設定 COSTWRIGHT_DIRECT=1 時改以 Bearer 權杖送出。verify 與 pubkey 不需要金鑰。需要連線至託管 costwright API 的網路存取。
安裝前請注意
check 與 certify 會把儲存庫中 .py 檔案的 gzip 壓縮檔上傳至託管 API,原始碼會離開本機。API 金鑰透過環境變數以機密形式傳入。憑證會記錄到公開透明日誌,請留意標籤與憑證所揭露的資訊。verify 與 pubkey 為公開介面,無需憑證。

安裝

在 SourceWeft 中

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

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

其他 MCP 客戶端

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

README

costwright — MCP server

Static worst-case token-budget analysis for LLM-agent workflows. Point it at a Python repo using LangGraph / CrewAI / OpenAI-Agents-SDK and it reports — by pure AST analysis, without running the code — the worst-case budget ceiling of every workflow graph: which units are certifiable / default-dependent / non-certifiable / runaway, and which LLM calls have no token cap. Optionally issues an Ed25519-signed budget certificate logged to a public transparency log. Wraps the hosted costwright API; backed by a Lean 4 cost-soundness theorem.

Use it before deploying an agent workflow to catch missing token caps and while True: runaway drivers — the budget version of a type check.

Tools

ToolWhat it doesKey?
costwright_check(repo_path, policy?)Static budget analysis of a local repo. Returns pass/fail + counts of certifiable/default-dependent/non-certifiable/runaway units.yes
costwright_certify(repo_path, policy?, label?)Issues a signed, logged budget certificate. Returns cert_id + signature + verify_url.yes
costwright_verify(cert_id)Verify a certificate by id (valid/expired/revoked, signature check).public
costwright_pubkey()Active Ed25519 public keys for offline verification.public

Setup

json
{  "mcpServers": {    "costwright": {      "command": "npx",      "args": ["-y", "costwright-mcp"],      "env": { "COSTWRIGHT_API_KEY": "your_rapidapi_key" }    }  }}

The key is sent as X-RapidAPI-Key (RapidAPI channel) by default; set COSTWRIGHT_DIRECT=1 to send it as Authorization: Bearer for the direct channel. verify and pubkey work with no key.

check/certify build a .py-only gzip archive of repo_path client-side (excluding venv, node_modules, tests, etc.) and send it for analysis — your source is uploaded to the hosted API. See https://eleata.io/privacy/. MIT licensed.

來源:README.md,提交 14f87ae

工具

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

版本歷史

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

評分

已滿足適用檢查項的 40%

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

  • 近 30 天內可連通25 分

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

  • 已宣告認證方式10 分

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

  • 已列出工具15 分

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

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

    請在儲存庫或註冊中心條目中宣告授權條款。