Haldwani Times
Haldwani Times
Technology

terse-mcp 0.52.1

terse-mcp 0.52.1
Photo / Illustration: Haldwani Times Editorial Desk

Skip to main content Switch to mobile version terse-mcp 0.52.1 Lossless-first compression layer for AI-agent tool outputs — byte-faithful on fields you mark critical, configurable lossy reduction only where you opt in.

pip install terse-mcp==0.52.1 Copy PIP instructions

Cut the tokens your AI agent spends reading tool output, without changing a single value it reads. terse is a drop-in proxy for any MCP server. It strips structural overhead from each result (repeated keys, repeated values, repeated nested shapes) and hands the model the same data, value for value, in a denser form. No decode step, no model in the loop.

Five GitHub-style issues cost 436 tokens (cl100k) as a server pretty-prints them, and 232 minified. What the model gets instead costs 181:

{"__terse_dict__":1,"legend":{"~0":[{"name":"bug","color":"d73a4a"}]}, "data":{"__terse_table__":1,"n":5,"cols":["number","state","title","user","labels","repo"], "rows":[[101,"open","Crash on empty cart",["ana","User"],"~0","acme/widgets"], [102,"open","Timeout on checkout",["ben","User"],"~0","acme/widgets"], ...], "subcols":{"user":{"cols":["login","type"]}}}} Lossless, and checked. Every transform has an exact inverse, and a round-trip gate asserts decompress(compress(x)) == x. Other tools in this space drop rows or old results to save tokens; terse only removes repetition.

Measured against the alternatives, on its best case. On real GitHub API payloads: 59.1% fewer tokens, against −6.5% for TOON and 4.5% for compressmcp on the same corpus (Benchmarks).

Measured on real sessions, priced at the billed rate. A replay of the maintainer's own Claude Code sessions: terse saves 22.6% of what the MCP results it handled would have cost, and 0.71% of the whole bill of the sessions that used it (What it is worth in real sessions).

