MirrorNeuron Developer Manual

Use the Python SDK

Inspect runtime jobs and load, configure, and compile blueprint packages.

Use Python 3.11 or newer in an environment with a compatible mirrorneuron-python-sdk installation. For HTTP integrations, use the HTTP API; mn_sdk.Client talks to Core over gRPC.

Inspect jobs and runs

With the runtime started, run this Python code:

from mn_sdk import Client

client = Client(target="localhost:55051")
print(client.list_jobs())
print(client.list_runs())

The client defaults can be configured through MN_GRPC_TARGET, MN_GRPC_TIMEOUT_SECONDS, and MN_GRPC_AUTH_TOKEN. Keep tokens out of source code and logs.

Load and compile a blueprint

Run from the directory containing a reviewed package, replacing ./my-blueprint with its path:

from mn_sdk.blueprints import open_blueprint, resolve_config, compile_blueprint

with open_blueprint("./my-blueprint") as package:
    configuration = resolve_config(package, {})
    compiled = compile_blueprint(package, configuration)
    print(package.manifest["id"], compiled.fingerprint)

open_blueprint accepts a folder or ZIP. Configuration combines declared defaults, config/overwrite.json, and invocation overrides in that order after SDK feature projections. Supply overrides as the second argument to resolve_config.

Compilation validates and builds a runtime descriptor; it does not start a run. Compilation can import declared StepSpec code in subprocesses, so review the package first. For a complete launch and resource-preparation path, use Quickstart.

Declare optional capabilities

Put SDK component distributions in the package's dependencies.json:

{
  "$schema": "https://mirrorneuron.io/schemas/blueprint/v1/dependencies.schema.json",
  "packages": [
    {"type": "pip", "source": "gar", "name": "mn-python-sdk-mcp", "version": ">=1.3,<2.0"},
    {"type": "pip", "source": "gar", "name": "mn-python-sdk-rag", "version": ">=1.3,<2.0", "extras": ["milvus"]}
  ]
}

Choose constraints compatible with your released SDK. Exact versions and supported ranges are described in Dependency versions. Milvus is opt-in; installing a provider alone does not enable it for every blueprint.

Inside a prepared worker:

from mn_sdk.components import ComponentRegistry

registry = ComponentRegistry.from_environment()
call_tool = registry.service("mcp", "call_tool")

Lookup is lazy and does not install packages. Missing or undeclared capabilities must be resolved in the package before submission.

On this page