Official Python SDK for Zero Context Protocol (ZCP), with MCP-compatible server surfaces and native protocol support
Project description
Zero Context Protocol Python SDK
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 profilesexamples: public examples, migration paths, and benchmark entrypointstests: SDK, MCP compatibility, transport, and benchmark regression coveragetools: local benchmark harnesses and benchmark suitesbenchmark_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.9vs30723.7total 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
- SDK/runtime:
src/zcp - examples:
examples/README.md - tests:
tests - benchmark reproduction:
benchmark_reports/README.md
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:
- compact tool-call benchmark:
examples/compare_zcp_mcp_tool_call_benchmark.py - Excel LLM token benchmark:
examples/compare_excel_client_protocol_benchmark.py
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file zero_context_protocol_sdk-0.2.0.tar.gz.
File metadata
- Download URL: zero_context_protocol_sdk-0.2.0.tar.gz
- Upload date:
- Size: 61.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
506650e8c44e09c5c474af60faf7ade69e77e85f833f5a8bd205387e5cfd91b9
|
|
| MD5 |
98706a4e00d678864ab73b4d7dc5d0b8
|
|
| BLAKE2b-256 |
71529406bae85ce1ccacaf62288b10d8a2ac824155bada1a9b5b7a256dc08a18
|
Provenance
The following attestation bundles were made for zero_context_protocol_sdk-0.2.0.tar.gz:
Publisher:
release.yml on FishCodeTech/zero-context-protocol-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
zero_context_protocol_sdk-0.2.0.tar.gz -
Subject digest:
506650e8c44e09c5c474af60faf7ade69e77e85f833f5a8bd205387e5cfd91b9 - Sigstore transparency entry: 1132727182
- Sigstore integration time:
-
Permalink:
FishCodeTech/zero-context-protocol-python@81431dd0fe2903a4033929e24890cb072077f602 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/FishCodeTech
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@81431dd0fe2903a4033929e24890cb072077f602 -
Trigger Event:
push
-
Statement type:
File details
Details for the file zero_context_protocol_sdk-0.2.0-py3-none-any.whl.
File metadata
- Download URL: zero_context_protocol_sdk-0.2.0-py3-none-any.whl
- Upload date:
- Size: 52.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
398c6d358f60b4177be664e9a09b0e0a14ce3f67f56cbe3a410f86563444f6d7
|
|
| MD5 |
93b88e6772524b4f11d58ba303dd8718
|
|
| BLAKE2b-256 |
e885b598cada2190c2d67d70c5ab6a555e93264c70387c1c58c2de256794c32c
|
Provenance
The following attestation bundles were made for zero_context_protocol_sdk-0.2.0-py3-none-any.whl:
Publisher:
release.yml on FishCodeTech/zero-context-protocol-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
zero_context_protocol_sdk-0.2.0-py3-none-any.whl -
Subject digest:
398c6d358f60b4177be664e9a09b0e0a14ce3f67f56cbe3a410f86563444f6d7 - Sigstore transparency entry: 1132727243
- Sigstore integration time:
-
Permalink:
FishCodeTech/zero-context-protocol-python@81431dd0fe2903a4033929e24890cb072077f602 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/FishCodeTech
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@81431dd0fe2903a4033929e24890cb072077f602 -
Trigger Event:
push
-
Statement type: