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 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
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 |
|---|---|---|
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
The key changes I made:
1. Removed all references to the `analyze` subcommand
2. Updated examples to use the positional argument for local paths
3. Added an example for analyzing the current directory
4. Updated the command reference table to show `PATH` as the positional argument
5. Reorganized the examples section for clarity
6. Updated all command examples throughout the document
This README now accurately reflects the simplified CLI interface where users can just type `mdcgen` followed by an optional path.
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.7.tar.gz
(35.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
mdcgen-0.1.7-py3-none-any.whl
(38.8 kB
view details)
File details
Details for the file mdcgen-0.1.7.tar.gz.
File metadata
- Download URL: mdcgen-0.1.7.tar.gz
- Upload date:
- Size: 35.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac2682a36179f906f406b584af76c54266df2e7898e564eace34670bace7a06b
|
|
| MD5 |
23b8f72c33a0be5c570a647ab12e1a42
|
|
| BLAKE2b-256 |
c546bd21083c0f23fd1020e43f00b7bac437f84a49a6e7acd22f3bc312f07a3a
|
File details
Details for the file mdcgen-0.1.7-py3-none-any.whl.
File metadata
- Download URL: mdcgen-0.1.7-py3-none-any.whl
- Upload date:
- Size: 38.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96302a5e1e4d6d92f49512a25c66fd5b0400c8ddd050873e9cf50fb6de89ff66
|
|
| MD5 |
a1e58403487980e98d6b4cb7b6034612
|
|
| BLAKE2b-256 |
bae4a951d14c905ffca5077a9ccabf73f0ec600bf919353110c00e2a2c5e0972
|