Thanks for your interest! Tooltrim is a small project; a quick PR is usually faster than a long discussion.
pnpm install
pnpm typecheck
pnpm test
pnpm buildpnpm test runs unit + integration suites. The integration tests spawn a local fixture MCP server over stdio, so they need Node 20+ but no network.
The numbers in bench/REPORT.md / the README hero come from
pnpm bench run inside the Docker image (Dockerfile → tooltrim:dev) so
the baseline is linux-x64 with a pinned Node, not whatever laptop ran it
last. See docs/DOCKER.md for docker build / docker run
and how to mount bench/ so REPORT.md updates on the host.
pnpm dlx tsx src/cli.ts measure --config examples/demo.config.json- TypeScript strict mode is on. Don't disable it.
- Prefer the lowest-level MCP SDK primitives (
Server,setRequestHandler) for proxy code —McpServer.registerToolis for static tool authors. - Keep the shrinker deterministic: same input → same output bytes. If you need an LLM, do it offline and cache the result.
- Logs go through
pino. When stdio is the inbound transport, everything goes to stderr — neverconsole.log.
Conventional commits are nice but not enforced. A short imperative summary is fine.
- Bump
versioninpackage.json. - Push a
vX.Y.Ztag. - The
release.ymlworkflow runs the tests and publishes to npm.
Please include:
- the version of Tooltrim (
tooltrim --version), - the redacted config (use
tooltrim validate-config— it strips token-like fields), - a few lines of
.tooltrim/trace.ndjsonif relevant.
By contributing, you agree your work is licensed under the same MIT license as the project.