MDX parser that converts .mdx files (Markdown + JSX) into the Nous Document Model with support for embedded component invocations.
npm install @nousdev/parser-mdximport { createMdxParser } from '@nousdev/parser-mdx';
const parser = createMdxParser();
const doc = await parser.parse(
`# API Reference
<EndpointCard method="GET" path="/users" />
Returns a list of users.`,
{ filePath: 'api.mdx', format: 'mdx' },
);createMdxParser(options?)-- returns aNousParserfor.mdxfiles; JSX elements becomeComponentInvocationNodeentries in the NDM tree
- All standard Markdown and GFM features (tables, strikethrough, task lists)
- YAML frontmatter extraction
- JSX component invocations parsed as
ComponentInvocationNode - Component prop extraction and nested children support
- Built on unified with
remark-parse,remark-mdx,remark-gfm, andremark-frontmatter
MIT