Back to browse
GitHub Repository

Interactive documents from Markdown. Extends MD with forms, approvals, webhooks, and more — built for next gen apps

18 starsJavaScript

MDMA – Markdown extension that makes LLM responses interactive

by gitsad·Mar 5, 2026·2 points·1 comment

AI Analysis

●●SolidBig BrainShip It

LLM-generated Markdown with embedded forms and approval gates instead of prose instructions.

Strengths
  • Graceful degradation: malformed YAML blocks render as markdown, not breaking the entire response
  • Includes promptfoo eval suite + prompt-pack to teach LLMs the spec, addressing the authoring reliability problem
  • Deterministic parsing (no runtime JS) makes it safer than JSON-based AI output containers
Weaknesses
  • Adds another abstraction layer between LLM and UI; assumes LLM can reliably generate valid MDMA syntax
  • Competes with structured JSON schemas and tool-calling APIs that major LLM providers already optimize for
Target Audience

Product teams and developers building LLM-powered apps that need structured, validated outputs instead of free-form text responses.

Similar To

Anthropic tool_use · OpenAI function_calling · Structured output APIs

Post Description

AI responses are plain text. The user reads, then acts manually somewhere else. That gap kept bothering me — and JSON-based approaches made it worse, since a single malformed field breaks the whole payload.

MDMA extends Markdown with interactive components defined in fenced `mdma` code blocks (YAML inside). When an LLM knows the spec, it can respond with rendered forms, approval gates, tables, and webhooks instead of prose instructions. Because it's built on top of Markdown + YAML, parsing is deterministic — there's no runtime JS in the document and malformed blocks degrade gracefully rather than crashing.

The library includes a remark-based parser, a headless runtime with reactive bindings and a policy engine, a React renderer, and a prompt-pack that teaches LLMs how to generate valid MDMA. There's also a promptfoo eval suite to verify generation quality before shipping.

Available on npm under @mobile-reality. MIT.

Happy to discuss the spec design or tradeoffs vs structured JSON output.

Similar Projects