ConfigsMar 29, 2026·1 min read

Cursor Rules MDC Generator

Auto-generate Cursor .mdc rule files for any library using Exa semantic search and LLM-powered documentation lookup.

TO
TokRepo精选 · Community
Quick Use

Use it first, then decide how deep to go

This block should tell both the user and the agent what to copy, install, and apply first.

git clone https://github.com/sanjeed5/awesome-cursor-rules-mdc.git
cd awesome-cursor-rules-mdc
uv sync
# Add API keys to .env (EXA_API_KEY + GEMINI/OPENAI/ANTHROPIC key)
uv run src/generate_mdc_files.py --library react --test

Intro

Not just a rules collection — a generator that creates Cursor .mdc rule files for any programming library. It uses Exa semantic search to find best practices and documentation, then an LLM (Gemini, OpenAI, or Anthropic) to produce comprehensive, structured rule files. Generate rules for your exact tech stack instead of using generic ones. 3,400+ stars.


How It Works

  1. You specify a library (e.g., React, FastAPI, Prisma)
  2. Exa semantic search finds documentation, best practices, and patterns for that library
  3. LLM processes the gathered information into a structured .mdc rule file
  4. Output is a ready-to-use Cursor rule file tailored to that specific library

Usage

Generate for a specific library

uv run src/generate_mdc_files.py --library fastapi

Generate for a category

uv run src/generate_mdc_files.py --tag backend

Batch generate with concurrency

uv run src/generate_mdc_files.py --workers 4 --rate-limit 10

Regenerate all rules

uv run src/generate_mdc_files.py --regenerate-all

Adding New Libraries

Edit rules.json:

{
  "name": "your-library",
  "tag": "category"
}

Then run the generator to create the .mdc file automatically.

Requirements

  • Python 3.8+
  • Exa API key (for semantic search)
  • LLM API key (Gemini, OpenAI, or Anthropic)

Source & Thanks

Author: sanjeed5 Repository: awesome-cursor-rules-mdc — ⭐ 3,400+ License: CC0 (Public Domain)

Thanks to sanjeed5 for building a generator rather than just a collection — create Cursor rules for any library on demand.

Related Assets