Skip to main content

ncp-runtime

License: Apache-2.0 Python PyPI

Python SDK for the Neural Computation Protocol (NCP) runtime. Run NCP graphs from any Python application: spawn and talk to the ncp runtime binary, get structured per-terminal results, iterate the execution trace.

NCP lets you run routine agent work as small, sandboxed WebAssembly Bricks wired into graphs, so you can skip unnecessary language-model calls and reuse the same workflow across Python, MCP, and LangGraph. See the project README for benchmarks, architecture, and when NCP is worth it.

Install

On supported platforms (Linux x86-64 glibc 2.28+, macOS 11+ ARM64 / 10.13+ x86-64, Windows x86-64) the wheel bundles a verified copy of the ncp runtime binary:

pip install ncp-runtime

For workflow consumption and distribution (install, run, and share versioned workflow archives), install the optional extra:

pip install 'ncp-runtime[workflows]'

Everywhere else, pip install ncp-runtime installs the Python-only fallback wheel without a bundled binary. Install the runtime separately and either keep ncp on PATH or pass an absolute path to NCP(binary=...):

cargo install ncp-runtime --locked

The MCP server (ncp-mcp-server, crates.io) and the LangGraph adapter (ncp-langgraph, PyPI) are not installed by pip install ncp-runtime. Install them separately when you need them.

Verify the install

python -m ncp_runtime.demo

Resolves the ncp binary, runs a tiny bundled graph, prints result_type plus a one-line summary per terminal. Exit 0 on Success.

Quick start: run your own graph

Replace the paths with your own graph and brick directory:

from ncp_runtime import NCP

ncp = NCP()

result = ncp.run(
    graph="/abs/path/to/your-graph.yaml",
    brick_dir="/abs/path/to/your-bricks",
    inputs={"company_url": "https://example.com"},
)

if result.result_type == "Success":
    print(result.terminals[0].output)
else:
    print(result.result_type, result.terminals[0].error)

for record in result.trace():
    print(record)

Prefer deterministic cleanup? Use the context-manager form:

with ncp.run(graph="...", brick_dir="...", inputs={...}) as result:
    ...

Graph-level Failure is a normal return, not an exception. Subprocess-side problems raise an NCPSDKError subclass. See docs/PYTHON_SDK.md for the full contract.

Workflows: install once, run by name

Once a workflow has been packaged and installed, run it by name (no paths, no manifests to wrangle):

from ncp_runtime import NCP

# Prerequisite: the workflow is already installed under $NCP_WORKFLOW_HOME,
# e.g. with `python -m ncp_runtime.workflows install ./archive.tar.gz --sha256 ...`.
result = NCP().run_workflow(
    "com.my-vendor.my-workflow",
    inputs={"text": "hello"},
    version="0.1.0",
)

End-to-end producer + consumer walkthrough (package your own workflow, publish its SHA-256, install it in a fresh environment, and run it from Python, MCP, or LangGraph): examples/workflows/README.md.

Compatibility

v0.4.0 of this SDK pins SUPPORTED_RUNTIME_VERSIONS = ("0.4.0",). The published wheel bundles the matching ncp 0.4.0 runtime binary on supported platforms. See docs/COMPATIBILITY.md for the coordinated-release matrix.

Scope and limitations (honest)

  • Sync only. NCP().run(...) is a synchronous call. Native async support is a future version.
  • One subprocess per call. Each run() starts a new ncp process. Persistent execution and process pooling are not in 0.4.0.
  • No brick authoring. This SDK runs graphs; authoring remains the domain of the Rust brick crates.
  • No MCP in the critical path. Direct ncp run --all-terminals invocation; no MCP stdio dialog.

See docs/PYTHON_SDK.md §13 for the full non-goals list.

Not to be confused with

Aviz Networks publishes an unrelated package named ncp-sdk that also uses an ncp import namespace. This package publishes under the distribution name ncp-runtime and imports as ncp_runtime to avoid any collision.

License

Apache-2.0. See LICENSE and NOTICE.

