The reason why you don't know is that you've decided in advance that it's not actually needed.
.astro is not actually like MDX at all. MDX extends Markdown, Astro does not, it extends HTML. MDX is a variant of JSX, Astro is not, it supports things that JSX does not like void elements. Astro supports text inside of script and style tags, JSX does not.
If you think you can rebuild Astro with "a few extra preprocessor rules", then by all means go for it. But you're going to fail.
Open your browser devtools, pick a random tag on the page, add "client:load" to it, and then "console.log(yourEl.properties)"
I dunno why you need an entire custom filetype for behavior and semantics that are MDX with a few extra preprocessor rules