Python SDK for the mpak registry - MCPB bundles and Agent Skills
Project description
mpak Python SDK
Python SDK for the mpak registry - search, download, and resolve MCPB bundles and Agent Skills.
Installation
pip install mpak
Quick Start
from mpak import MpakClient
# Create client
client = MpakClient()
# Resolve a bundle to download URL
download = client.get_bundle_download("@nimblebraininc/echo", version="latest")
print(f"Download URL: {download.url}")
print(f"SHA256: {download.sha256}")
# Download and extract a bundle
manifest = client.load_bundle("@nimblebraininc/echo", dest="/app/bundle")
print(f"Loaded: {manifest['name']} v{manifest['version']}")
CLI Usage
The package provides a mpak-loader CLI that replaces the standalone mcpb-loader.py script:
# Load from mpak registry
mpak-loader @nimblebraininc/echo /dest/dir
# Load specific version
mpak-loader @nimblebraininc/echo@1.0.0 /dest/dir
# Load from direct URL with SHA256 verification
mpak-loader https://example.com/bundle.mcpb /dest/dir abc123...
Development
Setup
# Install with dev dependencies
uv pip install -e ".[dev]"
# Generate types from OpenAPI spec
python scripts/generate-types.py
Testing
# Run tests
pytest
# Run with coverage
pytest --cov=mpak --cov-report=html
# Lint and format
ruff check .
ruff format .
Verification
Run all checks before submitting changes:
uv run ruff check src/ tests/ # lint
uv run ruff format --check src/ tests/ # format
uv run ty check src/ # type check
uv run pytest -m "not integration" # unit tests
uv run pytest -m integration # integration tests (hits live registry)
CI runs lint, format, type check, and unit tests on every PR via sdk-python-ci.yml.
Releasing
Releases are automated via GitHub Actions and PyPI trusted publishing (OIDC). No API tokens required.
Version is defined in one place: pyproject.toml. The runtime version (mpak.__version__) and User-Agent are derived automatically via importlib.metadata.
Steps
-
Bump version in
pyproject.toml:# Edit pyproject.toml version field, or use hatch: hatch version patch # 0.1.0 → 0.1.1 hatch version minor # 0.1.0 → 0.2.0 hatch version major # 0.1.0 → 1.0.0
-
Commit and push:
git commit -am "sdk-python: bump to X.Y.Z" git push
-
Tag and push (this triggers the publish):
git tag sdk-python-vX.Y.Z git push origin sdk-python-vX.Y.Z
CI will run the full verification suite, verify the tag matches pyproject.toml, build, and publish to PyPI. See sdk-python-publish.yml.
Type Generation
The SDK types are generated from the mpak registry OpenAPI spec. To regenerate:
python scripts/generate-types.py
This fetches the latest spec from https://registry.mpak.dev/docs/json and generates Pydantic models in src/mpak/generated/types.py.
License
Apache-2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mpak-0.1.1.tar.gz.
File metadata
- Download URL: mpak-0.1.1.tar.gz
- Upload date:
- Size: 54.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
586669f130961c478e8cc0e340cbbd6ecd30f5f0a35298f0607ed661113910a3
|
|
| MD5 |
cc7241338be9bd8e100817043d38d14d
|
|
| BLAKE2b-256 |
e0132becea7727535afc5fdd72fac6c59826c038c125ab0d3e750cddfd3c46c9
|
Provenance
The following attestation bundles were made for mpak-0.1.1.tar.gz:
Publisher:
sdk-python-publish.yml on NimbleBrainInc/mpak
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mpak-0.1.1.tar.gz -
Subject digest:
586669f130961c478e8cc0e340cbbd6ecd30f5f0a35298f0607ed661113910a3 - Sigstore transparency entry: 968374582
- Sigstore integration time:
-
Permalink:
NimbleBrainInc/mpak@de40e924bf26de410fc54c23b3a8410c9931a33c -
Branch / Tag:
refs/tags/sdk-python-v0.1.1 - Owner: https://github.com/NimbleBrainInc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
sdk-python-publish.yml@de40e924bf26de410fc54c23b3a8410c9931a33c -
Trigger Event:
push
-
Statement type:
File details
Details for the file mpak-0.1.1-py3-none-any.whl.
File metadata
- Download URL: mpak-0.1.1-py3-none-any.whl
- Upload date:
- Size: 11.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3d4eae1acd29c455f15f0401fd220025dc216b5c17995d9be9df64ade50b2dc
|
|
| MD5 |
28dcaf83b7f537e7024eea5a250597cd
|
|
| BLAKE2b-256 |
c22c807f35edefad262c81c0f963d647f996a33812e0ff919fed247d2d1ad367
|
Provenance
The following attestation bundles were made for mpak-0.1.1-py3-none-any.whl:
Publisher:
sdk-python-publish.yml on NimbleBrainInc/mpak
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mpak-0.1.1-py3-none-any.whl -
Subject digest:
d3d4eae1acd29c455f15f0401fd220025dc216b5c17995d9be9df64ade50b2dc - Sigstore transparency entry: 968374666
- Sigstore integration time:
-
Permalink:
NimbleBrainInc/mpak@de40e924bf26de410fc54c23b3a8410c9931a33c -
Branch / Tag:
refs/tags/sdk-python-v0.1.1 - Owner: https://github.com/NimbleBrainInc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
sdk-python-publish.yml@de40e924bf26de410fc54c23b3a8410c9931a33c -
Trigger Event:
push
-
Statement type: