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 分

    请在仓库或注册中心条目中声明许可证。