|
| 1 | +# Zero Context Protocol Python SDK |
| 2 | + |
| 3 | +This repository is the official Python SDK for Zero Context Protocol. |
| 4 | + |
| 5 | +The public Python surface stays: |
| 6 | + |
| 7 | +- package name: `zcp` |
| 8 | +- import path: `import zcp` |
| 9 | + |
| 10 | +The companion documentation and protocol site lives separately as |
| 11 | +`zero-context-protocol`. |
| 12 | + |
| 13 | +## What This Repository Owns |
| 14 | + |
| 15 | +- `src/zcp`: the official Python SDK and runtime |
| 16 | +- `examples`: official and reference Python examples |
| 17 | +- `tests`: SDK, MCP compatibility, and runtime regression tests |
| 18 | +- `tools`: repository-local tooling such as the real SDK benchmark harness |
| 19 | +- `benchmark_reports`: generated benchmark artifacts that the docs site can consume |
| 20 | + |
| 21 | +## Install |
| 22 | + |
| 23 | +```bash |
| 24 | +pip install -e ".[dev,openai,mcp]" |
| 25 | +``` |
| 26 | + |
| 27 | +Python `3.10+` is required. The MCP extra uses the official MCP Python SDK. |
| 28 | + |
| 29 | +## Official Paths |
| 30 | + |
| 31 | +### MCP-compatible stdio server |
| 32 | + |
| 33 | +```bash |
| 34 | +python3 examples/run_zcp_mcp_stdio_server.py |
| 35 | +``` |
| 36 | + |
| 37 | +### ASGI server with `/zcp` and `/mcp` |
| 38 | + |
| 39 | +```bash |
| 40 | +python3 examples/run_zcp_api_server.py |
| 41 | +``` |
| 42 | + |
| 43 | +### Native ZCP example |
| 44 | + |
| 45 | +```bash |
| 46 | +python3 examples/zcp_weather_server.py |
| 47 | +``` |
| 48 | + |
| 49 | +### Real SDK benchmark |
| 50 | + |
| 51 | +```bash |
| 52 | +python3 examples/compare_zcp_mcp_tool_call_benchmark.py --repeats 2 |
| 53 | +``` |
| 54 | + |
| 55 | +Generated reports land in `benchmark_reports/`. |
| 56 | + |
| 57 | +## Validation |
| 58 | + |
| 59 | +```bash |
| 60 | +python3 -m pytest -q |
| 61 | +``` |
| 62 | + |
| 63 | +## Alpha Boundary |
| 64 | + |
| 65 | +Repo-level alpha guarantees focus on: |
| 66 | + |
| 67 | +- `initialize`, `initialized`, `ping` |
| 68 | +- tools |
| 69 | +- resources |
| 70 | +- prompts |
| 71 | +- MCP-compatible stdio |
| 72 | +- MCP-compatible HTTP at `/mcp` |
| 73 | +- native ZCP transport helpers |
| 74 | +- bearer auth on the ASGI surface |
| 75 | + |
| 76 | +These remain partial or experimental unless separately contract-tested: |
| 77 | + |
| 78 | +- logging parity details |
| 79 | +- sampling |
| 80 | +- elicitation |
| 81 | +- tasks |
| 82 | +- OAuth flows beyond exposed metadata |
| 83 | + |
| 84 | +## Benchmarks |
| 85 | + |
| 86 | +Use only the real SDK benchmark as the primary evidence source: |
| 87 | + |
| 88 | +- script: `examples/compare_zcp_mcp_tool_call_benchmark.py` |
| 89 | +- harness: `tools/benchmarking.py` |
| 90 | +- reports: `benchmark_reports/zcp_mcp_tool_call_benchmark.json` and `.md` |
| 91 | + |
| 92 | +The static payload comparison in `examples/compare_mcp_zcp_profiles.py` is only |
| 93 | +reference material and is not the primary benchmark source. |
0 commit comments