{
  "markdown": "<div align=\"center\">\n\n# ldraw-mcp\n\n**Give your MCP client eyes for LEGO® models.**\n\nRender LDraw files (`.ldr` / `.mpd` / `.dat`) to images with _real part\ngeometry_ — studs, slopes, window glass — using headless Blender and the\nImportLDraw addon. The output looks like a BrickLink Stud.io render, with no\nGUI anywhere in the loop.\n\n[![PyPI](https://img.shields.io/pypi/v/ldraw-mcp?color=%230a7bbb&label=PyPI)](https://pypi.org/project/ldraw-mcp/)\n[![Python](https://img.shields.io/pypi/pyversions/ldraw-mcp)](https://pypi.org/project/ldraw-mcp/)\n[![License](https://img.shields.io/pypi/l/ldraw-mcp)](LICENSE)\n[![MCP](https://img.shields.io/badge/MCP-server-8A2BE2.svg)](https://modelcontextprotocol.io)\n[![CI](https://github.com/musharna/ldraw-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/musharna/ldraw-mcp/actions/workflows/ci.yml)\n[![Glama](https://glama.ai/mcp/servers/musharna/ldraw-mcp/badges/score.svg)](https://glama.ai/mcp/servers/musharna/ldraw-mcp)\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.21713452.svg)](https://doi.org/10.5281/zenodo.21713452)\n\n<img src=\"docs/hero.png\" alt=\"Two rendered views of a red LEGO car — real studs, transparent glass, rubber tires, steering wheel\" width=\"100%\">\n\n<sub>A ~90-line <code>.ldr</code> rendered front-left and rear-right — actual bricks, not a geometric proxy.</sub>\n\n</div>\n\n<!-- mcp-name: io.github.musharna/ldraw-mcp -->\n\n---\n\nPoint a vision-capable model at a build and it sees the actual bricks:\ncrossed rotation matrices, floating plates, sunken windows — the kinds of\nexport bugs a geometric proxy render will happily hide.\n\n## Quickstart\n\n```bash\n# 1. install\npip install ldraw-mcp\n\n# 2. install the LDraw parts library + ImportLDraw addon\nldraw-mcp-setup\n\n# 3. register with Claude Code\nclaude mcp add ldraw -- ldraw-mcp\n```\n\nThen ask things like _\"render output/build.ldr and tell me what looks\nwrong\"_ — the model sees the render, not just the text.\n\n> **Blender is a prerequisite** (see [Requirements](#requirements)); it is\n> not installed by `ldraw-mcp-setup`.\n\n## Tools\n\n| tool                                                                      | what it does                                                     |\n| ------------------------------------------------------------------------- | ---------------------------------------------------------------- |\n| `render_ldraw_file(path, azimuths=\"-60,120\", resolution=640, samples=24)` | Render a model file to a PNG (multi-view, stitched side by side) |\n| `render_ldraw_text(ldr, azimuths=\"-60,120\", resolution=640, samples=24)`  | Render inline LDraw content without writing a file first         |\n| `check_renderer()`                                                        | Diagnose the Blender / addon / parts-library setup               |\n\n`azimuths` is a comma-separated list of view angles in degrees; each is\nrendered and the views are stitched horizontally. Elevation is fixed at\n22°. Higher `samples` = cleaner but slower.\n\n## Requirements\n\n- **Blender 4.x** on `PATH`, or point `LDRAW_MCP_BLENDER` at the binary.\n  Install it yourself (package manager, blender.org, or a local build);\n  `ldraw-mcp-setup` does not install Blender.\n- **ImportLDraw addon** (`io_scene_importldraw`) in Blender's addons dir —\n  installed by `ldraw-mcp-setup`.\n- **LDraw parts library** at `~/.ldraw` (or `LDRAW_LIBRARY_PATH`) —\n  installed by `ldraw-mcp-setup`.\n\n### Environment variables\n\n| var                  | meaning                                                |\n| -------------------- | ------------------------------------------------------ |\n| `LDRAW_MCP_BLENDER`  | Path to the blender binary (overrides `PATH` lookup)   |\n| `LDRAW_MCP_DISABLE`  | Set to `1` to force `is_available()` to `False`        |\n| `LDRAW_LIBRARY_PATH` | Path to the LDraw parts library (community convention) |\n\n### Manual setup\n\nIf `ldraw-mcp-setup` can't detect things automatically:\n\n- **LDraw library:** download\n  [complete.zip](https://library.ldraw.org/library/updates/complete.zip)\n  and unzip so that `~/.ldraw/parts/` exists.\n- **ImportLDraw addon:** download the latest release from\n  [TobyLobster/ImportLDraw](https://github.com/TobyLobster/ImportLDraw/releases)\n  and install it via _Blender > Preferences > Add-ons > Install_, or unzip\n  into `~/.config/blender/<version>/scripts/addons/io_scene_importldraw/`.\n  (Launch Blender once first so the config directory exists.)\n\n## Troubleshooting\n\n- **`check_renderer` says NOT FOUND:** run `ldraw-mcp-setup`, or set the\n  relevant env var above.\n- **No GPU / WSL2 / containers:** rendering uses **Cycles on CPU**, which\n  works headless everywhere — no GPU or display needed. A ~150-part model\n  takes a few seconds at the default 640px / 24 samples.\n- **\"no mesh objects imported\":** the addon couldn't resolve parts —\n  usually a wrong or incomplete LDraw library path. Re-run setup or check\n  `LDRAW_LIBRARY_PATH`.\n- **Addon not enabled:** the render script enables it automatically per\n  run; if a manual Blender session complains, enable `io_scene_importldraw`\n  in Preferences > Add-ons.\n\n## Provenance\n\nThis renderer was extracted from the **prompt2brick** project, where it\nstarted life as the vision critic's \"see the actual model\" path.\nprompt2brick keeps its own vendored copy of the render wrapper and Blender\nscript, but **this repo is the canonical source going forward** — fixes and\nimprovements to the renderer should land here first and be ported back into\nprompt2brick.\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n\n---\n\n<sub>LEGO® is a trademark of the LEGO Group, which does not sponsor,\nauthorize, or endorse this project. This tool is not affiliated with the\nLEGO Group, BrickLink, or the LDraw.org organization.</sub>\n",
  "bytes": 5725,
  "sha": "88fccf4941f324f1aa5e1d3bcb87ff8c58938898dec5652a281491a94b6bd73b",
  "repo_slug": "musharna/ldraw-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_musharna_ldraw_mcp_c0981aa9/readme"
}