installation
Installation
How to install the Klock kernel and SDKs to your project.
Klock is comprised of the core coordination kernel and the language-specific SDKs. You can run the kernel locally on a single machine or deploy it as a standalone container.
Python
If you are building Python agents (like LangChain or Custom scripts), install the Python SDK. This includes the core Rust bindings automatically via PyO3.
pip install klock
Tip: If you use LangChain, run pip install klock-langchain to get the adapters too.
JavaScript / TypeScript
For TypeScript developers, Klock provides pre-compiled Native Node modules (napi-rs).
npm install @klock-protocol/core
Rust (Native)
Since Klock is built in Rust, you get the absolute fastest integration natively.
cargo add klock-core
Running the Standalone API Server
If you want to run Klock as a centralized lock server for distributed multi-agent systems, you can run the standalone HTTP server.
cargo build --release -p klock-cli
./target/release/klock serve --port 3100
Server Configuration
| Flag | Default | Env Var | Description |
|------|---------|---------|-------------|
| --port | 3100 | — | HTTP port |
| --host | 0.0.0.0 | — | Bind address |
| --storage | memory | KLOCK_STORAGE | memory or sqlite:<path> |
| — | — | KLOCK_API_KEY | API key for authentication (optional) |
Docker Setup
docker compose up -d
curl http://localhost:3100/health