Skip to main content

Reference Python SDK for the MCP Spatial Asset Profile v2 — JSON envelope for 3D / spatial assets in Model Context Protocol tool ecosystems.

Project description

mcp-spatial-asset-profile — Python SDK

Reference Python SDK for the MCP Spatial Asset Profile v2 — a JSON envelope format for 3D / spatial assets in Model Context Protocol (MCP) tool ecosystems.

Status — Proof of Concept. The format is usable for prototyping and interoperability experiments. The wire format is not yet frozen; feedback via GitHub Discussions is explicitly welcome before v2.1.

Installation

Once published to PyPI:

pip install mcp-spatial-asset-profile
# Optional: enable JSON Schema validation
pip install "mcp-spatial-asset-profile[validate]"

From source (this repository):

cd sdk/python
pip install -e ".[dev]"

Quick Start

from spatial_asset_v2.models import SpatialAsset, Representation, Spatial
from spatial_asset_v2.codec import encode_asset, decode_asset
from spatial_asset_v2.validators import validate_asset
from spatial_asset_v2.workflow import WorkflowMockRunner

# Create a v2 asset
asset = SpatialAsset(
    asset_id="urn:uuid:550e8400-e29b-41d4-a716-446655440001",
    kind="point-cloud",
    representations=[
        Representation(format="ply", uri="samples/bunny.ply", point_count=35947)
    ],
    spatial=Spatial(unit="m", up_axis="+Y"),
    name="Stanford Bunny",
)

# Encode to dict / JSON
d = encode_asset(asset)

# Decode from dict
asset2 = decode_asset(d)

# Validate against JSON schema (requires jsonschema)
errors = validate_asset(d)
print("Valid:", len(errors) == 0)

# Run mock segmentation workflow
runner = WorkflowMockRunner(base_dir="samples/inspection")
pipeline = runner.run_full_pipeline(
    source_asset_id="urn:uuid:...",
    source_ply_path="bunny_full.ply"
)

Modules

Module Description
spatial_asset_v2.models Pydantic-free dataclass models for all asset kinds
spatial_asset_v2.codec Encoder / decoder (dict ↔ model)
spatial_asset_v2.validators.schema_validator JSON Schema validation (optional dep)
spatial_asset_v2.validators.traceability Asset graph traceability validation
spatial_asset_v2.workflow Mock workflow runner for pipeline testing
spatial_asset_v2.samples Sample asset generator
spatial_asset_v2.cli Command-line interface

CLI

# Validate a JSON asset file
spatial-asset-v2 validate spec/examples/pointcloud-asset.json

# Generate sample assets
spatial-asset-v2 generate --output /tmp/samples

# Run mock segmentation pipeline
spatial-asset-v2 workflow --source spec/examples/pointcloud-asset.json

# Migrate v1 asset to v2
spatial-asset-v2 migrate old-asset-v1.json new-asset-v2.json

Running Tests

cd sdk/python
pip install -e ".[dev]"
pytest tests/ -v

License

MIT — see the LICENSE file at the repository root.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_spatial_asset_profile-0.1.0.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_spatial_asset_profile-0.1.0-py3-none-any.whl (20.2 kB view details)

Uploaded Python 3

File details

Details for the file mcp_spatial_asset_profile-0.1.0.tar.gz.

File metadata

File hashes

Hashes for mcp_spatial_asset_profile-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e67ba76802bd93576f45414d850ed449e4213a9cee4ff977f56d24da04fc9657
MD5 6beb3d55efd7201007be1ff969227a22
BLAKE2b-256 0f12117d7c913d45558374254a2a33c3760519d6719f716904da2e50bca8e609

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_spatial_asset_profile-0.1.0.tar.gz:

Publisher: publish-packages.yml on furuse-kazufumi/mcp-spatial-asset-profile

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mcp_spatial_asset_profile-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_spatial_asset_profile-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fbeb886705f117a9f490296e055956553ac411ba7c2ae20a9c42c0894dac5974
MD5 9ce71e2e21371f2a910d3e817a86766f
BLAKE2b-256 a60f492ddabb385e2df4c95458c5bfcf888d75540f0227c25357008cb75cdfca

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_spatial_asset_profile-0.1.0-py3-none-any.whl:

Publisher: publish-packages.yml on furuse-kazufumi/mcp-spatial-asset-profile

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page