Skip to main content

A tool to generate Cursor IDE MDC files from repository analysis

Project description

Cursor MDC Generator

A tool to generate Cursor IDE documentation files (MDC) from repository analysis.

Installation

You can install the package using pip:

pip install mdcgen

Or with uv:

uv install mdcgen

Installation with Visualization Support

macOS:

brew install graphviz
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 a local repository
mdcgen analyze --local /path/to/repository

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

# Specify output directory
mdcgen analyze --repo https://github.com/user/repo --out ./mdc-output

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

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

For private repositories:

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

Features

  • Analyzes repository structure and code dependencies
  • Creates dependency graphs to visualize relationships between files (if enabled)
  • Generates documentation files (MDC) for use with Cursor IDE
  • Supports both local and remote repositories
  • Compatible with various programming languages (python, typescript, javascript for now)

Requirements

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

Command Reference

Option Alias Description
--repo -r GitHub repository URL
--local -l Local path to repository
--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)

Skip all directory-level MDCs (only generate file and repository MDCs)

mdcgen analyze --local /path/to/repo --no-dirs

Limit directory depth (0=repo only, 1=top-level dirs only)

mdcgen analyze --local /path/to/repo --depth 1

Include import references in MDC files

mdcgen analyze --local /path/to/repo --imports

Using short aliases for common options

mdcgen analyze -l /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.3.tar.gz (29.1 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.3-py3-none-any.whl (32.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mdcgen-0.1.3.tar.gz
  • Upload date:
  • Size: 29.1 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.3.tar.gz
Algorithm Hash digest
SHA256 98a964074a494c6c683ef27a33306e2afe76775dfd40344c86ad571eb775fe54
MD5 c4aaa03ffb3ea9a6b4150be5e7cd7609
BLAKE2b-256 0c4d347d3e1dd43b952deace18b9ccc1d9eef099a86c11750816ba39ba36d49a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mdcgen-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 32.9 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 24f113871a0fc222d89665d96547989de98fa6d1b86f80c3068d4928ee9fe610
MD5 f6c7a2398c25cf1f0a0b08d6e0518c83
BLAKE2b-256 16c9a968a0bab1819b4843061235dafad37e8137bee1f42811cec67bd9104456

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