# Cursor Rules MDC Generator — Auto-Generate from Docs > Auto-generate Cursor .mdc rule files for any library using Exa semantic search and LLM-powered documentation extraction. ## Install Save in your project root: ## Quick Use ```bash 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. **Works with**: Cursor, Claude Code, GitHub Copilot, Gemini CLI, OpenAI Codex --- ## 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 ```bash uv run src/generate_mdc_files.py --library fastapi ``` ### Generate for a category ```bash uv run src/generate_mdc_files.py --tag backend ``` ### Batch generate with concurrency ```bash uv run src/generate_mdc_files.py --workers 4 --rate-limit 10 ``` ### Regenerate all rules ```bash uv run src/generate_mdc_files.py --regenerate-all ``` ## Adding New Libraries Edit `rules.json`: ```json { "name": "your-library", "tag": "category" } ``` Then run the generator to create the .mdc file automatically. ## Requirements - Python 3.8+ - [Exa API key](https://exa.ai) (for semantic search) - LLM API key (Gemini, OpenAI, or Anthropic) --- ### FAQ **Q: What is Cursor Rules MDC Generator?** A: Auto-generate Cursor .mdc rule files for any library using Exa semantic search and LLM-powered documentation extraction. **Q: How do I install Cursor Rules MDC Generator?** A: Check the Quick Use section above for step-by-step installation instructions. Most assets can be set up in under 2 minutes. ## Source & Thanks > Created by [sanjeed5](https://github.com/sanjeed5). Licensed under CC0 (Public Domain). > [awesome-cursor-rules-mdc](https://github.com/sanjeed5/awesome-cursor-rules-mdc) — ⭐ 3,400+ Thanks to sanjeed5 for building a generator rather than just a collection — create Cursor rules for any library on demand. --- Source: https://tokrepo.com/en/workflows/8ced00e7-b6b4-4ea8-adfb-3ddc0fe82620 Author: AI Open Source