Skip to main content

A tool to generate Cursor IDE MDC files from repository analysis

Project description

Cursor MDC Generator

Autogenerate better Cursor documentation files (MDC). Vibe coding is easier when your AI knows the rules.

Twitter Follow

Features

  • Analyzes repository structure and code dependencies
  • Generates documentation files (MDC) for Cursor
  • Visualize dependency graph between files (if enabled)
  • Supports both local and remote repositories
  • Compatible with python, typescript, and javascript (for now)

Installation

You can install the package using pip:

pip install mdcgen

Or with uv:

uv install mdcgen

Installation with Visualization Support

You may need to install pygraphviz separately

macOS:

brew install graphviz
pip install --global-option=build_ext --global-option="-I/opt/homebrew/include/" --global-option="-L/opt/homebrew/lib/" pygraphviz
pip install mdcgen[visualization]

Ubuntu / Debian:

sudo apt-get install graphviz graphviz-dev
pip install mdcgen[visualization]

Windows:

  • Download and install Graphviz from https://graphviz.org/download/
  • Add the Graphviz bin directory to your PATH
  • Run: pip install mdcgen[visualization]

Usage

To analyze a repository and generate MDC files:

# Analyze current directory
mdcgen

# Analyze a specific local directory
mdcgen /path/to/repository

# Analyze a remote repository
mdcgen --repo https://github.com/user/repo

# Specify output directory
mdcgen /path/to/repository --out ./mdc-output

# Use a specific model
mdcgen /path/to/repo --model gpt-4o

# Skip visualization (useful if you don't have Graphviz installed)
mdcgen /path/to/repo --no-viz

For private repositories:

mdcgen --repo https://github.com/user/private-repo --token YOUR_GITHUB_TOKEN

Requirements

  • Python 3.7+
  • OpenAI/Anthropic/Google Key (set as environment variable vis-a-vis LiteLLM format)

Command Reference

Option Alias Description
PATH Local path to repository (default: current directory)
--repo -r GitHub repository URL (instead of local path)
--out -o Output directory for analysis files
--model -m Model to use for summaries (default: gpt-4o-mini)
--token -t OAuth token for private repositories
--imports -i Include @file references to imported files
--no-viz Skip generating dependency graph visualizations
--no-dirs Skip generating directory-level MDC files
--depth -d Max directory depth (0=repo only, 1=top-level dirs)
--log-level Set logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL)

Examples

# Skip all directory-level MDCs (only generate file and repository MDCs)
mdcgen /path/to/repo --no-dirs

# Limit directory depth (0=repo only, 1=top-level dirs only)
mdcgen /path/to/repo --depth 1

# Include import references in MDC files
mdcgen /path/to/repo --imports

# Using short aliases for common options
mdcgen /path/to/repo -o ./output -m gpt-4o -d 1

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mdcgen-0.1.8.tar.gz (34.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mdcgen-0.1.8-py3-none-any.whl (38.7 kB view details)

Uploaded Python 3

File details

Details for the file mdcgen-0.1.8.tar.gz.

File metadata

  • Download URL: mdcgen-0.1.8.tar.gz
  • Upload date:
  • Size: 34.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.6

File hashes

Hashes for mdcgen-0.1.8.tar.gz
Algorithm Hash digest
SHA256 b82aad6c9da01faa0872b821b6c5ee8ef8af2a942abccffbe4b6338348ff0db1
MD5 dd419f1e324288e7feace6844b8eb99e
BLAKE2b-256 fbc117af7e655f4f69df17ac48b9a8f655dc6aa736c21240e0efba8f96b9ea57

See more details on using hashes here.

File details

Details for the file mdcgen-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: mdcgen-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 38.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.6

File hashes

Hashes for mdcgen-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 d8ee2f7265173fcdda3dc13423f2fb523a5cad93ecdc93f90f4aaad379cc268f
MD5 436057073b5c1784722cca9e7bbe279d
BLAKE2b-256 84df817fb12c5c4b84b9ea62f07cafb8f61d0fa6298dee269f532c765176e6c0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page