Skip to main content

Zero Context Protocol Python SDK

PyPI version Python versions PyPI status

zero-context-protocol-python is the reference Python SDK and runtime for Zero Context Protocol (ZCP).

It serves two goals at the same time:

  • provide a native ZCP runtime that can optimize tool exposure, routing, and token usage for agent workflows
  • remain compatible with MCP-facing integrations through stdio, streamable HTTP, and WebSocket surfaces

The public Python surface remains:

  • distribution name: zero-context-protocol-sdk
  • import path: import zcp

The companion protocol and documentation repository lives in zero-context-protocol.

What This Repository Owns

  • src/zcp: official SDK, runtime, transports, gateway, auth, and profiles
  • examples: public examples, migration paths, and benchmark entrypoints
  • tests: SDK, MCP compatibility, transport, and benchmark regression coverage
  • tools: local benchmark harnesses and benchmark suites
  • benchmark_reports: published benchmark artifacts

Why ZCP Instead Of Plain MCP

ZCP keeps the MCP compatibility surface, but adds native runtime affordances for model-facing efficiency:

  • handle-first results and compact tool output shaping
  • semantic workflow profiles for native tool discovery
  • staged tool exposure for complex workflows
  • task-aware runtime behavior
  • benchmark-backed token reductions in real LLM scenarios

The latest published Excel benchmark lives in benchmark_reports/full_semantic_compare_v5. Current headline result:

  • overall native ZCP vs MCP surface: 8027.9 vs 30723.7 total tokens
  • overall advantage: 3.83x

Install

From PyPI:

pip install zero-context-protocol-sdk

With optional extras:

pip install "zero-context-protocol-sdk[openai,mcp]"

For local development from source:

pip install -e ".[dev,openai,mcp]"

Python 3.10+ is required.

3-Minute Quickstart

Run a minimal MCP-compatible stdio server:

python3 examples/run_zcp_mcp_stdio_server.py

Run an ASGI service exposing native and MCP-compatible surfaces:

python3 examples/run_zcp_api_server.py

Run the smallest native ZCP example:

python3 examples/zcp_weather_server.py

List native semantic workflow tools from a client:

from zcp import SemanticWorkflowProfile

profile = SemanticWorkflowProfile()
tools = await client.list_tools(**profile.as_list_tools_params())

Stable, Beta, Experimental

Stable

  • tools
  • resources and resource templates
  • prompts
  • completion/complete
  • MCP-compatible stdio
  • MCP-compatible HTTP at /mcp
  • native ZCP tool transport helpers
  • bearer auth metadata and server wiring
  • tool profiles and semantic workflow discovery

Beta

  • streamable HTTP resume/replay behavior
  • WebSocket transport
  • OAuth provider integration
  • task-oriented tool execution

Experimental

  • advanced sampling / elicitation orchestration
  • benchmark-specific semantic workflow adapters outside the public examples

Repository Layout

Validation

Fast local validation:

PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 python3 -m pytest -q

The current repo subset used for release-focused validation includes transport, SDK, gateway, and benchmark regression coverage.

Benchmarks

Primary public benchmark entrypoints:

Public benchmark guidance and official artifact selection:

Security Note

Benchmark and provider-backed examples require environment variables. Do not commit API keys. Use .env.example as the reference shape.

License

Apache-2.0. See LICENSE.

Metadata

Release files for zero-context-protocol-sdk 0.2.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 zero-context-protocol-sdk 0.2.0
File Size Uploaded Provenance Actions
zero_context_protocol_sdk-0.2.0.tar.gz 61.9 kB With provenance Details for zero_context_protocol_sdk-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for zero-context-protocol-sdk 0.2.0
File Interpreter ABI Platform Actions
zero_context_protocol_sdk-0.2.0-py3-none-any.whl Python 3 none any Details for zero_context_protocol_sdk-0.2.0-py3-none-any.whl

Total release size: 114.2 kB

Release files / zero_context_protocol_sdk-0.2.0.tar.gz

Download URL zero_context_protocol_sdk-0.2.0.tar.gz
Size 61.9 kB
Tags Source
SHA-256 checksum
How to use checksums
506650e8c44e09c5c474af60faf7ade69e77e85f833f5a8bd205387e5cfd91b9
BLAKE2b-256 checksum
How to use checksums
71529406bae85ce1ccacaf62288b10d8a2ac824155bada1a9b5b7a256dc08a18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Mar 19, 2026.

Transparency log

Release files / zero_context_protocol_sdk-0.2.0-py3-none-any.whl

Download URL zero_context_protocol_sdk-0.2.0-py3-none-any.whl
Size 52.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
398c6d358f60b4177be664e9a09b0e0a14ce3f67f56cbe3a410f86563444f6d7
BLAKE2b-256 checksum
How to use checksums
e885b598cada2190c2d67d70c5ab6a555e93264c70387c1c58c2de256794c32c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Mar 19, 2026.

Transparency log

Security for zero-context-protocol-sdk 0.2.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 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for zero_context_protocol_sdk-0.2.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 Mar 19, 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.

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