MDX.org.ai Documentation
The complete MDX ecosystem combining structured data, unstructured content, executable code, and UI components
MDX.org.ai
MDX.org.ai extends MDX to combine four integrated layers in a single document format:
- Structured Data - YAML-LD frontmatter with JSON-LD semantics
- Unstructured Content - Markdown prose with rich formatting
- Executable Code - TypeScript/JSX for logic and interactions
- UI Components - React components for rendering
The Four Layers
Every MDX document naturally contains these four distinct layers:
Why MDX.org.ai?
Traditional content systems force you to choose between:
- CMS databases - structured but not code-friendly
- Markdown files - portable but no schema validation
- React apps - powerful but content is buried in code
MDX.org.ai unifies all four concerns in a single, portable file format that works with any database, any framework, and any rendering target.
Quick Start
Parse an MDXLD document:
The Four Layers in Detail
Structured Data
YAML-LD frontmatter provides typed, validated, linked data:
| Package | Description |
|---|---|
| mdxld | Core parser for YAML-LD frontmatter |
| mdxdb | Database storage for MDX documents |
| @mdxld/jsonld | JSON-LD conversion and vocabularies |
| @mdxld/validate | Schema validation with ArkType |
See the Structured Data overview.
Unstructured Content
Markdown content body with parsing and bi-directional extraction:
| Package | Description |
|---|---|
| @mdxld/extract | Extract structured data from rendered markdown |
| @mdxld/ast | AST manipulation and traversal |
See the Unstructured Content overview.
Executable Code
TypeScript functions, AI agents, and multi-runtime execution:
| Package | Description |
|---|---|
| mdxe | MDX execution runtime |
| mdxai | AI agents with MCP server integration |
| @mdxe/workers | Cloudflare Workers runtime |
| @mdxe/hono | Hono web framework middleware |
See the Executable Code overview.
UI Components
Component specifications and multi-format rendering:
| Package | Description |
|---|---|
| mdxui | Component specifications (31 components) |
| @mdxui/html | Render to HTML strings |
| @mdxui/json | Render to JSON-LD |
| @mdxui/shadcn | Render with shadcn/ui |
| @mdxui/fumadocs | Documentation site rendering |
See the UI Components overview.
Architecture
Key Features
Linked Data with YAML-LD
MDXLD extends frontmatter with JSON-LD compatible properties:
Type-Safe Validation
Validate documents with ArkType schemas:
Multiple Storage Backends
Store MDX documents anywhere:
Cloudflare-Native Execution
Run MDX on Cloudflare Workers, and locally under Miniflare:
Multi-Format Rendering
Render components to any output:
License
MIT