Summary
Toolcraft examples encourage passing version strings manually to both CLI and MCP runtime setup, for example:
await runCLI(root, { version: "0.1.0" });
await runMCP(root, { name: "mytool", version: "0.1.0" });
This is easy to forget or let drift from package.json.
Expected
It would be nicer if Toolcraft could infer the package version by default, or provide a helper for reading the nearest package metadata.
Possible options:
runCLI(root) reads nearest package.json and enables --version automatically.
runMCP(root, { name }) can infer version from package metadata.
- Export a helper like
packageMetadata(import.meta.url) so examples avoid hardcoded duplicate strings.
Why this matters
For small CLIs, a hardcoded version: "0.1.0" in the entrypoint feels like boilerplate and can become wrong when package versions change.
Summary
Toolcraft examples encourage passing version strings manually to both CLI and MCP runtime setup, for example:
This is easy to forget or let drift from
package.json.Expected
It would be nicer if Toolcraft could infer the package version by default, or provide a helper for reading the nearest package metadata.
Possible options:
runCLI(root)reads nearestpackage.jsonand enables--versionautomatically.runMCP(root, { name })can inferversionfrom package metadata.packageMetadata(import.meta.url)so examples avoid hardcoded duplicate strings.Why this matters
For small CLIs, a hardcoded
version: "0.1.0"in the entrypoint feels like boilerplate and can become wrong when package versions change.