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.
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.
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.
How to use
- Browse rules at the repository:
github.com/sanjeed5/awesome-cursor-rules-mdc - Find your framework or library in the
rules-mdc/directory - Copy the
.mdcfile into your project's.cursor/rules/directory - 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'
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.
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
Common pitfalls
- Do not place
.mdcfiles outside.cursor/rules/or Cursor will not detect them - Setting
alwaysApply: trueon 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
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.
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'.
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.
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.
The repository is licensed under CC0 (public domain dedication). You can use, modify, and distribute the rule files without restriction or attribution.
Citations (3)
- Awesome Cursor Rules MDC GitHub— Repository with 800+ auto-generated .mdc files
- Cursor Docs— Cursor rules documentation and .mdc format specification
- Exa AI— Exa search API used for gathering library documentation
Related on TokRepo
Source & Thanks
Created by sanjeed5. Licensed under CC0 1.0.
awesome-cursor-rules-mdc — ⭐ 3,400+
Discussion
Related Assets
Conda — Cross-Platform Package and Environment Manager
Install, update, and manage packages and isolated environments for Python, R, C/C++, and hundreds of other languages from a single tool.
Sphinx — Python Documentation Generator
Generate professional documentation from reStructuredText and Markdown with cross-references, API autodoc, and multiple output formats.
Neutralinojs — Lightweight Cross-Platform Desktop Apps
Build desktop applications with HTML, CSS, and JavaScript using a tiny native runtime instead of bundling Chromium.