What is a .mdc file?

When adding a new rule file to cursor/rules, cursor automatically creates a .mdc file. There is no mention of this file type or how the actual description of the rule should be formatted. So, I have a few questions:

  1. is this some kind of markdown extension? The most likely candidate I could find is mdc which afaict was born out of the nuxt front end framework.

  2. Should these files be formatted as markdown? It looks like the .mdc extension exists so that xml can be embedded in a markdown file. So should these rules be encoded as xml? Can we just treat these as plaintext and assume the model will figure it out? It would be great to know what the intention of the cursor developers is here.

This is what I found when I asked cursor about it with @web

This is similar to how other specialized Markdown variants have their own extensions. For example, from the search results we can see:

  • .md or .markdown for standard Markdown files

  • .mdc for Cursor’s rule files

  • Other variants like RMarkdown have their own extensions too

The .mdc extension helps Cursor identify which files should be processed as rules, just like how .md helps systems identify regular Markdown files. It’s a way of telling Cursor “this is a rules file” rather than just a regular Markdown or YAML file.

[Source: Using the "project-rules" in 0.45.2]

#You might find this helpful.

1 Like