You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Connect three or four MCP servers in a single session and the **tool metadata alone routinely eats 40-50% of the context window** before the user has even typed a question.
12
12
The MCP team's [2026 roadmap](https://blog.modelcontextprotocol.io/posts/2026-mcp-roadmap/) explicitly calls out gateways, proxies, and observability as priority work.
13
13
14
-
**LeanMCP** (`leanmcp` on npm) is a small, drop-in proxy that sits in front of N upstream MCP servers and:
14
+
**Tooltrim** (`tooltrim` on npm) is a small, drop-in proxy that sits in front of N upstream MCP servers and:
15
15
16
16
-**filters** their tool / resource / prompt lists down to the ones your project actually uses,
17
17
-**shrinks** verbose tool descriptions and dedupes JSON-Schema sub-trees, deterministically,
@@ -24,7 +24,7 @@ It speaks both `stdio` and `Streamable HTTP` in both directions, runs stateless
24
24
25
25
## The hero
26
26
27
-
Measured against five real, official `@modelcontextprotocol/*` servers (`server-everything` + `server-filesystem` + `server-memory` + `server-sequential-thinking` + `server-github`). The numbers below match the checked-in [`bench/REPORT.md`](bench/REPORT.md): full **`pnpm bench`** inside the **`leanmcp:dev` Docker image** (Debian bookworm, **linux-x64**, Node **20.18**), so CI and contributors get the same Linux-shaped baseline as the README—not a hand-tuned Windows-only run.
27
+
Measured against five real, official `@modelcontextprotocol/*` servers (`server-everything` + `server-filesystem` + `server-memory` + `server-sequential-thinking` + `server-github`). The numbers below match the checked-in [`bench/REPORT.md`](bench/REPORT.md): full **`pnpm bench`** inside the **`tooltrim:dev` Docker image** (Debian bookworm, **linux-x64**, Node **20.18**), so CI and contributors get the same Linux-shaped baseline as the README—not a hand-tuned Windows-only run.
Agent (Claude Sonnet 4.5) ~77% fewer cumulative input tokens (direct vs LeanMCP task filter) — see report §5
38
+
Agent (Claude Sonnet 4.5) ~77% fewer cumulative input tokens (direct vs Tooltrim task filter) — see report §5
39
39
```
40
40
41
41
Full reproducible report: [`bench/REPORT.md`](bench/REPORT.md). Run the harness on the host with `pnpm bench`, or in Docker (same numbers on Linux) — see [`docs/DOCKER.md`](docs/DOCKER.md) and [`bench/README.md`](bench/README.md).
@@ -46,34 +46,34 @@ Full reproducible report: [`bench/REPORT.md`](bench/REPORT.md). Run the harness
# 3. point your MCP client at LeanMCP instead of the individual servers
54
+
# 3. point your MCP client at Tooltrim instead of the individual servers
55
55
```
56
56
57
57
Cursor / Claude Desktop / Codex stdio config:
58
58
59
59
```json
60
60
{
61
61
"mcpServers": {
62
-
"leanmcp": {
62
+
"tooltrim": {
63
63
"command": "npx",
64
-
"args": ["-y", "leanmcp"]
64
+
"args": ["-y", "tooltrim"]
65
65
}
66
66
}
67
67
}
68
68
```
69
69
70
-
That's it. `leanmcp` will read `leanmcp.config.yaml` from the cwd, fan out to every upstream listed there, and present a single merged, filtered, shrunk tool list to your client.
70
+
That's it. `tooltrim` will read `tooltrim.config.yaml` from the cwd, fan out to every upstream listed there, and present a single merged, filtered, shrunk tool list to your client.
71
71
72
72
---
73
73
74
74
## Configuration
75
75
76
-
A complete example lives in [`examples/leanmcp.config.yaml`](examples/leanmcp.config.yaml).
76
+
A complete example lives in [`examples/tooltrim.config.yaml`](examples/tooltrim.config.yaml).
`${VAR}` and `${VAR:-default}` are expanded from the environment in any string value.
118
118
119
119
### Config files
120
120
121
-
`leanmcp` searches for one of these, walking up from the cwd:
121
+
`tooltrim` searches for one of these, walking up from the cwd:
122
122
123
-
- `leanmcp.config.yaml`/ `.yml`
124
-
- `leanmcp.config.json`
125
-
- `leanmcp.config.js`/ `.mjs`
126
-
- `.leanmcp.yaml`/ `.yml` / `.json`
127
-
- a `"leanmcp"` key in `package.json`
123
+
- `tooltrim.config.yaml`/ `.yml`
124
+
- `tooltrim.config.json`
125
+
- `tooltrim.config.js`/ `.mjs`
126
+
- `.tooltrim.yaml`/ `.yml` / `.json`
127
+
- a `"tooltrim"` key in `package.json`
128
128
129
129
You can also pass `--config <path>` to any command.
130
130
@@ -151,7 +151,7 @@ The default `rules` mode is fully deterministic:
151
151
5. Truncate at the first sentence boundary past `maxDescriptionChars`.
152
152
6. JSON-Schema dedup: any sub-tree that appears 2+ times is hoisted to `$defs` and replaced with `$ref`.
153
153
154
-
Output is hashed and cached in `.leanmcp/shrink-cache.json`, so the same description always shrinks to the same bytes — your agent never sees a moving target.
154
+
Output is hashed and cached in `.tooltrim/shrink-cache.json`, so the same description always shrinks to the same bytes — your agent never sees a moving target.
155
155
156
156
The `llm` mode (v0.2) adds an optional offline pass that can be checked into git for reproducibility.
157
157
@@ -169,8 +169,8 @@ Every JSON-RPC frame in or out is one NDJSON line:
169
169
```
170
170
171
171
```bash
172
-
leanmcp trace tail # follow with pretty-printing
173
-
leanmcp trace tail --no-pretty # raw NDJSON, pipe to jq / Loki / Datadog
172
+
tooltrim trace tail # follow with pretty-printing
173
+
tooltrim trace tail --no-pretty # raw NDJSON, pipe to jq / Loki / Datadog
174
174
```
175
175
176
176
### Metrics
@@ -179,32 +179,32 @@ Prometheus endpoint at `http://<host>:9464/metrics`:
A starter Grafana dashboard is in [`examples/grafana-dashboard.json`](examples/grafana-dashboard.json).
188
188
189
189
### OpenTelemetry
190
190
191
-
Set `OTEL_EXPORTER_OTLP_ENDPOINT` (or enable it in config) and LeanMCP initializes the Node SDK with an OTLP/HTTP trace exporter.
191
+
Set `OTEL_EXPORTER_OTLP_ENDPOINT` (or enable it in config) and Tooltrim initializes the Node SDK with an OTLP/HTTP trace exporter.
192
192
193
193
### Audit
194
194
195
-
Every `tools/call` lands in `.leanmcp/audit.ndjson` with the identity claims (`sub`, `iss`, `aud`, `scope`, `client_id`) decoded — but **not** verified — from the inbound `Authorization` Bearer token. Run a real auth gateway in front of LeanMCP if you need cryptographic verification.
195
+
Every `tools/call` lands in `.tooltrim/audit.ndjson` with the identity claims (`sub`, `iss`, `aud`, `scope`, `client_id`) decoded — but **not** verified — from the inbound `Authorization` Bearer token. Run a real auth gateway in front of Tooltrim if you need cryptographic verification.
196
196
197
197
---
198
198
199
199
## CLI
200
200
201
201
```text
202
-
leanmcp # start the proxy (default)
203
-
leanmcp start # explicit
204
-
leanmcp measure # before/after token report; the README hero
205
-
leanmcp validate-config # parse + validate, no startup
206
-
leanmcp validate-file <path> # validate a JSON file against the schema
207
-
leanmcp trace tail # tail the NDJSON trace
202
+
tooltrim # start the proxy (default)
203
+
tooltrim start # explicit
204
+
tooltrim measure # before/after token report; the README hero
205
+
tooltrim validate-config # parse + validate, no startup
206
+
tooltrim validate-file <path> # validate a JSON file against the schema
Copy file name to clipboardExpand all lines: bench/README.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
-
# LeanMCP enterprise benchmark
1
+
# Tooltrim enterprise benchmark
2
2
3
-
End-to-end harness that proves LeanMCP against five real MCP servers and
3
+
End-to-end harness that proves Tooltrim against five real MCP servers and
4
4
a real Claude Sonnet 4.5 agent loop. Output is `bench/REPORT.md`.
5
5
6
6
## Quick start
@@ -30,18 +30,18 @@ files are present.
30
30
## Docker (Linux, reproducible)
31
31
32
32
The checked-in [`REPORT.md`](REPORT.md) hero numbers are produced with
33
-
**`pnpm bench` inside the `leanmcp:dev` image** (linux-x64, Node 20) so the
33
+
**`pnpm bench` inside the `tooltrim:dev` image** (linux-x64, Node 20) so the
34
34
README and the report stay aligned regardless of your host OS.
35
35
36
36
```bash
37
-
docker build -t leanmcp:dev .
37
+
docker build -t tooltrim:dev .
38
38
39
39
docker run --rm \
40
40
-e GITHUB_TOKEN="$GITHUB_TOKEN" \
41
41
-e ANTHROPIC_API_KEY="$ANTHROPIC_API_KEY" \
42
42
-v "$(pwd)/bench/results:/app/bench/results" \
43
43
-v "$(pwd)/bench:/app/bench" \
44
-
leanmcp:dev \
44
+
tooltrim:dev \
45
45
pnpm bench
46
46
```
47
47
@@ -56,7 +56,7 @@ PowerShell: use `${PWD}\bench\...` for the volume paths. Full build/run notes:
56
56
|`measure`| For 4 filter scenarios (raw / shrunk / common / task) records bytes + tokens of the merged tool list. |`bench/results/measure.json`|
57
57
|`latency`| 100 samples each of `tools/list` and `tools/call (everything.echo)` direct vs through the proxy. |`bench/results/latency.json`|
58
58
|`throughput`| 50 concurrent `tools/call` against the proxy, ops/sec + error count. |`bench/results/throughput.json`|
59
-
|`agent`| Locked task run twice (direct fan-out vs LeanMCP), Claude Sonnet 4.5, capped at 8 turns × 1024 tokens. |`bench/results/agent{,-direct,-proxy}.json`|
59
+
|`agent`| Locked task run twice (direct fan-out vs Tooltrim), Claude Sonnet 4.5, capped at 8 turns × 1024 tokens. |`bench/results/agent{,-direct,-proxy}.json`|
60
60
|`report`| Stitches everything into `bench/REPORT.md`. |`bench/REPORT.md`|
> The trace.ndjson and `/metrics` endpoint are hot during the bench because `examples/benchmark.config.yaml` enables `observability.trace`, `observability.metrics.prometheus`, and `observability.audit`. They're real, not theoretical.
0 commit comments