ConfigsApr 6, 2026·2 min read

Awesome Cursor Rules MDC — Auto-Generated .mdc Files

Collection of auto-generated Cursor .mdc rule files for 800+ libraries using Exa search and LLM. Drop into .cursor/rules/ for AI-aware coding standards. CC0, 3,400+ stars.

TL;DR
A CC0-licensed collection of 800+ auto-generated Cursor .mdc rule files for popular libraries.
§01

What it is

Awesome Cursor Rules MDC is an open-source repository that auto-generates .mdc (Markdown Cursor) rule files for 800+ libraries using Exa search and LLM processing. Each .mdc file teaches Cursor AI the conventions, best practices, and API patterns of a specific library so the editor produces higher-quality suggestions.

The project targets developers who use Cursor as their primary editor and want framework-aware code generation without manually writing custom rules for every dependency.

§02

How it saves time or tokens

Without cursor rules, the AI assistant in Cursor relies on its training data alone, which may be outdated or generic. By loading a .mdc file that encodes the latest API surface and idioms for a library, you reduce the back-and-forth prompting needed to get correct code. Each rule file is compact enough to fit within Cursor's context budget, so it does not waste tokens on irrelevant information. The auto-generation pipeline keeps rules current as libraries evolve.

§03

How to use

  1. Browse rules at the repository: github.com/sanjeed5/awesome-cursor-rules-mdc
  2. Find your framework or library in the rules-mdc/ directory
  3. Copy the .mdc file into your project's .cursor/rules/ directory
  4. Cursor auto-loads the rules on the next session

To generate a custom rule for a library not yet covered:

git clone https://github.com/sanjeed5/awesome-cursor-rules-mdc.git
cd awesome-cursor-rules-mdc
uv run src/generate_mdc_files.py --library 'fastapi'
§04

Example

A generated .mdc file for FastAPI might look like this:

---
description: FastAPI best practices and patterns
globs: ['**/*.py']
alwaysApply: false
---

# FastAPI Rules
- Use Pydantic v2 models for request/response schemas
- Prefer async def for route handlers
- Use Depends() for dependency injection
- Return explicit status codes via status_code parameter
- Use APIRouter for route grouping

Drop this into .cursor/rules/fastapi.mdc and Cursor will apply these conventions whenever you work on Python files in that project.

§05

Related on TokRepo

  • Prompt Library — browse curated prompts and rules for various AI coding tools
  • AI Tools for Coding — discover more developer productivity tools that integrate with AI editors
§06

Common pitfalls

  • Do not place .mdc files outside .cursor/rules/ or Cursor will not detect them
  • Setting alwaysApply: true on many rules at once can bloat the context window and degrade suggestion quality
  • Auto-generated rules may lag behind breaking API changes in fast-moving libraries; verify against official docs after generation

Frequently Asked Questions

What is an .mdc file in Cursor?+

An .mdc (Markdown Cursor) file is a rule definition that Cursor AI reads to understand a library's conventions. It contains metadata like glob patterns and a markdown body with coding guidelines. When placed in .cursor/rules/, Cursor applies these rules during code generation.

How do I generate a rule for a library not in the collection?+

Clone the repository and run the generation script with the --library flag. The script uses Exa search to gather current documentation and an LLM to distill it into a concise .mdc rule file. For example: uv run src/generate_mdc_files.py --library 'django'.

Can I use these rules with editors other than Cursor?+

The .mdc format is specific to Cursor. Other editors like VS Code with Copilot or Windsurf use different rule formats. However, the markdown content inside .mdc files can serve as a reference for writing rules in other formats.

Are the generated rules always accurate?+

Rules are auto-generated using LLM and search, so they may contain outdated patterns or miss recent API changes. Always cross-check critical rules against the official library documentation, especially for libraries with frequent breaking changes.

What license applies to these rule files?+

The repository is licensed under CC0 (public domain dedication). You can use, modify, and distribute the rule files without restriction or attribution.

Citations (3)
🙏

Source & Thanks

Created by sanjeed5. Licensed under CC0 1.0.

awesome-cursor-rules-mdc — ⭐ 3,400+

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets