
costwright — agent budget analysis
io.github.hernaninversoPublished by GitHub account hernaninversov0.1.1Updated Oct 24, 2026
Static worst-case token-budget analysis for LLM-agent workflows + signed budget certificates.
Overview
A local MCP server that statically analyzes Python LLM-agent repos for worst-case token budgets and can issue signed budget certificates.
- What you can do
- Analyze a local Python repo (LangGraph, CrewAI, OpenAI Agents SDK) by AST without running it, returning pass/fail and counts of certifiable, default-dependent, non-certifiable and runaway units, plus LLM calls lacking token caps. Issue a signed, publicly logged budget certificate for a repo and get its id, signature and verification link. Verify an existing certificate by id, checking validity, expiry, revocation and signature. Fetch the active Ed25519 public keys for offline verification.
- When to use it
- Use it before deploying an agent workflow, to catch missing token caps and runaway loops the way a type check catches type errors. Useful when you want a verifiable, signed record of a workflow's worst-case budget ceiling.
- Requirements
- Runs locally via npx (Node.js). The check and certify tools need COSTWRIGHT_API_KEY, sent as an X-RapidAPI-Key header by default or as a Bearer token when COSTWRIGHT_DIRECT=1. Verify and pubkey need no key. Network access to the hosted costwright API is required.
Installation
In SourceWeft
- Open costwright — agent budget analysis in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
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
Setup
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.
Source: README.md at commit 14f87ae
Tools
0Version history
1- v0.1.1LatestSep 16, 2026
Score
40% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts
Declare a license in the repository or the registry entry.