Next.js provides built-in support (opens in a new tab) for creating pages from MDX files, though it doesn't seem to support anything complex. Exported metadata can't be read from
Layout except with a plugin, which seems to kind of defeat the whole purpose of using Next.js built-in MDX. You'll also need to iterate through the directory to get all the slugs, which seems like the same amount of work as using something else.
next-mdx-remote if you need to do fancy things like use frontmatter in the page or display the content from several MDX files in one page.