Metadata-Version: 2.4
Name: mpak
Version: 0.1.0
Summary: Python SDK for the mpak registry - MCPB bundles and Agent Skills
Project-URL: Homepage, https://mpak.dev
Project-URL: Documentation, https://mpak.dev/docs
Project-URL: Repository, https://github.com/NimbleBrainInc/mpak
Project-URL: Issues, https://github.com/NimbleBrainInc/mpak/issues
Author-email: NimbleBrain Inc <engineering@mpak.dev>
License: Apache-2.0
Keywords: agent-skills,mcp,mcpb,model-context-protocol,mpak
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.11
Requires-Dist: httpx>=0.27
Requires-Dist: pydantic>=2.0
Provides-Extra: dev
Requires-Dist: datamodel-code-generator>=0.26; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: respx>=0.22; extra == 'dev'
Requires-Dist: ruff>=0.8; extra == 'dev'
Requires-Dist: ty>=0.0.1a1; extra == 'dev'
Description-Content-Type: text/markdown

# mpak Python SDK

Python SDK for the mpak registry - search, download, and resolve MCPB bundles and Agent Skills.

## Installation

```bash
pip install mpak
```

## Quick Start

```python
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:

```bash
# 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

```bash
# Install with dev dependencies
uv pip install -e ".[dev]"

# Generate types from OpenAPI spec
python scripts/generate-types.py
```

### Testing

```bash
# Run tests
pytest

# Run with coverage
pytest --cov=mpak --cov-report=html

# Lint and format
ruff check .
ruff format .
```

## Type Generation

The SDK types are generated from the mpak registry OpenAPI spec. To regenerate:

```bash
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