Selective. It works per tool and passes through anything it can't shrink, so a result's body never grows. The one-time format primer (and its typed wrapper, #463) and fetch-backs of dropped values are extra costs; in the replay below they shrink the saving in short sessions without erasing it. terse stats shows what it saved.

What it is worth in real sessions

The 59.1% above is the codec on large, repetitive JSON. What it saves on a bill is smaller, and this section is the number to judge terse by. scripts/bench/replay_sessions.py matches every result terse changed to the Claude Code session it landed in, then prices the removed tokens on each later API call that re-read them at that call's billed rate (cache write first, cache read after, write again on a cache rebuild, nothing after compaction), and charges every terse.retrieve fetch-back to terse. No model calls; it reads the ledger and the transcripts already on disk.

Run on 2026-11-17 over transcripts from 2026-07-12 to 2026-11-17: 7,819 not under /tmp, 818 of them with a terse result. Test servers (the fake a/b/c echo servers, demo, probe, python*, and router handshake and test configs) were removed from a copy of the ledger first, and transcripts under /tmp (the test harness: 14 with a terse result) are left out of the summary; see #577. Some scripted claude -p probes run elsewhere are still in it (35 sessions with a terse result: the transcripts whose entrypoint is sdk-cli); without them the 1-5-call band is +10.6%. The join rate, 96.5% of the results terse changed, is measured over all transcripts.

What changed since the 2026-11-04 run: sessions that started before it reproduce it (23.3% of their MCP cost, 0.77% of the bill), so the lower totals come from the sessions since, about 1,500, roughly 100 of them with a terse result, which save 12-13% of their MCP cost (the range is where the 4 November cutoff falls). One tool's results got smaller, and the session primer moved onto another; how much of the drop each explains, against the newer sessions' different mix of tools, is not separated. secret.list_credentials got smaller upstream: its server has returned a brief list by default since 2026-10-07, and terse's mean saving per priced result fell from 5,612 tokens (cl100k) before that date to 111 since 4 November (129 and 24 results). kb.read.search did not get worse: it now carries the session primer more often than any other tool, since terse stopped attaching the primer to results Claude Code saves to a file (#495, #497, 2026-10-06), and 116 of the 219 primers in the replay rode on it. With the primer counted against it, kb.read.search comes out at -5.4% of its cost; on its own results, terse saves 4.7% (#593). codegraph_explore is not a cause: since keep_first and retract_after went live (2026-09-26, #252) terse drops fewer of its code blocks, so it saves 34-45% of their cost before fetch-backs where it saved 78%, but fetch-backs fell from 54% of that saving to under 4%, and the net saving is about the same (36% before, 34-44% since). MCP results through terse were 0.9% of what the newer sessions cost, against 1.8% before.

Why it is smaller than 59.1%:

Cache pricing. 96.9% of input tokens in the maintainer's sessions are cache reads, billed at a tenth of input price (measured 2026-09-22, 1,093 sessions). A removed token is mostly one that would have been re-read cheaply.

MCP results are a small share of a session. The MCP results that went through terse were about 1.7% of what all scanned sessions cost. In the 2026-10-07 shell replay (6,776 transcripts), shell output was 16.1% and file reads 7.1% of the whole bill, and no MCP proxy sees either.

The client already moves big results out. Claude Code saves an MCP result over 25,000 tokens (by default) or 50,000 characters to a file, showing the model a path and a preview; it also compacts long sessions. A result it saves to a file saves nothing through terse (72 in this replay), and terse keeps its primer out of it (#496).

So the value is narrow: a few large, repetitive results re-read across long sessions, with a lossless guarantee, and a replay that prices any change to what the agent reads.

Design: What Carries The Savings

terse reduces tokens two ways: one that carries the day-to-day value, and one that is harder for a competitor to copy. Keeping those straight is the whole positioning.

1. The lossless codec — the value. This is the lever that does the work. terse removes only structural overhead: pretty-print whitespace, keys repeated once per record, repeated values, repeated nested schema. The transformed bytes are the model's input — a denser but still legible representation, not an offload. There is no decode step, no ML model in the loop, and every transform has an exact inverse (a round-trip gate asserts decompress(compress(x)) == x over the whole corpus). This is the guarantee most tools in this space decline to make: headroom's JSON path is lossless on uniform arrays but falls back to dropping rows on larger/irregular record sets, recoverable only via a retrieve round-trip against a cache that expires (verified, v0.34.0; default 30-min TTL); Anthropic/OpenAI context-editing drops old tool results server-side. terse never silently mutates what the model sees — and "lossless" is the category, not the token count. In the session replay the one lossy rule, code blocks dropped from codegraph_explore behind a fetch handle, nets about a quarter of the saving after fetch-backs; this codec carries the rest, most of it on the credentials list. Its one honest caveat: the tabularization primitive is public (formats like TOON publish it standalone, MIT-licensed, ~40% on flat arrays), so a motivated competitor could clone the codec in a weekend.

2. The stateful cross-call diff — the axis nobody else can reach. It does not pay as shipped, but the reason is not what it looks like. When the same tool is called again — poll a list, re-read a file — terse emits a lossless delta against the prior result instead of the whole payload (~73% smaller on the repeated call in the model below). This is the one axis a stateless encoder architecturally cannot reach: TOON, headroom's stateless per-call compressor, and server-side history-pruning all pay the full column every call because none of them remember the last result — terse can only do it because it lives in the session as a transparent proxy.

That is an architectural claim, and it survives. The economic one does not, at this workload.

Re-derived 2026-09-22 over the full all-time ledger (4,461 blocks), superseding the 14-day #250 window that reported 1.9% / 3.7%:

decisions: compressed=3356 passthrough=659 unchanged=416 diff=30 diff reasons: diff_off=1387 joined=587 multiblock=444 no_prior=318 not_smaller_diff_args=251 emitted=26 not_smaller_same_args=4 The tier fires on 0.67% of blocks (30 of 4,461; 26 emitted diffs), while the live router's primer cost 502 tokens every turn at the time — re-read as cache_read on each one (the router primes lazily since #212: once per session, on its first terse result). diff_off=1387 is the largest single reason and is expected: #170 made diffing opt-in precisely because the primer paragraph costs more per turn than this hit rate returns.

But segment the attempts by whether the diff BASE had matching arguments, and the picture inverts (#419):

base args MATCH emitted 26 not_smaller_same_args 4 -> 87% win rate base args DIFFER emitted 0 not_smaller_diff_args 251 -> 0% win rate never re-called no_prior 318 When the diff gets a same-args base it wins 87% of the time. It almost never gets one. proxy.py:345 keeps one base slot per tool (self.last: dict[str, Any] # tool -> previous result object), so any interleaved call to that tool with different arguments evicts the base that would have paid. 251 attempts diffed against the wrong base.

So the tier is starved rather than weak, and an earlier edition of this section — which called the remaining exclusions "the workload" and said "no codec change reaches that" — is withdrawn. no_prior (318) is genuinely workload; the 251 are a data-structure choice.

But most of those 251 are not recoverable, and the probe says so. Classifying them by whether that tool's arguments can recur at all within a session:

115 (45.5%) WRITE kb.propose.merge_or_create / extend / delete — payload differs every call 60 (23.7%) QUERY kb.read.search — a different query string nearly every time 69 (27.3%) RE-READ runecho structure (36), kb.read.get (32) — args CAN recur 9 ( 3.6%) other Arg-keying moves the writes and queries from not_smaller_diff_args to no_prior — the same non-win, relabelled. Only ~69 are addressable, worth at most ~60 extra diffs at the measured 87%: roughly 26 → 86, a ~3.3x on a tier that fires on 0.67% of blocks, which had to clear the 502 tok/turn router primer (once per session since #212). Real and cheap, but small. #419 carries it at that reduced size. The drop tier is where the measured tokens are (#252, #271, #273): codegraph_explore's single rule accounts for 604,892 saved tokens in the 2026-09-22 ledger, 22.2% of all savings.

It remains opt-in and not the headline (#170). When a loop really does re-fetch mostly-unchanged results it compounds hard; short sessions with wide tool variety never exercise it. How often your loop repeats a call is yours to measure (terse stats).

Around those two sits the bundle that turns a byte filter into a control plane you don't want to rip out: MCP-native proxy packaging (transparent to any downstream server, no client-side reformatting), a live savings ledger (terse stats), a fluency-gated lossy escape hatch, and self-installing ops tooling (install-mcp, mcp-status) — each diff/lossy tier validated by a behavioral eval before it was ever shipped.

It is selective by design. Measurement on real tool output showed the win is strongly per-tool (0–30%): large on record/symbol-shaped verbose output, near-zero on already-minified or already-projected tools. So terse applies per-tool policy rather than compressing everything blindly.

terse transforms a tool's JSON output through a tiered, fully-lossless pipeline, then (optionally) serves it through a per-tool policy that decides which tiers run.

Tier 0 — minify: strip insignificant whitespace.

Tier 0 — tabularize: a list of uniform records becomes one header + value rows (keys written once, not once per record), recursively hoisting nested uniform-dict columns into a shared header.

Tier 0.5 — dictionary code: repeated string values and repeated whole subtrees are folded into an inline legend (~0, ~1, …) proven disjoint from every literal in the payload. Committed only when it actually saves tokens, so it never regresses.

Tier 0.6 — embedded JSON (opt-in, "embedded"): a string field that is itself a JSON document ({"response_text": json.dumps(body)}) is folded so the tiers above can reach it. Only when the original string can be rebuilt byte for byte.

Tier 0.65 — Python literal (opt-in, "pyliteral"): a text result that is a Python repr of data rather than JSON (str(rows) from mcp-server-sqlite) is read as that data and compressed. Only when repr of what was read is the original text exactly.

Tier 0.7 — cross-call diff (stateful, OPT-IN — "diff": true): when the same tool is called repeatedly, the proxy emits a lossless delta against the prior result instead of the full payload (the 91%-overlap headroom). Self-describing, verified to reconstruct exactly, and emitted only when smaller — falls back to the full form otherwise. Its validation program completed (fluency, nested-record coverage, and the drift soak — see Status), but the tier stays OFF by default since #170; opt in with proxy --diff / install-mcp --diff or a policy-file "diff": true. Record-shaped JSON gets a row/key diff; non-JSON results (file reads, source excerpts, log tails) get a separate content-defined-chunking (CDC) diff — a rolling hash cuts chunk boundaries by content, not position, so an edit anywhere only perturbs the chunk(s) it overlaps and the rest is sent as references to the prior result. Each shape keeps its own diff base per tool.

Cross-block join (ON by default): some MCP servers return one record per content block, so each block is a lone object the codec above can barely fold and the diff tier skips entirely (it reasons about one logical payload). When every text block of a result is a JSON object, the proxy joins them into one record array before compressing — so tabularize/dictionary fold across records and the whole result becomes diff-eligible. This changes the number of content blocks the client sees (N → 1), which the MCP spec permits (block count carries no meaning). Opt out with proxy --no-join-blocks / install-mcp --no-join-blocks or a policy-file "join_blocks": false; lossy field rules still resolve per block, before the join.

Tier 1 — lossy (opt-in, per field): truncate caps and annotates a field marked {"lossy":"truncate","max":N}, gated by an acceptable-loss check (only marked, non-critical fields may differ, each only as a valid truncation). drop-to-retrieve replaces a marked field with a handle, stores the original per session, and serves it back via a synthetic terse.retrieve tool the proxy injects — gated so a drop is accepted only if the handle resolves to the exact original. summarize (needs a model) is parsed but will not be built — it is closed permanently (#261), because a model in the proxy breaks terse's no-ML guarantee. It is warned and left lossless, and the schema keeps accepting it only so an existing policy does not fail to load. Off everywhere by default.

Every transform has an exact inverse, and a round-trip gate asserts decompress(compress(x)) == x over the whole corpus. The transformed bytes are the model's input — a denser but still-readable representation, not an offload.

The proxy also keeps a live savings ledger (on by default; --no-stats to opt out): one payload-free JSONL record per result — sizes, tokens, and the decision taken, never content — so terse stats can answer "how much did terse actually save me this week?" from real sessions, not just the synthetic corpus.

uv tool install terse-mcp # global `terse` CLI (or: pipx install terse-mcp) Or pip install terse-mcp into a virtualenv for library/embedded use.

docker build -t terse . docker run -i --rm terse # proxies the bundled demo server docker run -i --rm terse uvx some-mcp-server # proxies a real one -i is required — MCP stdio is stdin/stdout. Everything after the image name is the downstream server command; terse has no tools of its own, so with no downstream there is nothing to compress. The default is examples/demo_mcp_server.py, a stdlib-only server whose demo_orders tool returns a 40-record order book — you get back terse's compressed form of it (9,019 → 3,187 chars), which is the fastest way to see what the proxy does.

The image ships uv/uvx so uvx-launched servers work out of the box. Node is not installed — for an npx-launched server, build FROM this image and add it.

The build reads the version from git describe, so build from a normal git clone. Any context without a resolvable .git — a source tarball, or a git worktree whose .git is a pointer file — needs --build-arg TERSE_VERSION=0.3.1 instead.

Quick Start (under a minute)

terse sits between your MCP client and a server and shrinks the server's tool results in flight. No config needed — the proxy is lossless-everywhere by default:

# 1. Wrap ANY stdio MCP server. Your agent talks to it exactly as before; # terse compresses the results it returns, losslessly. terse proxy -- uvx some-mcp-server --flags # 2. See what it saved (the payload-free ledger is on by default): terse stats Want to eyeball the codec first, no server involved?

echo '[{"id":1,"state":"open","repo":"acme/widgets"},{"id":2,"state":"open","repo":"acme/widgets"},{"id":3,"state":"open","repo":"acme/widgets"},{"id":4,"state":"open","repo":"acme/widgets"},{"id":5,"state":"open","repo":"acme/widgets"},{"id":6,"state":"open","repo":"acme/widgets"}]' | terse gate - # → round-trip lossless: PASS ; cl100k 87 -> 78 (10.3% saved) (Savings grow with record count and repetition; on a single tiny object terse correctly declines and passes it through unchanged — it never inflates what it can't shrink.)

Does terse help my server?

The win is per-tool and terse only keeps what pays, so it never hurts — but it helps a lot more on some shapes than others. Point it at a server and run terse stats to see for real; as a rule of thumb:

Wire it into your MCP client (permanent)

install-mcp rewrites your MCP config to launch a server through terse — reversible, and transparent to the client. It needs a per-tool policy; the smallest useful one is:

echo '{"version":1,"defaults":{"tiers":["minify","tabularize","dictionary"]}}' > terse-policy.json # Claude Code, user scope (~/.claude.json) — wrap a server you've already registered by name: terse install-mcp --policy terse-policy.json # Project scope (a committed .mcp.json instead): terse install-mcp --policy terse-policy.json --scope project --file .mcp.json terse mcp-status # confirm what's wrapped terse uninstall-mcp # cleanly restore the original entry Other MCP clients (Cursor, etc.) read the same config shape — wherever a server is launched as cmd --flags, launch it as terse proxy -- cmd --flags to get the same effect. See USAGE.md for tuning a policy (terse tune) and reading terse stats.

From source (contributors): uv sync then uv run terse ...; uv run pytest is the lossless gate.

src/terse/ transforms.py lossless tiers (minify, tabularize, dict coding) + round-trip gate policy.py selective per-tool policy: load, match, apply proxy.py MCP stdio middleware: compress a downstream server's tool results multiproxy.py `proxy --config`: one process fronting several servers transport.py the downstream link: a subprocess (stdio) or Streamable HTTP lossy.py opt-in lossy primitives: truncate, drop-to-retrieve text_diff.py cross-call diff for non-JSON text results wirelog.py `--wire-log`: an exact record of every line through the proxy policy_gen.py write a lossless policy from a captured corpus droptune.py `tune --from-ledger`: verdicts for live drop rules install_mcp.py wrap / unwrap Claude Code MCP servers stats.py live savings ledger (payload-free) + the `terse stats` aggregation capture.py corpus capture (shape-tagged envelopes) + shape classifier measure.py per-payload + cross-tokenizer token measurement probes.py value-redundancy + cross-call-overlap ceiling probes fluency/ does a model read the compressed form as accurately as raw JSON? (questions / scoring / answerers / harnesses / pack behind one facade) tokenize.py cl100k / o200k token counting report.py markdown reports (savings, per-tool, probes, tokenizer, fluency) html_report.py charted HTML companion (inline SVG, no JS/CDN) for measure/verify cli.py entrypoint: gate / policy / compress / capture / measure / probe / validate / proxy / stats / fluency / tune / install-mcp / uninstall-mcp / mcp-status / verify scripts/ gen_stress_corpus.py synthetic stress corpus for the fluency eval; `--fleet-shapes` adds `synthetic.*` shapes a capture corpus cannot hold (#403) bench/ terse-vs-TOON token benchmark on a real GitHub-API corpus (fetch_corpus.sh, benchmark.py, diff_demo.py, toon_encode.mjs) bench/mcp_servers/ what terse does, zero-config, to popular third-party MCP servers (mcp_probe.py harness + pinned repo/web fixtures; BENCHMARKS §6) examples/ demo_mcp_server.py stdlib-only stdio MCP server; the container's default downstream, so `docker run` demonstrates the proxy without a real server tests/ round-trip, measurement, probe, policy, and fluency tests Dockerfile terse + the demo downstream, for registries and one-command trials policy.example.json selective policy encoding the measured per-tool insight corpus/ captured tool outputs (gitignored; may contain real data) Verify it yourself

terse sits in your agent's critical path, so it earns trust by inspection. See VERIFY.md for the full walkthrough — or generate a self-contained report (lossless gate + per-tool token savings) in one command:

terse verify --out reports/verify-report.md # bundled sample, zero setup terse verify --corpus corpus --out report.md # your own captured traffic terse verify --html --out reports/verify-report.md # + a charted HTML report alongside it terse verify --corpus corpus --json # machine-readable gate + savings (CI-checkable) Benchmarks: terse vs alternatives

Head-to-head token reduction on real, public GitHub API payloads (scripts/bench/) — large, nested, record-shaped output, where the codec does best. Lossless and verified per payload, counted in cl100k_base. The corpus is already-compact JSON, so every number is pure structural gain. For what this is worth in live sessions, see What it is worth in real sessions.

terse is not alone in this niche. A prior-art sweep (#298) found at least ten projects in the same space; three were installed and measured on 2026-09-22 against the same corpus (BENCHMARKS.md §4). The closest architectural match is compressmcp, an MCP-layer lossless JSON compressor — not TOON. An earlier edition of this section called TOON "the only directly-comparable public tool"; that is withdrawn.

Measured head-to-head, cl100k, all lossless-verified per payload:

(% = fewer cl100k tokens than raw; higher is better; bold = winner.)

terse wins decisively on real nested records. TOON still regresses in aggregate to −6.5% (worse than raw): it is built for flat, uniform arrays, while GitHub records are deeply nested and repeat subtrees (a PR embeds the same user/repo object 60 times), which terse's dictionary tier folds and TOON's tabular layout cannot. compressmcp is genuinely lossless but abbreviates keys only, which is a small win on nested records and a net loss on small objects, where its Keys: legend costs more than it saves.

TOON leads on flat, short-valued, uniform tables like gh_labels — the boundary is value repetition, not column width (a seeded width sweep found no clean crossover). Note that TOON 4.x narrowed this: it now wins 3 of the 9 payloads, not 1, all on the small and shallow end.

On cross-call diff: terse has it, and an earlier edition claimed competitors had "no answer for" it. That is too strong — @sliday/tamp ships diff and read-diff stages in its default pipeline. What it does not do is offer them losslessly. Separately, be aware that terse's diff tier is off by default (#170) and fires on 0.67% of this author's live traffic (30 of 4,461 blocks) — though it wins 87% of the times its base has matching arguments, and is starved rather than weak (#419). See the note on it below before weighting it.

Competitor-by-competitor notes (headroom, LLMLingua-2, mcp-compressor, code-execution approaches, and more — all hands-on tested, no invented numbers), the full per-payload tables, the column-width sweep, the live production ledger, and a repo-size sweep across popular third-party MCP servers all live in BENCHMARKS.md, along with the exact reproduce commands. The running competitor queue, including everything screened out and why, is docs/competitors-to-benchmark.md.

Adoption honesty: terse has been on PyPI since v0.3.1 (2026-07-18) and is at v0.49.0; TOON, headroom and the other measured entrants are far more established. terse's wedge is narrow and specific — unconditionally lossless, no expiring retrieve-cache, no ML dependency, MCP-transparent — not breadth of adoption.

(Star counts were removed from these docs on 2026-09-22: they drifted constantly and never informed whether terse works. What a project measurably does is the comparison worth carrying.)

And a token saved is not a dollar saved. Measured over 1,093 of this author's own sessions (2026-09-22, 30-day window), 96.9% of raw input tokens are cache reads, billed at a tenth of input price — so a raw-token basis overstates input cost by 7.47x. terse shrinks the prefix that gets re-read every turn and delays the context window filling up; it does not cut the invoice by the codec percentage. Full derivation in BENCHMARKS.md → Methodology & honesty notes.

Related Documentation

When to use terse (and when not to) — the economic model (primer cost vs. per-call savings), the break-even rule, and where the codec does and doesn't pay off

Benchmarks — dated, reproducible numbers: terse-vs-TOON (§1–2), the cross-call diff axis (§3), competitors (§4), the live production ledger (§5), and popular third-party MCP servers + a repo-size sweep (§6)

Verify it yourself — prove losslessness, savings, and no-egress locally

Technical Reference — architecture, pipeline, policy schema, limitations

Usage Guide — running the CLI day-to-day and reading its output

Changelog — notable changes per release

A working, measured, selective lossless library, CLI, and MCP stdio proxy. The proxy's open question — does a model read the compressed form as well as raw JSON, and does it need the format primer to do so? — has a real, model-dependent answer as of #249 (2026-08-19), though not yet a final one. The earlier claim here (Claude Haiku 4.5 and Gemini 2.5 Flash match raw-JSON accuracy, 100% paired, 37% token saving) was a joint panel figure whose "Haiku 4.5" entry predates the fix that let this harness reach real Anthropic models at all — the eval gateway's claude-* ids were DeepSeek aliases (see #249) — so the 100% comprehension figure is unconfirmed rather than cleanly reattributable to Gemini alone. The 37% token saving is deterministic tokenizer arithmetic, unaffected by that bug, and still holds. A same-day frontier-panel run, via a real claude -p OAuth backend on the stress corpus (--trials 1 throughout), found: Opus 5 unaffected either way (raw = terse = 100%, 0 regressions); Haiku 4.5 shows a real 8-point gap without the primer (92% vs. 100% raw), fully recovered by it; Sonnet 5 shows a smaller gap (96% -> 100%). Opus and Sonnet are both single-trial reads and unconfirmed — a later same-day deepening pass re-ran four other (substitute, non-Anthropic) models at --trials 3-5 and found three of four flipped conclusion under more trials. Only Haiku, among the named models, was re-run at --trials 3, and it held (92% -> 99%, essentially unchanged) — the one figure in this table that is independently replicated. That same deepening pass also found the primer can measurably hurt a smaller substitute model at higher trial counts. Net: the primer's effect is real but model-dependent, not "unnecessary" or "always required." See #249 for the full panel, the replication story, and the still-open real-payload-corpus precondition before any default changes. Whole-subtree aliasing (folding repeated objects, not just strings) is built. Cross-call diffing is a lossless tier that is off by default (#170) — not for lack of confidence, but on cost: its primer paragraph adds 190 cl100k tokens to that server's primer — the largest single section — attached once per session to each wrapped server that emits a terse form (#211), against a measured 0.38% hit rate. The tier banked 5,052 tokens over 13.3 days, which roughly 27 primer attaches erase — about two a day across that window, which an active fleet passes immediately. That is the standalone cadence, and since #212 a router's union primer follows it too — once per session, not every turn. Re-derived 2026-09-22 over the full all-time ledger (4,461 blocks), superseding the 14-day #250 window (17 of 908 blocks, 1.9% / 3.7%, 1,344 tokens): the structural exclusion is gone and the verdict is unchanged — the tier fires on 30 of 4,461 blocks (0.67%), 26 of them emitted, against the live router primer of 502 tokens per turn at the time (lazy since #212).

Correction to an earlier edition of this line, which called the remaining exclusions "workload, not structure". That is true of no_prior (318) and false of not_smaller_diff_args (251), which is a data-structure choice: the diff base is one slot per tool (proxy.py:345), so an interleaved different-args call evicts the base that would have paid. Segmented by whether the base's args matched, the tier wins 87% of the time it gets a same-args base (26 of 30) and 0% when it does not (0 of 251). It is starved, not weak. #419 proposes (tool, args_key) keying, with a probe first — the 251 do not all convert, and 87% rests on 30 events. Its full validation program did pass: pair fluency (fluency --diff, 4-model panel 100% — per the 0.26.0 changelog entry (#249), this panel's claude-sonnet-5/claude-fable-5/claude-haiku-4-* gateway ids are confirmed DeepSeek aliases, so it was two DeepSeek models measured twice under Anthropic names, not four; the 100% pass itself is unaffected by which name each run carried), the nested-record surface (structure: diff 100% vs full-terse 94%), and long-chain drift soaked from both sides — mechanically (tests/test_diff_soak.py — exact reconstruction hundreds of chained hops deep) and behaviorally (fluency --diff-soak — no depth-correlated accuracy loss up to the keyframe bound). Opt IN per proxy (--diff) or per policy ("diff": true) — worth it for a workload that really does re-call the same tool with the same arguments. Cross-block joining (N content blocks folded into one record array before compressing) is built and on by default — it removed the structural exclusion that kept 71% of real traffic out of the diff tier entirely, and the re-measurement above is what that removal was worth: a higher hit rate on payloads too small to pay for the primer. The Tier 1 lossy modes truncate and drop-to-retrieve are built (opt-in, off by default). summarize is closed permanently (#261), not pending — terse is deterministic-only by decision, and a model-in-the-proxy tier is out of scope for good. See TECHNICAL.md "Known Limitations".

Evidence now spans three kinds: a fixed public corpus (BENCHMARKS §1–4), terse's own live production ledger (§5), and popular third-party MCP servers measured zero-config with pinned fixtures (§6) — filesystem, git, memory, serena, sequential-thinking and everything, re-run cold on 2026-09-22 against terse, TOON 4.1.1 and compressmcp on the identical captured bytes.

The §6 headline, stated as a pair because one payload dominates the basis: over all 12 JSON payloads terse 77.4% / TOON 48.2% / compressmcp 51.8%, but the 133k directory_tree is 96.4% of that basis — excluding it the same three read 52.2% / 50.8% / 45.1%. So terse's margin scales with payload size: below a few thousand tokens the three encoders land within ~7 points of each other and TOON wins the smallest row outright; on the large nested tree terse pulls 30 points clear, because that is where repeated subtrees exist to fold. Every text-shaped tool is 0% one-shot for all three — the codec is the JSON-specific lever.

Released: Dec 3, 2026

Both files in this release have provenance metadata.

View provenance details

MIT View SPDX License List

agent compression context-window json llm lossless mcp proxy tokens

Development Status 4 - Beta

Intended Audience Developers

Operating System OS Independent

Programming Language Python :: 3

Topic Software Development :: Libraries

Release files for terse-mcp 0.52.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Built distribution (wheel)

Total release size: 2.6 MB

Release files / terse_mcp-0.52.1.tar.gz

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 3, 2026.

Release files / terse_mcp-0.52.1-py3-none-any.whl

Security for terse-mcp 0.52.1

Both files in this release have been uploaded with provenance metadata.

With provenance terse_mcp-0.52.1.tar.gz Dec 3, 2026

With provenance terse_mcp-0.52.1-py3-none-any.whl Dec 3, 2026

Attestation for terse_mcp-0.52.1.tar.gz

Attestation for terse_mcp-0.52.1-py3-none-any.whl

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

Dec 3, 2026 2 release files Full provenance

Dec 2, 2026 2 release files Full provenance

Nov 17, 2026 2 release files Full provenance

Nov 15, 2026 2 release files Full provenance

Nov 4, 2026 2 release files Full provenance

Oct 30, 2026 2 release files Full provenance

Oct 29, 2026 2 release files Full provenance

Oct 28, 2026 2 release files Full provenance

Oct 21, 2026 2 release files Full provenance

Oct 20, 2026 2 release files Full provenance

Oct 8, 2026 2 release files Full provenance

Oct 6, 2026 2 release files Full provenance

Sep 30, 2026 2 release files Full provenance

Sep 27, 2026 2 release files Full provenance

Sep 26, 2026 2 release files Full provenance

Sep 25, 2026 2 release files Full provenance

Sep 24, 2026 2 release files Full provenance

Sep 23, 2026 2 release files Full provenance

Sep 17, 2026 2 release files Full provenance

Sep 16, 2026 2 release files Full provenance

Sep 15, 2026 2 release files Full provenance

Sep 14, 2026 2 release files Full provenance

Sep 12, 2026 2 release files Full provenance

Sep 11, 2026 2 release files Full provenance

Sep 10, 2026 2 release files Full provenance

Sep 9, 2026 2 release files Full provenance

Sep 8, 2026 2 release files Full provenance

Sep 7, 2026 2 release files Full provenance

Sep 6, 2026 2 release files Full provenance

Sep 5, 2026 2 release files Full provenance

Sep 4, 2026 2 release files Full provenance

Sep 3, 2026 2 release files Full provenance

Sep 2, 2026 2 release files Full provenance

Aug 27, 2026 2 release files Full provenance

Aug 26, 2026 2 release files Full provenance

Aug 25, 2026 2 release files Full provenance

Aug 21, 2026 2 release files Full provenance

Aug 20, 2026 2 release files Full provenance

Aug 19, 2026 2 release files Full provenance

Aug 18, 2026 2 release files Full provenance

Aug 15, 2026 2 release files Full provenance

Aug 14, 2026 2 release files Full provenance

Aug 13, 2026 2 release files Full provenance

Aug 12, 2026 2 release files Full provenance

Aug 11, 2026 2 release files Full provenance

Aug 7, 2026 2 release files Full provenance

Aug 6, 2026 2 release files Full provenance

Aug 5, 2026 2 release files Full provenance

Aug 4, 2026 2 release files Full provenance

Jul 31, 2026 2 release files Full provenance

Jul 30, 2026 2 release files Full provenance

Jul 29, 2026 2 release files Full provenance

Jul 28, 2026 2 release files Full provenance

Jul 24, 2026 2 release files Full provenance

Jul 21, 2026 2 release files Full provenance

Jul 18, 2026 2 release files Full provenance

"PyPI", "Python Package Index", and the blocks logos are registered trademarks of the Python Software Foundation.

© 2026 Python Software Foundation

Deployed from 107c339

Source Attribution: This report incorporates information referenced or syndicated from Pypi.org. Read original coverage at Pypi.org.

More from Technology →
Haldwani Times
Haldwani Times Independent News & Editorial
Login
MARKETS & FINANCE
BRENT CRUDE: $78.40 -0.52% SENSEX: 81,450.20 +0.42% NIFTY 50: 24,820.15 +0.38% GOLD (24K): ₹74,500/10g -0.18% USD/INR: ₹95.54 +0.10%

ADMINISTRATIVE LEADERSHIP

Mr. Narendra Modi
Mr. Narendra Modi
Mr. Lt. Gen. Gurmit Singh
Mr. Lt. Gen. Gurmit Singh
Mr. Pushkar S. Dhami
Mr. Pushkar S. Dhami
Mr. Lalit M. Rayal
Mr. Lalit M. Rayal
Mr. Gajraj S. Bisht
Mr. Gajraj S. Bisht

Top Headlines & Breaking Stories

View All News →
बागेश्वर में मातृशक्ति सम्मेलन, सीएम धामी ने महिलाओं के सशक्तिकरण को बताया सरकार की प्राथमिकता
Haldwani

बागेश्वर में मातृशक्ति सम्मेलन, सीएम धामी ने महिलाओं के सशक्तिकरण को बताया सरकार की प्राथमिकता

Bageshwar: CM Dhami: बागेश्वर में भव्य मातृशक्ति सम्मेलन का आयोजन किया गया, जिसमें मुख्यमंत्री पुष्कर सिंह धाम...

Haldwani Times 4 Dec

Haldwani Times – Everything in Haldwani: News, Shops, Businesses & Services

Haldwani Times is the premier digital news and commercial discovery platform built specifically for the citizens, business owners, students, professionals, and visitors of Haldwani, Nainital district, and the wider Kumaon region of Devbhoomi Uttarakhand. As the economic gateway to the Kumaon Himalayas, Haldwani is a bustling metropolis connecting the plains of northern India with the scenic mountain districts of Nainital, Almora, Pithoragarh, Bageshwar, Champawat, and Udham Singh Nagar. Haldwani Times serves as the definitive digital heartbeat of the city, bringing breaking hyperlocal news, verified commercial directories, educational updates, healthcare guides, Mandi Bhav rates, and civic announcements onto a single unified, trusted platform.

The Definitive Source for Breaking Haldwani News & Civic Updates

Haldwani stands as one of the fastest-growing urban conglomerates and commercial engines in northern India. Positioned in the fertile Terai-Bhabhar belt at the foothills of the Shivalik range, the twin cities of Haldwani and Kathgodam form the administrative and logistical nerve center for the entire Kumaon division. With rapid urbanization, expanding commercial infrastructure, flourishing educational centers, and increasing inter-state transit, the demand for fast, fact-checked, and unbiased local journalism has never been greater. Haldwani Times delivers 24/7 comprehensive news coverage built on rigorous journalistic standards: - **Hyperlocal Civic News:** Real-time coverage of municipal corporation affairs, city drainage projects, traffic management blueprints, and road widening drives across Tikonia, Mukhani, Kusumkhera, Bareilly Road, and Rampur Road. - **Administrative Directives:** Official notifications from the District Magistrate (DM) Nainital, Senior Superintendent of Police (SSP), and state secretariat decisions affecting citizen welfare. - **Kumaon Weather & Disaster Alerts:** Timely mountain rainfall warnings, landslide advisories along NH-109 (Haldwani-Nainital Highway), and emergency bulletins during the monsoon and winter seasons. - **Education & Campus News:** Timely reports on Kumaon University examination schedules, Uttarakhand Board (UBSE) results, medical college admissions, and competitive coaching updates. - **Commercial & Market Trends:** Daily wholesale Mandi Bhav rates from Haldwani Subzi Mandi, real estate trends, retail market festivals, and local business openings. - **Cultural & Pahadi Heritage:** In-depth feature stories celebrating Kumaoni folk traditions, Aipan art, Nanda Devi festivals, and local community milestones.

Everything in Haldwani on One Unified Digital Ecosystem

Beyond traditional news reporting, Haldwani Times is engineered as an exhaustive local discovery engine. Historically, finding verified local business telephone numbers, emergency hospital contacts, specialized doctors, reliable plumbers, or trusted real estate consultants in Haldwani required asking neighbors or browsing outdated social media posts. Haldwani Times eliminates this friction by organizing every commercial, professional, and civic resource into searchable, verified categories. Whether you are a newly arrived resident in Kusumkhera looking for high-speed broadband providers, a parent searching for reputable CBSE schools near Kaladhungi Road, or a tourist seeking taxi rentals to Nainital, our portal delivers accurate, verified, and actionable information in seconds.

Local Shops, Retail Hubs & Traditional Bazaars in Haldwani

The retail commerce of Haldwani spans centuries-old traditional bazaars and modern commercial complexes: - **Bada Bazaar & Mangal Parao:** The historic retail heart of Haldwani, renowned for traditional Kumaoni wedding jewelry (Pauji, Guloband, Nath), brass utensils, ethnic handlooms, and wholesale clothing. - **Nainital Road & Tikonia Commercial Corridor:** Modern multi-brand retail showrooms, electronics stores, authorized smartphone service centers, branded footwear outlets, and international apparel stores. - **Bareilly Road & Rampur Road Trade Hubs:** Major agricultural machinery dealers, hardware and building material wholesalers, furniture manufacturing units, plywood distributors, and automobile showrooms. - **Subzi Mandi & Wholesale Grain Market:** One of the largest agricultural distribution centers in North India, supplying fresh vegetables, hill fruits (apples, peaches, plums), and organic Pahadi pulses (Gahat, Bhatt, Rajma) across northern states.

Healthcare Hub of Kumaon: Hospitals & Emergency Services

Haldwani serves as the premier medical lifeline for all six hill districts of Kumaon. Patients travel from Almora, Pithoragarh, Bageshwar, and Champawat to access specialized clinical treatments in Haldwani: - **Government Healthcare Institutions:** Dr. Susheela Tiwari Government Medical College & Hospital (STGH) and Base Hospital Haldwani provide tertiary trauma care, specialized super-specialties, pediatric ICUs, and 24/7 emergency response. - **Private Multi-Specialty Hospitals:** Advanced private medical centers specializing in cardiology, joint replacements, neurology, critical care, nephrology, and advanced laparoscopic surgeries. - **Diagnostic Centers & 24/7 Pharmacies:** Fully automated pathology laboratories, high-resolution MRI/CT scan centers, and round-the-clock emergency pharmacies clustered around Medical College Road, Kaladhungi Road, and Rampur Road.

Education, Colleges, Coaching Academies & Youth Development

Haldwani is the educational capital of the Kumaon region, home to thousands of ambitious students preparing for medical, engineering, defense, and civil services careers: - **Premier Degree Colleges:** Motiram Baburam Government Post Graduate College (MBPG College) and Women's Degree College providing extensive undergraduate and postgraduate humanities, commerce, and science programs. - **Competitive Coaching Ecosystem:** Highly reputed coaching academies for NEET UG, JEE Main & Advanced, UPSC Civil Services, UKPSC/UKSSSC, NDA, CDS, and Banking examinations along Kaladhungi Road and Tikonia. - **Affiliated Schooling Infrastructure:** Esteemed CBSE, ICSE, and Uttarakhand Board schools imparting value-based holistic education with modern sports and laboratory facilities.

Real Estate, Housing Colonies & Urban Expansion Trends

Driven by rapid infrastructure expansion and high quality of life, Haldwani's real estate market is expanding outward into organized residential colonies: - **Prime Residential Localities:** Highly sought-after residential sectors in Mukhani, Kusumkhera, Kaladhungi Road, Judge Farm, Daharia, and Bhotia Parao offering planned housing, green parks, and modern civic amenities. - **Commercial Property Investments:** Thriving commercial retail complexes, office spaces, and warehouse hubs developing rapidly along the proposed Haldwani Ring Road and transport corridors. - **Property Advisory & RERA Compliance:** In-depth real estate updates, circle rate revisions by the Nainital district administration, and buyer advisory guidelines for safe property acquisitions.

Strategic Transit Gateway, Tourism Routes & Kumaon Himalayan Connectivity

Haldwani-Kathgodam is the vital transit bridge connecting the plains of Delhi NCR and Uttar Pradesh with the hill stations of Uttarakhand: - **Kathgodam Railway Terminal:** Connecting Kumaon directly to New Delhi (Shatabdi Express, Ranikhet Express), Lucknow, Kolkata, Jammu, and Dehradun. - **ISBT Haldwani:** Operating round-the-clock interstate and mountain bus routes managed by Uttarakhand Transport Corporation (UTC) and private deluxe coaches. - **Pantnagar Airport (PGH):** Located just 26 km from Haldwani, offering scheduled domestic flights to New Delhi, Dehradun, Pithoragarh, and regional hubs. - **Himalayan Tourism Hub:** The primary staging point for journeys to Nainital (34 km), Bhimtal (30 km), Mukteshwar (72 km), Kainchi Dham (42 km), Almora (90 km), Ranikhet (80 km), and Jim Corbett National Park (55 km).

Gaula River Mining, Ecological Balance & The Bhabhar Economy

The Gaula River represents the undisputed economic and hydrological lifeline of Haldwani and the broader Nainital district. Originating from the Sattal-Bhimtal catchment in the lesser Himalayas, the river flows south past Kathgodam and Haldwani before merging into the Ramganga. For generations, the Gaula riverbed has provided the foundation for both regional agriculture and the construction economy across northern India: - **Regulated Minor Mineral Extraction:** During the open mining season (typically October to May), thousands of registered tractor-trolleys and heavy dumpers harvest riverbed gravel, sand, and boulders under strict surveillance by the Uttarakhand Forest Development Corporation and the Nainital district administration. - **Livelihood Support for Over 50,000 Families:** The Gaula mining economy directly and indirectly sustains vehicle owners, drivers, mechanics, diesel pump stations, roadside eateries, and local laborers, circulating over ₹500 crore into Haldwani's local markets annually. - **Environmental Safeguards & Flood Mitigation:** In strict adherence to High Court and National Green Tribunal (NGT) directives, scientific replenishment studies, satellite GPS tracking on transport vehicles, and seasonal mining bans during the monsoon protect the river's ecological balance and prevent bank erosion along low-lying residential sectors.

Culinary Landscape: From Traditional Kumaoni Rasoi to Modern Cafes

Haldwani's gastronomic scene reflects a delightful blend of rustic mountain traditions and cosmopolitan dining: - **Authentic Kumaoni Specialties:** Local restaurants and heritage dhabas serve traditional mountain delicacies cooked in iron vessels, including Bhatt ki Churkani (black soybean curry), Gahat ke Dubke (horsegram puree), Aloo ke Gutke tempered with wild Himalayan chives (Jamboo) and Jakhiya, and refreshing cucumber Raita flavored with freshly crushed mustard seeds. - **Traditional Confectioneries:** Historic sweet shops along Bada Bazaar and Nainital Road craft Almora's world-famous Bal Mithai (roasted caramelized khoya fudge coated in sugar balls) and Singaudi (sweetened khoya wrapped in wild Malu leaves). - **Vibrant Street Food & Cafe Culture:** As dusk falls, Tikonia and Nainital Road come alive with bustling street food stalls offering steaming Tibetan momos, spiced thukpa, Kathi rolls, and hot Masala Chai, alongside modern rooftop cafes serving specialty Italian coffees and continental snacks.

Cultural Festivals, Folk Heritage & The Aipan Art of Kumaon

Beyond commercial enterprise, Haldwani is the proud cultural showcase of Devbhoomi Uttarakhand: - **Aipan Folk Art Tradition:** The sacred geometrical floor and wall art handcrafted with red ochre (Geru) and white rice paste (Biswar) adorning thresholds, altars, and chowkis during auspicious ceremonies, now preserved through local women's self-help cooperatives. - **Classical Baithki & Khadi Holi:** Unique to Kumaon, musical celebrations starting as early as the month of Paush, featuring classical Hindustani ragas sung in community courtyards followed by energetic Chholiya dance performances during spring. - **Nanda Devi & Chholiya Heritage:** Grand annual fairs celebrating the patron deity Nanda Devi, accompanied by martial sword-and-shield Chholiya dancers whose rhythmic brass trumpets (Ransingha) and hurka drums resonate through the valley.

Public Amenities, Parks & Community Spaces in Haldwani

Urban lifestyle and recreational infrastructure in the city: - **Green Parks & Walking Tracks:** Walkway projects around Daharia, Judge Farm, and Awas Vikas providing lush recreational zones for families and seniors. - **Community Centers & Sports Grounds:** Multi-purpose auditoriums and grounds hosting cultural melas, badminton tournaments, and community celebrations. - **Gaula Barrage & Forest Trails:** Scenic river viewpoints and natural birdwatching areas attracting eco-tourists and local nature enthusiasts on weekends.

Frequently Asked Questions (FAQs)

How can I access live breaking news and weather alerts for Haldwani?

Haldwani Times operates a dedicated 24/7 hyperlocal newsroom providing real-time breaking bulletins, traffic alerts, and meteorological warnings. You can access live news directly from our homepage, subscribe to instant browser push notifications, or view categorical updates on Uttarakhand, Education, and Mandi Bhav. During monsoon and winter weather events, our correspondents provide live updates on NH-109 road blockages and emergency administrative orders issued by the Nainital District Magistrate.

Is Haldwani Times completely free to read for all visitors?

Yes, Haldwani Times offers completely unrestricted, open-access reading to all users without mandatory paywalls. Readers across Haldwani, Uttarakhand, and the global diaspora can freely browse all breaking news reports, investigative articles, business directory listings, and historical archives. Our public-interest mission ensures that essential civic information, emergency hospital directories, and educational circulars remain universally accessible to everyone at zero cost.

How can local business owners list their shop or service in the Haldwani directory?

Local merchants, medical practitioners, schools, and service professionals can register their business by navigating to our 'Business Directory' page and selecting 'Add Listing'. The registration process allows you to input your business name, address, contact numbers, operational hours, services offered, and high-resolution showroom photographs. Once submitted, our local verification team verifies the physical address within 24 hours to ensure high consumer trust and top ranking on Google.

Can I read Haldwani Times articles in Hindi as well as English?

Yes, Haldwani Times features a seamless, native bilingual reading experience tailored for our regional readership. With our one-click language toggle located prominently in the navigation bar, you can instantly switch between English and pure Hindi. Both versions feature carefully crafted editorial phrasing, accurate regional terminology, and culturally resonant storytelling to ensure maximum readability for students, families, and senior citizens alike.

How do I submit news tips, event notices, or press releases to the editorial team?

Our newsroom warmly welcomes verified news tips, community event notices, civic grievances, and official press releases from citizens and local organizations. You can submit your documents, photos, or video evidence directly to our central editorial desk at editorial@haldwanitimes.com or via our Help & Support page. Our senior editors review every submission for factual authenticity, multi-source verification, and public relevance prior to publication.

Where can visitors find authentic Kumaoni Bal Mithai and Singaudi in Haldwani?

Renowned traditional sweet houses clustered along Bada Bazaar, Mangal Parao, Kathgodam Station Road, and Nainital Road specialize in daily batches of authentic Bal Mithai and fragrant Singaudi prepared with pure mountain dairy khoya and natural ingredients.

What transportation options are available for traveling from Haldwani to Nainital and Bhimtal?

Continuous state transport buses (UTC), KMOU coaches, and registered taxi union sharing cabs operate 24/7 from the Haldwani Roadways Bus Station (near Tikonia) and Kathgodam Railway Station. Fares are regulated by the transport department, with mountain travel times ranging between 1 to 1.5 hours.