SDK & API

Building on top of AI context infrastructure requires reverse-engineering internal protocols.

The LeanCTX SDK provides a typed TypeScript client for the full Context OS API. Call any tool, subscribe to events, mutate sessions, and query knowledge — all through a clean, documented interface. The same API is available as REST endpoints for any language.

问题

No Public Interface

You want to build a dashboard, a CI integration, or a custom agent orchestrator. But the only interface is an internal MCP protocol designed for IDE consumption, not programmatic access.

Connect to the Context OS and subscribe to workspace events with just a few lines of TypeScript.

typescript
typescript ()
- import { LeanCtx } from "@anthropic/lean-ctx-sdk";
-
- const ctx = new LeanCtx({
- baseUrl: "http://localhost:7700",
- workspace: "my-team",
- });
-
- for await (const ev of ctx.subscribe("feat/auth")) {
- console.log(ev.type, ev.data);
- }
SDK & API

4 工具

01

TypeScript Client

Fully typed client library with async iterators for event streams, workspace/channel headers, and error handling.

02

Event Subscription

订阅版本化事件,具备自动重连、滞后时回填、一致性级别和类型化 ContextEventV1 有效负载(包含 version、parentId 和 consistencyLevel)。

03

REST API

Every tool and endpoint available as REST. JSON request/response with typed errors and rate limiting.

04

Token Authentication

Team tokens with configurable scopes. SHA-256 hashed, config-driven issuance via lean-ctx team token create.

TS TypeScript SDK
REST HTTP API
58+ Available Tools
工具

0 MCP 工具

The LeanCTX SDK provides a typed TypeScript client for the full Context OS API. Call any tool, subscribe to events, mutate sessions, and query knowledge — all through a clean, documented interface. The same API is available as REST endpoints for any language.

SDK & API

相关文档

验证

每个输出都附带证明

LeanCTX为每个会话生成证明构件:读取了哪些文件、压缩了什么、哪些检查通过了、Token如何使用。这使AI工作可审计、可重放、值得信赖。

Explore SDK & API

The LeanCTX SDK provides a typed TypeScript client for the full Context OS API. Call any tool, subscribe to events, mutate sessions, and query knowledge — all through a clean, documented interface. The same API is available as REST endpoints for any language.