@chio-protocol/sdk
v0.1.0
Published
TypeScript SDK for the Chio (Chio) protocol
Maintainers
Readme
@chio-protocol/sdk
Stable TypeScript SDK for Chio hosted MCP sessions, receipt queries, and invariant verification.
Installation
npm install @chio-protocol/sdkRequirements: Node.js >=22. The package ships as ESM and includes .d.ts
types in the published artifact.
Quickstart
import { ChioClient, ReceiptQueryClient } from "@chio-protocol/sdk";
const client = ChioClient.withStaticBearer("http://127.0.0.1:8931", "demo-token");
const session = await client.initialize();
try {
const tools = await session.listTools();
console.log(tools);
const receipts = await new ReceiptQueryClient(
"http://127.0.0.1:8940",
"demo-token",
).query({ toolServer: "wrapped-http-mock", limit: 5 });
console.log(receipts.totalCount);
} finally {
await session.close();
}API Reference
ChioClientandChioSessioncover Chio hosted MCP HTTP sessions.ReceiptQueryClientwrapsGET /v1/receipts/query.signDpopProofsigns DPoP proofs for governed invocations.@chio-protocol/sdk/invariantsexposes canonical JSON, hashing, signing, receipt, capability, and manifest helpers.
The full public reference lives in docs/reference/SDK_TYPESCRIPT_REFERENCE.md.
Official Example
The package-local governed example expects a running Chio hosted edge and trust service:
CHIO_BASE_URL=http://127.0.0.1:8931 \
CHIO_CONTROL_URL=http://127.0.0.1:8940 \
CHIO_AUTH_TOKEN=demo-token \
node --experimental-strip-types packages/sdk/chio-ts/examples/governed_hello.tsFor a repo-local end-to-end verification run that boots those services automatically, use:
./scripts/check-sdk-publication-examples.shCanonical Example Links
../../../docs/guides/WEB_BACKEND_QUICKSTART.md../../../examples/hello-openapi-sidecar/README.md../../../examples/hello-fastapi/README.md
Release Checks
npm --prefix packages/sdk/chio-ts test
./scripts/check-chio-ts-release.sh