Skip to content

mpak cache

When you run mpak bundle run, bundles are downloaded and cached locally. The cache makes subsequent runs instant.

Bundles are cached in your home directory:

~/.mpak/cache/
└── scope-name/
├── .mpak-meta.json
├── manifest.json
├── src/
└── deps/

Package names are flattened: @scope/name becomes scope-name. Only one version is cached per package. Running a newer version replaces the previous cached version.

ScenarioWhat Happens
First runDownloads .mcpb from the registry, extracts to cache, runs
Subsequent runUses cached extraction, runs immediately
run with --updateRe-downloads from registry and replaces cache
run with @versionUses cache if version matches, otherwise downloads and replaces
pullDownloads .mcpb file to the current directory (does not populate the cache)

The cache is a simple directory structure. No database, no lock files, no background processes.

Terminal window
rm -rf ~/.mpak/cache

The next mpak bundle run will re-download as needed.

Terminal window
rm -rf ~/.mpak/cache/org-server

This removes the cached version of that package. The directory name is the package name with @ removed and / replaced by - (e.g. @org/server becomes org-server).

Check how much space the cache is using:

Terminal window
du -sh ~/.mpak/cache

Check individual packages:

Terminal window
du -sh ~/.mpak/cache/*

Typical bundle sizes range from 1-10MB. A cache with 50 packages might use 100-500MB.

Cached bundles work offline. If a bundle has been downloaded and extracted, mpak bundle run does not need network access to run it.

This means you can:

  • Run a bundle once while online, then run offline anytime
  • Use mpak in air-gapped environments (with pre-populated cache)
  • Run without worrying about registry availability
Terminal window
# Run once to populate cache
mpak bundle run @org/server
# Later, even without internet
mpak bundle run @org/server
VariableDefaultDescription
MPAK_REGISTRY_URLhttps://registry.mpak.devOverride the registry API URL