Wrapper Guide
A wrapper is a tiny npm package (about 3 files) that tells npm-launcher which binary to fetch and run. End users install the wrapper; npm-launcher does the rest.
Package structure
Section titled “Package structure”my-tool/ package.json bin/ my-tool.js LICENSEStep 1: package.json
Section titled “Step 1: package.json”{ "name": "@mcptoolshop/my-tool", "version": "1.0.0", "bin": { "my-tool": "bin/my-tool.js" }, "dependencies": { "@mcptoolshop/npm-launcher": "^1.2.0" }}Key points:
- The
binfield maps the CLI command name to your bin script - The only dependency is npm-launcher itself
- The wrapper version should match the binary version you are distributing
Step 2: bin script
Section titled “Step 2: bin script”Create bin/my-tool.js:
#!/usr/bin/env nodeprocess.env.MCPTOOLSHOP_LAUNCH_CONFIG = JSON.stringify({ toolName: "my-tool", owner: "your-org", repo: "my-tool", version: "1.0.0",});require("@mcptoolshop/npm-launcher/bin/mcptoolshop-launch.js");The bin script does two things:
- Sets the
MCPTOOLSHOP_LAUNCH_CONFIGenvironment variable with your tool’s coordinates - Hands off to npm-launcher, which handles download, verification, caching, and execution
Step 3: Build and release binaries
Section titled “Step 3: Build and release binaries”Your CI workflow should:
- Build platform-specific binaries following the asset naming convention
- Generate a
checksums-<version>.txtfile usingsha256sum - Upload everything to a GitHub Release tagged with
v<version>
A complete example CI workflow for Python tools lives in the repo at examples/ci/release-binaries.yml. It builds with PyInstaller across Linux, macOS, and Windows, generates checksums, and uploads everything to a GitHub Release.
The key steps are:
# Build with PyInstallerpyinstaller --onefile --name my-tool src/__main__.py
# Generate checksums (GNU coreutils format)sha256sum dist/* > checksums-1.0.0.txtStep 4: Publish the wrapper
Section titled “Step 4: Publish the wrapper”npm publish --access publicUsers can now run your tool with:
npx @mcptoolshop/my-tool --help--help and --version reach your tool and print its own help and version (launcher 1.2.0 or later; ^1.2.0 above ensures it). Your tool sees its own name as argv[0], so a click or argparse usage line reads Usage: my-tool ....
Updating versions
Section titled “Updating versions”When you release a new binary version:
- Build and publish the new binaries to a new GitHub Release
- Update the
versionfield in bothpackage.jsonand the bin script’s config - Publish the updated wrapper to npm
The wrapper version and the binary version should always stay in sync.
Quiet mode
Section titled “Quiet mode”If you want your wrapper to suppress npm-launcher’s progress output by default, set quiet: true in the config:
process.env.MCPTOOLSHOP_LAUNCH_CONFIG = JSON.stringify({ toolName: "my-tool", owner: "your-org", repo: "my-tool", version: "1.0.0", quiet: true,});Users can also set the MCPTOOLSHOP_LAUNCHER_QUIET=1 environment variable to suppress output for any wrapper.