Skip to main content

Official Python SDK for Zero Context Protocol (ZCP), with MCP-compatible server surfaces and native protocol support

Project description

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.

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

zero_context_protocol_sdk-0.2.0.tar.gz (61.9 kB view details)

Uploaded Source

Built Distribution

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

zero_context_protocol_sdk-0.2.0-py3-none-any.whl (52.3 kB view details)

Uploaded Python 3

File details

Details for the file zero_context_protocol_sdk-0.2.0.tar.gz.

File metadata

File hashes

Hashes for zero_context_protocol_sdk-0.2.0.tar.gz
Algorithm Hash digest
SHA256 506650e8c44e09c5c474af60faf7ade69e77e85f833f5a8bd205387e5cfd91b9
MD5 98706a4e00d678864ab73b4d7dc5d0b8
BLAKE2b-256 71529406bae85ce1ccacaf62288b10d8a2ac824155bada1a9b5b7a256dc08a18

See more details on using hashes here.

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

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

File details

Details for the file zero_context_protocol_sdk-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for zero_context_protocol_sdk-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 398c6d358f60b4177be664e9a09b0e0a14ce3f67f56cbe3a410f86563444f6d7
MD5 93b88e6772524b4f11d58ba303dd8718
BLAKE2b-256 e885b598cada2190c2d67d70c5ab6a555e93264c70387c1c58c2de256794c32c

See more details on using hashes here.

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

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