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

**Category:** 🗄️ Databases  
**Repository:** https://github.com/FROWNINGdev/django-orm-lens  
**GitHub Stars:** 73  
**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 detected from listing signals. Uses `uvx` (confidence: high):

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

**Requires environment variables:** `DJANGO_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 MCP server does

FROWNINGdev/django-orm-lens MCP server gives an AI client a static view of a Django project's ORM structure. It extracts information from the project's source code rather than querying a live database or booting the Django application. That makes it suitable for repository analysis when the database is unavailable, the project environment is incomplete, or loading the application settings is undesirable.

The exposed data includes Django apps, models, fields, and model relationships. Relationship details include foreign keys, many-to-many and one-to-one associations, `on_delete` behavior, and related names. The server also analyzes migration dependencies, possible cascade effects, index opportunities, and signal connections.

## How it works

The MCP package uses the same static parser core as the project's other distribution surfaces. An MCP client sends a schema question to the server, and the server reads the Django project files under the configured root. Results are returned as analysis of the source rather than as runtime observations from Django or the database.

This design avoids several runtime requirements. The material states that the server does not need a database, a running `runserver` process, a working virtual environment, a settings module, or credentials for its static scan. It therefore fits code review, repository exploration, and architecture questions where source-level structure is the relevant ground truth.

## Setup and configuration

Install the MCP extra from PyPI with:

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

Configure `DJANGO_ORM_LENS_ROOT` with the absolute path to the Django project being analyzed. The README describes MCP setup as a JSON client configuration that points this variable at the project root, but the supplied material does not provide the complete configuration block or a separate server launch command.

The package is described as MIT-licensed and does not require an API key, account, paid service, or database credentials. The same project also provides a CLI and editor extensions, but those are separate distribution surfaces from the MCP interface.

## Tools and capabilities

The listing identifies these read-only tools:

- `listapps` — inspect Django applications.
- `listmodels` — enumerate models.
- `describemodel` — inspect model structure and fields.
- `findrelations` — examine foreign-key, many-to-many, and one-to-one relationships.
- `cascadepreview` — review deletion and cascade behavior.
- `erdiagram` — represent the model graph as an entity-relationship diagram.
- `describemigrationdependency` — inspect migration dependency relationships.
- `suggestindexes` — identify missing or useful indexes from the analyzed ORM structure.
- `signalgraph` — inspect signal connections across the project.

FROWNINGdev/django-orm-lens MCP server is read-only: the supplied description does not indicate tools for changing source files, applying migrations, mutating database records, or running queries against a database.

## Limitations and notes

Static analysis cannot provide live database state or runtime behavior that is not represented in the parsed project source. In particular, this MCP server should not be treated as a database inspection tool or as a replacement for executing Django migrations and queries.

The README names Cursor, Windsurf, Claude Code, Aider, Zed, and Continue as agent or editor surfaces for the broader project. The provided material does not specifically confirm Claude Desktop compatibility. FROWNINGdev/django-orm-lens MCP server is best matched to agents that need repository-local Django schema context without application startup.

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

