MCPcopy
hub / github.com/sanjeed5/awesome-cursor-rules-mdc

github.com/sanjeed5/awesome-cursor-rules-mdc @main sqlite

repository ↗ · DeepWiki ↗
40 symbols 146 edges 4 files 36 documented · 90%
README

MDC Rules Generator

Disclaimer: This project is not officially associated with or endorsed by Cursor. It is a community-driven initiative to enhance the Cursor experience.

This project generates Cursor MDC (Markdown Cursor) rule files from a structured JSON file containing library information. It uses Exa for semantic search and LLM (Gemini) for content generation.

Star History Chart

Features

  • Generates comprehensive MDC rule files for libraries
  • Uses Exa for semantic web search to gather best practices
  • Leverages LLM to create detailed, structured content
  • Supports parallel processing for efficiency
  • Tracks progress to allow resuming interrupted runs
  • Smart retry system that focuses on failed libraries by default

Prerequisites

  • Python 3.8+
  • uv for dependency management
  • API keys for:
  • Exa (for semantic search)
  • LLM provider (Gemini, OpenAI, or Anthropic)

Installation

  1. Clone this repository: bash git clone https://github.com/sanjeed5/awesome-cursor-rules-mdc.git cd awesome-cursor-rules-mdc

  2. Install dependencies using uv: bash uv sync

  3. Set up environment variables: Create a .env file in the project root with your API keys (see .env.example): EXA_API_KEY=your_exa_api_key GEMINI_API_KEY=your_google_gemini_api_key # For Gemini # Or use one of these depending on your LLM choice: # OPENAI_API_KEY=your_openai_api_key # ANTHROPIC_API_KEY=your_anthropic_api_key

Usage

Run the generator script with:

uv run src/generate_mdc_files.py

By default, the script will only process libraries that failed in previous runs.

Command-line Options

  • --test: Run in test mode (process only one library)
  • --tag TAG: Process only libraries with a specific tag
  • --library LIBRARY: Process only a specific library
  • --output OUTPUT_DIR: Specify output directory for MDC files
  • --verbose: Enable verbose logging
  • --workers N: Set number of parallel workers
  • --rate-limit N: Set API rate limit calls per minute
  • --regenerate-all: Process all libraries, including previously completed ones

Examples

# Process failed libraries (default behavior)
uv run src/generate_mdc_files.py

# Regenerate all libraries
uv run src/generate_mdc_files.py --regenerate-all

# Process only Python libraries
uv run src/generate_mdc_files.py --tag python

# Process a specific library
uv run src/generate_mdc_files.py --library react

Adding New Rules

Adding support for new libraries is simple:

  1. Edit the rules.json file:
  2. Add a new entry to the libraries array: json { "name": "your-library-name", "tags": ["relevant-tag1", "relevant-tag2"] }

  3. Generate the MDC files:

  4. Run the generator script: bash uv run src/generate_mdc_files.py
  5. The script automatically detects and processes new libraries

  6. Contribute back:

  7. Test your new rules with real projects
  8. Consider raising a PR to contribute your additions back to the community

Configuration

The script uses a config.yaml file for configuration. You can modify this file to adjust:

  • API rate limits
  • Output directories
  • LLM model selection
  • Processing parameters

Project Structure

.
├── src/                  # Main source code directory
│   ├── generate_mdc_files.py  # Main generator script
│   ├── config.yaml       # Configuration file
│   ├── mdc-instructions.txt   # Instructions for MDC generation
│   ├── logs/             # Log files directory
│   └── exa_results/      # Directory for Exa search results
├── rules-mdc/            # Output directory for generated MDC files
├── rules.json            # Input file with library information
├── pyproject.toml        # Project dependencies and metadata
├── .env.example          # Example environment variables
└── LICENSE               # MIT License

License

MIT License

Core symbols most depended-on inside this repo

mark_library_failed
called by 3
src/generate_mdc_files.py
save_progress
called by 2
src/generate_mdc_files.py
is_library_processed
called by 2
src/generate_mdc_files.py
is_library_failed
called by 2
src/generate_mdc_files.py
mark_library_completed
called by 2
src/generate_mdc_files.py
create_mdc_file
called by 2
rules-v0-deprecated/convert_to_mdc.py
save_progress
called by 2
rules-v0-deprecated/convert_to_mdc.py
load_config
called by 1
src/generate_mdc_files.py

Shape

Function 19
Method 16
Class 5

Languages

Python100%

Modules by API surface

src/generate_mdc_files.py25 symbols
rules-v0-deprecated/convert_to_mdc.py12 symbols
rules-v0-deprecated/test_conversion.py3 symbols

Dependencies from manifests, versioned

build1.2.2.post1 · 1×
exa-py1.0.0 · 1×
litellm1.0.0 · 1×
loguru0.7.3 · 1×
pydantic2.0.0 · 1×
python-dotenv1.0.0 · 1×
pyyaml6.0.0 · 1×
ratelimit2.2.1 · 1×
tenacity8.2.3 · 1×
twine6.1.0 · 1×

For agents

$ claude mcp add awesome-cursor-rules-mdc \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact