Configs2026年3月29日·1 分钟阅读

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
快速使用

先拿来用,再决定要不要深挖

这里应该同时让用户和 Agent 知道第一步该复制什么、安装什么、落到哪里。

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

介绍

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)

来源与感谢

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.

相关资产