.md

Share a pack

Find packs with hcpx search, add yours to the catalog by pull request, publish one as an npm package or extract a gold pack into its own repository.

On this page

A shared pack is a directory someone else can lint, install and exec. GitHub holds the files and the community catalog indexes them by pull request, with an npm package as a convenience install on top.

Minimum to share#

FileRequired
surface.jsonYes
policy.jsonYes
HARNESS.mdYes
LICENSEYes for a standalone repo
README.mdYes for a standalone repo
Wrapped binInside the pack directory, relative path

Keep credentials out of the pack, host-absolute paths out of the Skill and product brand names out of public gold packs.

Catalog#

Packs lists every pack you can install today, with its commands and what each one asks before it writes. hcpx search reads the same index (/api/v1/packs), and HCP_CATALOG_URL points it at a private one.

Terminal
hcpx search transit --json
hcpx init transit --template transit
hcpx install ./transit --json
hcpx activate transit --json
hcpx exec transit plan --json -- from=A to=B

To add your own, scaffold it (--class public-read or gated-write), lint it and let hcpx share print the catalog row:

Terminal
hcpx init weather --class public-read
# edit the three files
hcpx lint ./weather --json
hcpx share ./weather --json

Paste the row into content/catalog/packs.json in a pull request. Reviewers check lint, the class, and that the Skill names every command.

Pack signing, provenance, integrity hashes and pack_id@version resolution belong to the HCP/2.0 registry, and a catalog pull request does not mint them. Until then you install from a directory or a scaffold the CLI writes, and a runtime may install any directory that lints.

npm package#

A pack directory can also be an npm package, by this convention:

FieldValue
"hcp": { "pack": "." }Where surface.json lives inside the package
dependencies["@harnesscontextprotocol/cli"]Installs the CLI (hcpx, also hcp)
binOptional wrap CLI (transit, weather, …). Never name it hcpx or hcp
filesThe three protocol files plus wrap bin/
Terminal
hcpx install npm:@scope/hcp-pack-name --json
hcpx install npm:./path/to/pack --json

HCP's own packages stay a private preview on GitHub Packages by choice (access: restricted on @harnesscontextprotocol/sdk, @harnesscontextprotocol/cli and @harnesscontextprotocol/example), so they are not on the public npm registry.

Extract a gold pack into its own repository#

examples/standalone/transit in the SDK repo is the gold pack built to extract, with the demo binary next to the three files, an MIT licence and a vendor-neutral README, so the extract is a plain copy. Work through this list before gh repo create harnesscontextprotocol/hcp-example-transit, and keep the repository private until every item holds:

  1. bun run verify:legal passes on the docs site.
  2. The pack lints clean from a fresh clone: hcpx lint . --json.
  3. wrap.bin is a path inside the repo (./bin/transit.mjs), not ../../bins/.
  4. README shows install, activate, and one read exec.
  5. No tokens, .env, or host paths.
  6. Licence matches the SDK (MIT for executable examples).