[!FROZEN] MPLP Protocol v1.0.0 Frozen Specification Freeze Date: 2025-12-03 Status: FROZEN (no breaking changes permitted) Governance: MPLP Protocol Governance Committee (MPGC) License: Apache-2.0 Note: Any normative change requires a new protocol version.
TypeScript SDK Guide
1. Purpose
The MPLP TypeScript SDK (@mplp/sdk-ts) is the Official / Reference implementation of MPLP v1.0.0. It provides full type safety and Ajv-based runtime validation.
2. Installation
npm install @mplp/sdk-ts
3. Core Components
// Core Models
import { ContextFrame, PlanDocument } from '@mplp/sdk-ts/core';
// Runtime
import { RuntimeEngine } from '@mplp/sdk-ts/runtime';
| Module | Purpose |
|---|---|
core/ | Core type definitions and models |
runtime/ | Runtime engine implementations |
builders/ | Builder pattern for Context, Plan, Events |
client/ | Client utilities |
4. Quick Start
import { ContextBuilder, PlanBuilder } from '@mplp/sdk-ts';
// Create a Context using builder pattern
const ctx = new ContextBuilder()
.title("My Project")
.domain("code-assistance")
.build();
// Create a Plan
const plan = new PlanBuilder()
.contextId(ctx.context_id)
.objective("Hello World")
.build();
console.log(ctx.context_id, plan.plan_id);
5. Validation
The SDK uses Ajv for JSON Schema validation:
import Ajv from 'ajv';
import addFormats from 'ajv-formats';
const ajv = new Ajv();
addFormats(ajv);
// Validate against schemas/v2/*.schema.json
6. References
- Package:
packages/sdk-ts/package.json - Schemas:
schemas/v2/ - Tests:
packages/sdk-ts/tests/
2025 Bangshi Beijing Network Technology Limited Company Licensed under the Apache License, Version 2.0.