Verifies token/cost savings claimed by AI context-reduction proxies via MCP tools.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Install β’ What it measures β’ Commands β’ Agent-native / MCP β’ FAQ
Vendor-neutral CLI that independently verifies the token and cost savings AI-coding-agent context-reduction proxies actually deliver, by running the proxy for real against a labeled task corpus instead of trusting the maintainer's own number.
TokenTrust ships as two complementary, equally first-class distributions: an npm package for
Node.js toolchains and a PyPI package for Python toolchains. Both install a tokentrust command
with the identical CLI surface, the same TT01-TT05 verification categories, and the same bundled
task corpus, so pick whichever matches your existing stack.
npm (Node.js):
No clone, no local build. npx fetches the published package and runs it directly. To install
it as a dependency instead: npm install -g tokentrust-cli.
pip (Python):
See python/README.md for the Python package's full documentation,
including a note on the one real behavioral difference between the two: the npm package's
js-tiktoken dependency bundles its tokenizer data for fully offline use, while the Python
package's tiktoken dependency fetches and caches that same public data on first use.
Real output from that exact command, run against this repo's own bundled task corpus:
That's a real run's output, not a hand-typed example -- npx tokentrust-cli invokes the exact
same dist/cli.js entry point (the tokentrust command name is unchanged), so it reproduces on
your machine with no clone required.
js-tiktoken), against every task in the corpus.--live mode verifies the estimate against a real,
provider-billed sample (opt-in, your own API key, gated behind --confirm-cost, capped at 5
tasks by default).--proxy more than once and TokenTrust runs
the identical task corpus through every named proxy side by side.rtk#582) gets caught automatically.| Flag | Description |
|---|---|
--proxy <name> | Proxy to verify. Repeatable, pass it more than once to run TT04's cross-tool comparison. Supported: rtk, headroom. Required. |
--repo <path> | Repo to measure against. Defaults to the current directory. |
--tasks <file> | Task corpus YAML file. Defaults to the bundled 23-task corpus. |
--live | Sample real, provider-billed tokens for the first proxy instead of estimating from pricing tables. Requires --confirm-cost. |
--confirm-cost | Confirms the estimated spend --live prints before any real API call is made. |
--live-max-tasks <n> | Max tasks sampled in --live mode. Defaults to 5. |
--format <terminal|json> | Report output format. Defaults to terminal. |
-h, --help | Show the help message and exit. |
This table (and the tokentrust mcp reference below) is verified against the actual --help
output of the published tokentrust-cli package, not an old copy. One known gap between
that live --help text and the table above is called out directly in the FAQ, instead of
silently repeating it.
--format json gives every category's claimed-vs-measured numbers as structured data, so a
script or agent can pull the comparison straight out with jq instead of parsing terminal text:
Exit code is 0 when the run completes with no gated failure, non-zero otherwise. The bundled
GitHub Action's --fail-on-regression maps that straight to a failed CI step, so a version-drift
regression breaks the build instead of shipping silently.
Add it to CI with the bundled GitHub Action (action/action.yml) so verification reruns
automatically whenever a proxy's version bumps:
Pin cli-version explicitly rather than relying on the Action's default. The Action deliberately
does not support latest for this input: pinning is a supply-chain safeguard, so a compromised
npm publish can't reach every workflow using this Action on its very next run without a
deliberate version bump on your part. The Action's own default for this input is an early
pre-TT04/TT05/MCP release -- omitting cli-version runs that old version, not the one this
README documents.
TokenTrust ships in the same dual CLI + MCP-server mode as Semgrep, Trivy, Snyk, and
SonarQube: one binary, one underlying verification engine, and a second, thin front door for
agents that speak MCP (Model Context Protocol) instead of a
shell. tokentrust mcp starts an MCP server over stdio, exposing a single tool,
verify_proxy_savings, that calls straight into the same runVerify() engine tokentrust verify uses -- no verification logic is duplicated, and the tool returns the exact structured
JSON report --format json already produces.
Point the client's server config at this binary with the mcp argument. For Claude Code,
Claude Desktop, or any other client that reads an mcpServers block:
| Field | Description |
|---|---|
verify_proxy_savings | Tool name. Mirrors verify's flags one-for-one, minus --format -- an MCP call is always machine-facing, so the tool always returns the structured JSON report. |
proxy (required) | A single proxy name ("rtk") or an array (["rtk", "headroom"]) to run the TT04 cross-tool comparison in one call. Supported: rtk, headroom. |
repo | Same as --repo. Defaults to the MCP server process's current working directory. |
tasks | Same as --tasks. Defaults to the bundled task corpus. |
live / confirmCost | Same --live/--confirm-cost safety gate as the CLI: no live, provider-billed API call is made unless BOTH are explicitly true in the same call. Neither has a default of true. |
liveMaxTasks | Same as --live-max-tasks. Defaults to 5. |
This is the tool's real, unedited tools/list schema, captured from a running tokentrust mcp
server (inputSchema trimmed of per-field descriptions here for length; the live server returns
them in full):
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/tokentrust)<a href="https://allmcps.com/mcp/tokentrust"><img src="https://allmcps.com/api/badge/tokentrust?style=directory" alt="Tokentrust on AllMCPs" /></a>