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.

El problema

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 herramientas

01

TypeScript Client

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

02

Event Subscription

Suscríbase a eventos versionados con reconexión automática, backfill en caso de retraso, niveles de consistencia y payloads tipados ContextEventV1 incluyendo version, parentId y 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
herramientas

0 MCP herramientas

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

Documentación relacionada

Verificación

Cada salida lleva prueba

LeanCTX genera artefactos de prueba para cada sesión: qué archivos se leyeron, qué se comprimió, qué verificaciones pasaron y cómo se gastaron los tokens. Esto hace que el trabajo de IA sea auditable, reproducible y confiable.

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.