# FROWNINGdev/django-orm-lens [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/FROWNINGdev/django-orm-lens  
**GitHub Stars:** 115  
**Views:** 3  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/frowningdev-django-orm-lens

## Description
Django ORM static-analysis MCP server. Nine read-only tools (listapps, listmodels, describemodel, findrelations, cascadepreview, erdiagram, describemigrationdependency, suggestindexes, signalgraph) that expose Django schema, relationships (FK/M2M/O2O, ondelete, relatedname), migration deps, missing indexes, and signal graphs — no DB, no Django boot, no credentials. Companion to a VS Code / VSCodium / Cursor extension (Open VSX verified) and a django-orm-lens PyPI CLI. pip install django-orm-lens[mcp].

## Claude Desktop Quick Installation
Install path inferred — verify against the README before running it. Uses `uvx` (confidence: medium):

```json
"mcpServers": {
  "django-orm-lens": {
    "command": "uvx",
    "args": ["orm-lens","orm-lens-mcp"],
    "env": {
      "ORM_LENS_ROOT": ""
    }
  }
}
```

**Requires environment variables:** `ORM_LENS_ROOT` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What FROWNINGdev/django-orm-lens does

FROWNINGdev/django-orm-lens makes Django's model structure available to AI agents through the Model Context Protocol. Its analysis is static: it reads project source rather than importing Django, connecting to a database, running a server, or requiring application credentials.

The MCP distribution is intended for schema-oriented questions. Agents can inspect installed applications and models, understand fields and relationships, preview cascade effects, examine migration dependencies, identify possible missing indexes, and map signal handlers. The package is the MCP surface of the broader ORM Lens project, which also has editor and command-line distributions.

## How it works

Install the package with its MCP extra, point `ORM_LENS_ROOT` at the target project's absolute directory, and register the MCP process in the chosen client. The parser works from the repository's Django code and migrations, so it can operate even when the project's virtual environment is unavailable or Django cannot boot.

Results are read-only. The server does not modify models, migrations, databases, or project files. Static parsing also means the returned structure reflects what the analyzer can determine from source code rather than runtime database state.

## Setup and configuration

Install the MCP variant with:

```bash
pip install "django-orm-lens[mcp]"
```

Configure the MCP client to launch the installed server and set:

```text
ORM_LENS_ROOT=/absolute/path/to/project
```

The repository also identifies the package as `orm-lens`; the `django-orm-lens` package name remains supported for installation. The MCP server can be used alongside the project's VS Code, VSCodium, or Cursor extension, but the extension and MCP package are separate interfaces.

## Tools and capabilities

The nine read-only tools provide the following views:

- `listapps` — enumerate Django applications.
- `listmodels` — list models available in the project.
- `describemodel` — inspect a model's structure.
- `findrelations` — find foreign-key, many-to-many, and one-to-one relationships, including `on_delete` and `related_name` details.
- `cascadepreview` — examine potential deletion cascades.
- `erdiagram` — produce an entity-relationship view of the model graph.
- `describemigrationdependency` — inspect dependencies between migrations.
- `suggestindexes` — surface possible missing indexes.
- `signalgraph` — show relationships between signals and their handlers.

These tools suit agents answering questions about schema structure, relationship impact, migration ordering, indexing, and signal behavior without requiring runtime application access.

## Limitations and notes

The server is intentionally read-only and static. It does not use a database, boot Django, run `runserver`, or require credentials. Consequently, it is best suited to source-derived schema analysis rather than queries about live data, database statistics, or runtime behavior. The MCP listing describes the Django toolset; the wider ORM Lens project also supports static analysis for SQLAlchemy and Alembic through its other interfaces.

The project is MIT-licensed and belongs to the Developer Tools category. Its related editor extension is available for VS Code, VSCodium, and Cursor, with an Open VSX distribution.

_Full upstream README: https://allmcps.com/mcp/frowningdev-django-orm-lens/readme_

