Metadata-Version: 2.4
Name: pdc-protocol
Version: 1.1.0
Summary: PDC (Continuity Point / Ponto de Continuidade) reference implementation: verifiable continuity of conversations across AIs and devices
Author: Paulo Freitas
License-Expression: MIT
Project-URL: Homepage, https://github.com/paulopdc/pdc-protocol
Project-URL: Specification, https://github.com/paulopdc/pdc-protocol/blob/main/SPEC.md
Project-URL: Documentation, https://github.com/paulopdc/pdc-protocol/blob/main/docs/clients.md
Project-URL: Issues, https://github.com/paulopdc/pdc-protocol/issues
Keywords: ai,mcp,memory,continuity,llm,protocol,ia,continuidade
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: mcp>=1.2
Provides-Extra: mcp
Provides-Extra: test
Requires-Dist: pytest>=8; extra == "test"
Provides-Extra: teste
Requires-Dist: pytest>=8; extra == "teste"

# pdc-protocol — reference implementation

<!-- mcp-name: io.github.paulopdc/pdc-protocol -->

🌐 **English** · [Português (Brasil)](README.pt-BR.md)

Reference server for [PDC — Continuity Point (Ponto de Continuidade)](https://github.com/paulopdc/pdc-protocol/blob/main/README.md) 1.0.

- `pdc/nucleo.py`: pure-Python core (standard library only, SQLite), with the CF calculation, base-point control and idempotency.
- `pdc/servidor_mcp.py`: MCP server with the tools from section 6 of the specification (`mcp` SDK 1.x or 2.x).
- `pdc/http_seguro.py`: access control for HTTP mode (token in a header or in the URL, host checking, `/health`).
- `pdc/instrucoes.py`: protocol instructions given to AIs, in English (default) and Brazilian Portuguese.
- `tests/`: tests, including every vector in `test-vectors/` and the HTTP mode.

```bash
pip install -e ".[mcp]"
pdc-server --register-pa NB1 "Laptop"
pdc-server                      # stdio, for AI clients on this computer
pdc-server --lang pt-BR         # instructions for AIs in Brazilian Portuguese
pdc-server --brief 12345678     # last point as plain text, for an AI with no connection

# remote: always behind HTTPS (see deploy/README.md in the repository)
export PDC_TOKEN="$(pdc-server --new-token)"
pdc-server --http --host 127.0.0.1 --port 8765 --allowed-host pdc.example.com
```

Data lives in `~/.pdc` (variable `PDC_DIR`): `pdc.sqlite3` and `conferencia.key`, both with mode 600. Back up both. Without the key, old CFs no longer verify.

Python identifiers and protocol names (operations, fields, error codes) are canonical and stay in Portuguese, as defined by the specification. The Portuguese spellings from the first release still work: `pdc-servidor`, `--porta`, `--cadastrar-pa`, `--idioma`, `PDC_PASTA` and `PDC_IDIOMA`.

License: MIT.