Metadata

Release files for ncp-runtime 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ncp-runtime 0.4.0
File Size Uploaded Provenance Actions
ncp_runtime-0.4.0.tar.gz 104.1 kB With provenance Details for ncp_runtime-0.4.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for ncp-runtime 0.4.0
File Actions
ncp_runtime-0.4.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for ncp_runtime-0.4.0-py3-none-win_amd64.whl
ncp_runtime-0.4.0-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details for ncp_runtime-0.4.0-py3-none-manylinux_2_28_x86_64.whl
ncp_runtime-0.4.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for ncp_runtime-0.4.0-py3-none-macosx_11_0_arm64.whl
ncp_runtime-0.4.0-py3-none-macosx_10_13_x86_64.whl Python 3 none macOS 10.13+ x86-64 Details for ncp_runtime-0.4.0-py3-none-macosx_10_13_x86_64.whl
ncp_runtime-0.4.0-py3-none-any.whl Python 3 none any Details for ncp_runtime-0.4.0-py3-none-any.whl

Total release size: 13.5 MB

Release files / ncp_runtime-0.4.0.tar.gz

Download URL ncp_runtime-0.4.0.tar.gz
Size 104.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0a02a6e9efd0e0dcceefd1aade2ed8b3a131d13427f3d0b41d85437f1ab7d287
BLAKE2b-256 checksum
How to use checksums
93d9b2f3d131fd111eac655d28c2286b8accc22b62daca5a87c50894d9781576
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

Release files / ncp_runtime-0.4.0-py3-none-win_amd64.whl

Download URL ncp_runtime-0.4.0-py3-none-win_amd64.whl
Size 3.3 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
94f1b1ed94d64316b3dcd613280217a7f3db1b458b9c27fa20827549e18c6fda
BLAKE2b-256 checksum
How to use checksums
44e7b4e861dfff9773524ebcee67bf904baf2da9cd40d8bc9bb8109a45b631f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

Release files / ncp_runtime-0.4.0-py3-none-manylinux_2_28_x86_64.whl

Download URL ncp_runtime-0.4.0-py3-none-manylinux_2_28_x86_64.whl
Size 3.6 MB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
ec5565e8ae86d3de8d6ad2c69f3febcfe6a8f91955dcbcf11b18e2cc45a5b085
BLAKE2b-256 checksum
How to use checksums
0e6de0f62e34d2843f8846204a5869b19301e657f7eccbf03ee43b20075e5efd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

Release files / ncp_runtime-0.4.0-py3-none-macosx_11_0_arm64.whl

Download URL ncp_runtime-0.4.0-py3-none-macosx_11_0_arm64.whl
Size 2.9 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ff3596af78cd38a62fe09daf19b5cbe670ee50cd7392c5c59720b9947d35c808
BLAKE2b-256 checksum
How to use checksums
689aee44af8b6905fdc4e51306625d12bccde77daa363d1f98c4607a4ae33d1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

Release files / ncp_runtime-0.4.0-py3-none-macosx_10_13_x86_64.whl

Download URL ncp_runtime-0.4.0-py3-none-macosx_10_13_x86_64.whl
Size 3.5 MB
Tags Python 3 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
ba64b61b388dc9e9c1a329cdb4080513b1d66bc0b94c3b78e3895613ab6152fa
BLAKE2b-256 checksum
How to use checksums
9b34c621f9b6b7f3b0975ad3b3ef283899996a71dba5ad13335dab21e769f42f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

Release files / ncp_runtime-0.4.0-py3-none-any.whl

Download URL ncp_runtime-0.4.0-py3-none-any.whl
Size 66.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
798f8089891e75003ac35df4e21b1cd12ee65e2b6e2b2a273faa85db8bdebed1
BLAKE2b-256 checksum
How to use checksums
4f2df1ca88044a768a47b38d2c5590263a706397deb5ce169b89283449ebff10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

Security for ncp-runtime 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for ncp_runtime-0.4.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.4.0 This release

6 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page