The host protocol lets clients discover hosts, find notebooks, edit documents, and follow execution through HTTP requests and event streams.
- Specification — the model and behavior a host implements.
- OpenAPI — HTTP routes and wire schemas, printed on demand.
- TypeScript client — connect to a host.
- Effect contracts — author the definitions.
- Examples, conformance tests, and experimental features.
Edit the definitions in packages/host-protocol.
The Python and TypeScript bindings are generated from them and checked in.
They should not be edited by hand.
Keep the specification, implementation, and relevant fixtures or tests in step with the change. After the repository development setup, run from the root:
make host-protocol-codegen
pnpm --dir packages/client codegen
make host-protocol-check
pnpm --dir packages/client codegen:checkThe first command generates Python and the second generates TypeScript. The checks verify those outputs and run the portable fixtures.
Also run the package checks and tests for the implementation you changed. To check a host over a real connection, use the live conformance suite.
No OpenAPI file is checked in. The package prints the document as JSON.
node packages/host-protocol/scripts/openapi.ts # the stable protocol
node packages/host-protocol/scripts/openapi.ts --experimental # with experimental featuresThe script needs Node and the package's one dependency, which
pnpm install --filter @marimo-team/host-protocol --prod installs.
To build on the stable protocol in another language, save the first output and point an OpenAPI generator at it. marimo's own bindings use the second, which adds every experimental feature.
CI compares the stable document with the base branch and fails when they
differ. New work goes behind an experimental feature,
which the check leaves out. For a deliberate change, add the
stable-protocol-change label to the pull request. To run the comparison
locally:
protocols/host/check-stable.sh origin/main