@trazum/mcp 1.9.0 → 1.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -10
- package/dist/tools.d.ts +7 -0
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +616 -4
- package/dist/tools.js.map +1 -1
- package/package.json +2 -2
- package/src/tools.ts +746 -3
package/README.md
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
# @trazum/mcp
|
|
2
2
|
|
|
3
3
|
Trazum as an [MCP](https://modelcontextprotocol.io) server, so an agent can price
|
|
4
|
-
and budget a prompt **before** it sends it
|
|
4
|
+
and budget a prompt **before** it sends it — and read a usage log to see where the
|
|
5
|
+
money already went.
|
|
5
6
|
|
|
6
|
-
Every other Trazum surface answers
|
|
7
|
-
you run, a page you paste into, a check that fails a build. This answers
|
|
8
|
-
thing actually composing the
|
|
7
|
+
Every other Trazum surface answers those questions for a human after the fact — a
|
|
8
|
+
CLI you run, a page you paste into, a check that fails a build. This answers them
|
|
9
|
+
for the thing actually composing the prompts.
|
|
9
10
|
|
|
10
11
|
## It runs on your machine and costs nothing to host
|
|
11
12
|
|
|
@@ -28,6 +29,7 @@ because "MCP server" reads like infrastructure and this is not.
|
|
|
28
29
|
| --- | --- |
|
|
29
30
|
| `check_prompt` | Does this prompt fit `maxTokens`? And if not, would optimising it fit? |
|
|
30
31
|
| `optimize_prompt` | The shorter text, the token counts either side, what the difference is worth per month, and any advisories. |
|
|
32
|
+
| `profile_usage` | Where the money went, from a usage log passed as text: the spend split, per label and per model, whether caching paid for itself, and the levers that would actually move the bill. The one tool whose figures are exact — they are the provider's own billed counts. |
|
|
31
33
|
| `list_models` | Prices, context windows and cacheable minimums, with the date the table was reviewed. |
|
|
32
34
|
|
|
33
35
|
`check_prompt` is the one worth wiring up. It has **three** outcomes rather than
|
|
@@ -43,11 +45,12 @@ instructions. A boolean throws away the actionable half.
|
|
|
43
45
|
|
|
44
46
|
## What it cannot do, which is the design
|
|
45
47
|
|
|
46
|
-
**No paths.** Every tool takes
|
|
47
|
-
be a file-read primitive reachable by whatever the
|
|
48
|
-
package imports `@trazum/core`, the browser-safe
|
|
49
|
-
`@trazum/core/node` — the capability is *absent* rather
|
|
50
|
-
enforces it.
|
|
48
|
+
**No paths.** Every tool takes text — the prompt itself, the log itself. A tool
|
|
49
|
+
that accepted a filename would be a file-read primitive reachable by whatever the
|
|
50
|
+
model decided to ask for. This package imports `@trazum/core`, the browser-safe
|
|
51
|
+
entry point, and never `@trazum/core/node` — the capability is *absent* rather
|
|
52
|
+
than unused, and a test enforces it. The agent reads the file in its own sandbox,
|
|
53
|
+
where its own permissions apply, and hands over the content.
|
|
51
54
|
|
|
52
55
|
**No network.** Nothing here calls a model. `--suggest` and `eval` exist in the CLI
|
|
53
56
|
and are deliberately not exposed: they spend your money, and a tool an agent can
|
|
@@ -71,7 +74,7 @@ anything else with `-32601 Method not found`. No resources, no prompts, no
|
|
|
71
74
|
sampling. It is driven by a raw newline-delimited client in the tests; it has not
|
|
72
75
|
been driven by every MCP client in existence.
|
|
73
76
|
|
|
74
|
-
Token counts are estimates (±
|
|
77
|
+
Token counts are estimates (±10%, measured against Claude's tokenizer over 21
|
|
75
78
|
samples in seven languages), and every tool says so in its own output. A prompt
|
|
76
79
|
within a few percent of its budget should be treated as uncertain rather than as
|
|
77
80
|
passing. `--exact-tokens` settles it against the counting endpoint, which is free.
|
package/dist/tools.d.ts
CHANGED
|
@@ -27,6 +27,13 @@ import type { ToolDefinition } from './rpc.js';
|
|
|
27
27
|
* accident. Refusing early with a number beats an unbounded pass over it.
|
|
28
28
|
*/
|
|
29
29
|
export declare const MAX_PROMPT_CHARS = 400000;
|
|
30
|
+
/**
|
|
31
|
+
* Larger than the prompt cap because a usage log is a different object: a month
|
|
32
|
+
* of calls at one JSON line each. Two million characters is a few MB of log —
|
|
33
|
+
* far beyond what an agent realistically holds in context, so the cap exists to
|
|
34
|
+
* refuse the accident, not to invite the maximum.
|
|
35
|
+
*/
|
|
36
|
+
export declare const MAX_LOG_CHARS = 2000000;
|
|
30
37
|
/** The whole surface. An exact list, asserted as one by the tests. */
|
|
31
38
|
export declare const TOOLS: readonly ToolDefinition[];
|
|
32
39
|
//# sourceMappingURL=tools.d.ts.map
|
package/dist/tools.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,SAAU,CAAC;AA+MxC;;;;;GAKG;AACH,eAAO,MAAM,aAAa,UAAY,CAAC;AAytBvC,sEAAsE;AACtE,eAAO,MAAM,KAAK,EAAE,SAAS,cAAc,EAAuC,CAAC"}
|